Editing
Msg06020.html
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
----- [<nowiki/>[[msg06019.html|Date Prev]]][<nowiki/>[[msg06021.html|Date Next]]][<nowiki/>[[msg06021.html|Thread Prev]]][<nowiki/>[[msg06024.html|Thread Next]]][<nowiki/>[[index.html#06020|Date Index]]][<nowiki/>[[threads.html#06020|Thread Index]]] <span id="re-vserver-context-quota-dissapears-after-reboot"></span> = Re: [Vserver] context quota dissapears after reboot = ----- * '''From:''' Matt Ayres * '''Date:''' Sun, 1 Feb 2004 20:47:15 +0100 (CET) ----- <pre>Here is a script I wrote to sync what's in the quota hash to disk. I also have a another script which is run at boot which reads in the .dlim files, sets the limits, and calculates the initial usage if a .dlim file doesn't exist yet. It is highly tied into our database system and wouldn't be of much use to anyone else though. Yes, this isn't the cleanest code, but it has worked bug-free for months on my production servers. The script is located at http://www.tektonic.net/public/sync_dlim. On Sun, 2004-02-01 at 14:29, Herbert Poetzl wrote: > On Sun, Feb 01, 2004 at 02:11:44PM -0500, Gregory (Grisha) Trubetskoy wrote: > > > > Let's see... > > > > * RedHat 7.3 > > * Kernel 2.4.24 with > > patch-2.4.24-vs1.24.diff > > patch-2.4.24-vs1.24-q0.12.diff > > * Kernel has quota support enabled, VFS v0 quota format disabled > > > > * /vserver partition mounted with tagctx: > > /dev/hda2 on /vservers type ext3 (rw,tagctx) > > > > * Create a server using newvserver, set its context id to 5 > > > > * Using cq-tools-0.06: > > # ./cqhadd -x 5 -v /dev/hda2 > > adding quota hash for /dev/hda2 ... succeeded. > > > > # ./cqdlim -x 5 -S 0,1000,0,5000,10 -v /dev/hda2 > > inodes: 0/1000 > > blocks: 0/5000 (10%) > > > > * Start the vserver: > > # vserver test5 start > > [...] > > > > * # vserver test5 enter > > ipv4root is now 192.168.1.155 > > New security context is 5 > > > > [root@vserver:test5 /] df -k > > Filesystem 1k-blocks Used Available Use% Mounted on > > /dev/hdv1 5000 20 4476 1% / > > > > [root@vserver:test5 /] dd if=/dev/zero of=blah bs=1024 count=1000 > > 1000+0 records in > > 1000+0 records out > > > > [root@vserver:test5 /]df -k > > Filesystem 1k-blocks Used Available Use% Mounted on > > /dev/hdv1 5000 1028 3468 23% / > > > > So far so good :-) > > > > * Now *REBOOT*, then after reboot: > > ahh okay, I really should know by now, but I always fall > for it ... folks always use the term 'context quota', when > they in fact mean 'context disk limits' ... > > okay, for context quota (means that stuff, which is done > with quotacheck, quotaon, quotaoff and friends) that is > persistent, because it is stored inside the quota files > (it might be encessary to update that on vserver start) > > the context disk limits are only valid as long as the > quota hash exists, which obviously doesn't sustain a > reboot ;) > > simple solutions: > > a) on every vserver start, scan the directory for file > sizes and inodes, with du -skx and find, and update > the 'current' values and set the 'limit' to some > default ... > > b) on server shutdown, store the current and limit values > in some file (preferable /var/run/vservers/<name>.limit > and use that values on startup. the vserver tools > might implement something like this in the near future ... > > don't forget to add the quota hash on vserver start and > remove it again on vserver stop, after all quota/limits > have been stored ... > > HTH, > Herbert > > > # vserver test5 start > > Starting the virtual server test5 > > [...] > > > > # vserver test5 enter > > ipv4root is now 192.168.1.155 > > New security context is 5 > > > > [root@vserver:test5 /]df -k > > Filesystem 1k-blocks Used Available Use% Mounted on > > /dev/hdv1 10078852 371424 9195440 4% / > > > > > > Thanks for all your help, Herbert, I really appreciate it. > > > > Grisha > > > > > > On Sat, 31 Jan 2004, Herbert Poetzl wrote: > > > > > On Sat, Jan 31, 2004 at 08:36:54AM -0500, Gregory (Grisha) Trubetskoy wrote: > > > > > > > > If I follow the intructions on this page > > > > > > > > http://vserver.13thfloor.at/Linux2.6/index.php?page=Per+Context+Disk+Limits > > > > > > > > ...it works great, but after I reboot, the quota disappears - doesn't seem > > > > right, I'm probably missing something. Any advice on how to make quota > > > > persist throughout reboots would be highly appreciated! > > > > > > hmm, that should not happen (whatever might happen), > > > > > > maybe you could give me a chance, and provide some > > > details about your setup, and what exactly happens ;) > > > > > > TIA, > > > Herbert > > > > > > > Grisha > > > > > > > > > > > > _______________________________________________ > > > > Vserver mailing list > > > > Vserver@xxxxxxxxxxxxxxxxxxxxxx > > > > http://list.linux-vserver.org/mailman/listinfo/vserver > > > > _______________________________________________ > Vserver mailing list > Vserver@xxxxxxxxxxxxxxxxxxxxxx > http://list.linux-vserver.org/mailman/listinfo/vserver -- Matt Ayres <matta@xxxxxxxxxxxx> TekTonic </pre> ----- * '''References''': ** '''[[msg06011.html|[Vserver] context quota dissapears after reboot]]''' *** ''From:'' Gregory (Grisha) Trubetskoy ** '''[[msg06015.html|Re: [Vserver] context quota dissapears after reboot]]''' *** ''From:'' Herbert Poetzl ** '''[[msg06017.html|Re: [Vserver] context quota dissapears after reboot]]''' *** ''From:'' Gregory (Grisha) Trubetskoy ** '''[[msg06018.html|Re: [Vserver] context quota dissapears after reboot]]''' *** ''From:'' Herbert Poetzl * Prev by Date: '''[[msg06019.html|Re: [Vserver] context quota dissapears after reboot]]''' * Next by Date: '''[[msg06021.html|Re: [Vserver] context quota dissapears after reboot]]''' * Previous by thread: '''[[msg06021.html|Re: [Vserver] context quota dissapears after reboot]]''' * Next by thread: '''[[msg06024.html|[Vserver] sometimes vserver do not ping]]''' * Index(es): ** [[index.html#06020|'''Date''']] ** [[threads.html#06020|'''Thread''']]
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information