Find the answer to your Linux question:
Results 1 to 8 of 8
Hi. How do I limit the space a user can save/store files. Say I want each user just to have 500MB of space. How/where do I define that. I'm running ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    j1s
    j1s is offline
    Just Joined! j1s's Avatar
    Join Date
    Nov 2006
    Location
    Norway
    Posts
    90

    Limit user space


    Hi.

    How do I limit the space a user can save/store files. Say I want each user just to have 500MB of space. How/where do I define that.

    I'm running a Ubuntu 7.10 server, fresh install, with Apache, PHP and MySql.

    J1s

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Enable filesystem Quota to limit disk space usage for users and/or groups.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    j1s
    j1s is offline
    Just Joined! j1s's Avatar
    Join Date
    Nov 2006
    Location
    Norway
    Posts
    90
    Thank you, but isn't there an easier way?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User Allblack's Avatar
    Join Date
    May 2003
    Location
    Godzone
    Posts
    416
    This is the purpose of quotas and as easy as it gets
    I am on a journey to mastering Linux and I got a bloody long way to go!!!

  6. #5
    Linux Newbie athlon_crazy's Avatar
    Join Date
    Sep 2007
    Location
    Malaysia
    Posts
    132
    Use virtual filesystem with "dd"

    example set user1 home folder for 20MB
    ~$:dd if=/dev/zero of=/home/user1/user1-disk.ext3 count=40960

    Make ext3
    ~$:mkfs.ext3 /home/user1/user1-disk.ext3

    Add into /etc/fstab
    /home/user1/user1-disk.ext3 /home/user1 rw,loop 0 0

    Mount
    mount -o loop=/dev/loop0 /home/user1/user1-disk.ext3 /home/user1

    Testing
    - Copy size larger than 20MB sure you will get error message "no space left"
    - run ~$df -m
    - run ~$mount

    ariyossss

  7. #6
    j1s
    j1s is offline
    Just Joined! j1s's Avatar
    Join Date
    Nov 2006
    Location
    Norway
    Posts
    90
    Now we're talking. But what if I have a lot of users? More than 50.

  8. #7
    Linux Newbie athlon_crazy's Avatar
    Join Date
    Sep 2007
    Location
    Malaysia
    Posts
    132
    It's easy! go for quota ...

  9. #8
    j1s
    j1s is offline
    Just Joined! j1s's Avatar
    Join Date
    Nov 2006
    Location
    Norway
    Posts
    90
    OK, I'll give it a try during the weekend. Thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •