Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Quota Workaround?
PostPosted: Sat Jun 18, 2005 1:40 pm 
Offline
Junior Member

Joined: Thu Jun 16, 2005 12:28 pm
Posts: 33
Having never had any experience with disk quotas (aside from being limited by'em), I didn't think much about how my disks needed to be structured when I set everything up. Since I use a Linode 64, I decided to allocate as much space as possible for root, and use the rest for the swap.

Well now I discover that in order to setup quotas, the program needs the ability to unmount the user partition to do its thing. I think that's a bit extreme for what I need, and I certainly don't wish to have to reformat my disks to set this up, considering I finally got all my software working correctly.

So I was wondering if this might could be used as a workaround: use loopback filesystems. For example,

dd if=/dev/zero of=/home/USER.img bs=1024 count=102400
mkfs.ext3 /home/USER.img
mount -o loop /home/USER.img /home/USER

Of course I'd probably allocate a little more space than what's promised to the user since part of that is eaten up from the formatting, and possibly store the image files elsewhere, but theoretically, I can't see a problem with this. Is there something I'm missing? It seems to be a perfect way to limit how much space a user is allowed to work in without going to all the trouble of setting up quotas.


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2005 4:56 am 
Offline
Senior Member

Joined: Fri Aug 06, 2004 5:49 pm
Posts: 158
You could just resize your root partition, and setup a new partition for /home all using the LPM. Then copy over /home to the new partition, edit fstab, reboot, and your good to go.


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2005 12:57 pm 
Offline
Junior Member

Joined: Thu Jun 16, 2005 12:28 pm
Posts: 33
Well now isn't that pretty awesome. I didn't realize I could resize'em like that once they were made. Perhaps I'll learn to look in all those options screens next time.

It's all resized now and running like a charm with the new /home. Now to figure out quotas.

And thanks!


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2005 1:32 pm 
Offline
Senior Newbie

Joined: Thu Jan 27, 2005 9:59 pm
Posts: 10
Just a word of warning, since people tend to use quotas when they are going to give people local access... Be careful who you give shells to, compromising a machine locally is much easier than remotely.

$.02
-tiz


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2005 6:14 pm 
Offline
Junior Member

Joined: Thu Jun 16, 2005 12:28 pm
Posts: 33
Yeah I don't think I would trust anyone with direct access to my machine. I just wanted quotas to move a couple of smaller sites I host for people all onto one machine (as long as it doesn't get bogged down) so that I wouldn't have to keep paying for standard web hosting elsewhere.


Top
   
 Post subject:
PostPosted: Fri Jun 24, 2005 11:06 am 
Offline
Senior Member
User avatar

Joined: Sat Oct 16, 2004 11:13 am
Posts: 176
For enabling quotas, you don't need to cretae or hcnage any partitions.

All you have to do is change the approproate settings at /etc/fstab, install appropriate binaries (apt-get install quota) and reboot - most distros during reboot check for quota-enabled partitions and enable them.


Top
   
 Post subject:
PostPosted: Fri Jun 24, 2005 12:46 pm 
Offline
Senior Member

Joined: Sat Dec 04, 2004 5:36 pm
Posts: 145
saman007uk wrote:
For enabling quotas, you don't need to cretae or hcnage any partitions.

All you have to do is change the approproate settings at /etc/fstab, install appropriate binaries (apt-get install quota) and reboot - most distros during reboot check for quota-enabled partitions and enable them.


Would this command work after doing the other stuff?
Code:
# mount -o rw,remount,usrquota /home

(adjust filesystem name as needed; also add grpquota if needed.)

Might save a reboot if it does the trick.


Top
   
 Post subject:
PostPosted: Fri Jun 24, 2005 1:18 pm 
Offline
Senior Member
User avatar

Joined: Sat Oct 16, 2004 11:13 am
Posts: 176
Yes, for non-root directories that shoudl work (but as always, you will need to enable quotas using the quotaon command).

However, for root file-systems I've found that that does not work unless you reboot.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group