LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-09-2014, 06:05 AM   #1
javier_ns
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Rep: Reputation: Disabled
Question Can I change the disk quota of the root user..?


Hi, I'm running a CentOS dedicated server, with a 100Gb HD, in which I installed apache, postgesql and php, and I started running a little app from there, but the app suddenly stop working... so, I give a look at the log, an it said that the hard drive is full, but when I checked, there still had 90Gb free, so I think that I made the huge mistake of installing everything as the root user, and I used all the disk quota, so now I'm short on space, but I have a 90% of the HD free... :/
So I checked that quota was installed, and tried to edit my user qouta:

Code:
rpm -q quota
quota-3.17-20.el6.x86_64
Code:
quota -u root 
edquota root
repquota -a
but nothing happened, no info, no message, nothing..

then I seeked in the centos manual, and it said that run

Code:
repquota /home
but still not showing me any info...


then I edited the etc/fstab, and i got this...

Code:
/dev/md1       /	ext4	errors=remount-ro	0	1
/dev/md2	/home	ext4	defaults	0	2
/dev/sda3	none	swap	defaults	0	0
/dev/sdb3	none	swap	defaults	0	0
proc		/proc	proc	defaults		0	0
sysfs		/sys	sysfs	defaults		0	0
tmpfs		/dev/shm	tmpfs	defaults	0	0
devpts		/dev/pts	devpts	defaults	0	0
so there are no any quota created so far, but I'm still running out of space, and I have no idea what to do...

-If I Add the usrquota root to the fstab, and remount the system, it may work..? am I gonna lose everything I got in the HD so far..?
-Is any other way in which I can increase my root user quota..?
-There is any way to do this without erasing all the data and installing everything again as a new user..? Because I already got some users running the app and I can't just stop the server to reinstall everything again..


Thanks a lot for your help..
 
Old 03-09-2014, 07:29 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Quote:
Originally Posted by javier_ns View Post
Hi, I'm running a CentOS dedicated server, with a 100Gb HD, in which I installed apache, postgesql and php, and
Root is the pivotal account "ruling" the system. It's not for use by human users but for system configuration and maintenance. If you would like to know more (and you should, as new Linux user) please read your distributions starter and basic server documentation. You run a server but by the looks of your /etc/fstab you partitioned it like a new users desktop with only "/" and "/home". Partitioning it "the old school way" with at least a separate "/", "/home" and "/var" (or using LVM if you find that usable) will allow your server to continue to function if for example users clog up /home.


Quote:
Originally Posted by javier_ns View Post
I started running a little app from there, but the app suddenly stop working... so, I give a look at the log, an it said that the hard drive is full, but when I checked, there still had 90Gb free,
Then first show us output of
Code:
df -mh
du -mhs /*
and if one directory seems to hold gigabytes of data give us a 'du' of that directory. For example "/var":
Code:
du -mhs /var/*
 
Old 03-09-2014, 05:39 PM   #3
javier_ns
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Hi, thanks a lot for you reply..
this is the info of df -mh:

Code:
Filesystem      Size  Used Avail Use% Mounted on
rootfs          9.8G  7.3G  2.1G  79% /
/dev/root       9.8G  7.3G  2.1G  79% /
devtmpfs         16G  420K   16G   1% /dev
/dev/md2        100G  351M   95G   1% /home
tmpfs            16G  308K   16G   1% /dev/shm
/dev/root       9.8G  7.3G  2.1G  79% /var/named/chroot/etc/named
/dev/root       9.8G  7.3G  2.1G  79% /var/named/chroot/var/named
/dev/root       9.8G  7.3G  2.1G  79% /var/named/chroot/etc/named.conf
/dev/root       9.8G  7.3G  2.1G  79% /var/named/chroot/etc/named.rfc1912.zones
/dev/root       9.8G  7.3G  2.1G  79% /var/named/chroot/etc/rndc.key
/dev/root       9.8G  7.3G  2.1G  79% /var/named/chroot/usr/lib64/bind
/dev/root       9.8G  7.3G  2.1G  79% /var/named/chroot/etc/named.iscdlv.key
/dev/root       9.8G  7.3G  2.1G  79% /var/named/chroot/etc/named.root.key
and du -mhs /*

Code:
 
7.4M	/bin
73M	/boot
4.0K	/cgroup
728K	/dev
47M	/etc
291M	/home
132M	/jdk-7u45-linux-x64.tar.gz?AuthParam=1386479300_7b74957d4b9ddf3cfd41f9905d024e3f
328M	/lib
26M	/lib64
16K	/lost+found
4.0K	/media
4.0K	/mnt
4.0K	/opt
0	/proc
21M	/root
20M	/sbin
4.0K	/selinux
4.0K	/srv
0	/sys
76K	/tmp
1.7G	/usr
4.9G	/var
and actually, yes, var is the one with more data, so here is du -mhs /var/*

Code:
4.0K	/var/account
99M	/var/cache
4.0K	/var/cvs
8.0K	/var/db
8.0K	/var/empty
4.0K	/var/games
4.0K	/var/gdm
979M	/var/lib
4.0K	/var/local
12K	/var/lock
288M	/var/log
0	/var/mail
180K	/var/named
4.0K	/var/nis
4.0K	/var/opt
4.0K	/var/preserve
196K	/var/run
192K	/var/spool
4.0K	/var/tmp
4.3M	/var/webmin
3.6G	/var/www
4.0K	/var/yp
in www it's were I have the app, some test folders and a couple of backups, thats why its taking up all that space.
I'm going to move to another server very soon (and of course I'm reading the server documentation, so this never happen again.. ) but in the meantime there is anyway to give root more space, without affecting the installed system..? or to move everything to another acount without having to reformat the disk..?

Thanks in advance for your answer..
 
Old 03-09-2014, 08:04 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
/dev/md2 has enough space for this purpose. What you need to do is stop all services (running 'lsof -Pwln -a +D/var' will show you what processes still write to /var), then create and copy /var ('mkdir -m 0755 /home/var; chown 0:0 /home/var; rsync -aAEXDS /var/ /home/var/; mv -f /var /home/var_old; ln -sf /home/var /var'), then restart your services and check the logs ('tail -f /home/var/log/secure /home/var/log/messages /home/var/log/audit/audit.log') for errors. If all went well you should reboot the server to see if it actually works (might want to disable SELinux while rebooting, enable when all seems OK). If it doesn't work then you may have trouble accessing your server so before proceding first ensure you have backups and an Out Of Band way in via iLO, IPMI, terminal server, VMWare console or whatever else you use, you get the idea.
 
Old 03-09-2014, 10:04 PM   #5
javier_ns
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Wow, thanks a lot for such a quick answer, but the server is in gigapros, I have no way to access it out of band, and I can't afford the risk of going offline for a long time..
So I'm afraid I'm going to try to delete as much as I can, while I move to the other server and Start from scratch in the correct way..
But it's great to know that in Linux there is always a way of doing things..!!
Thanks for all your help, I learned a lot..!!
 
Old 03-09-2014, 11:44 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
I suspect (from the 90GB) you actually are referring to the default reserve space for root (it is 5% by default according to the "man tune2fs" documentation).

Normally, there are little to no quotas actually assigned to the root filesystem - nearly everything there is owned by root, or a designated system service account.

When a filesystem is initialized (ext2/3/4) there is a default reserve space alloted to root. This prevents non-root users from causing a denial of service by using up all the disk space. The amount of the reserve CAN be altered (tune2fs -m <reserve percent> <partition to be modified>)
 
1 members found this post helpful.
Old 03-10-2014, 09:00 AM   #7
javier_ns
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks jpollard, very nice tip.. but I can do that without altering the actual filesystem, or I need to backup and then mount everything again..?

Thanks in advance..
 
Old 03-10-2014, 09:16 AM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
For this, you can do it nearly anytime you want. It doesn't affect the filesystem data at all, only the superblock reserve amount. What I don't remember is if the effect takes place immediately, or if it requires the system to remount first.

Backup isn't required. Nice to have in any case, but for this purpose it isn't required.
 
Old 03-10-2014, 09:35 AM   #9
javier_ns
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Awesome, I'll give it a try..!! Thx a lot jpollard..!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to assign disk quota(disk space limited) to user and group. hocheetiong Linux - Newbie 1 08-24-2007 05:20 AM
how do i set a user disk quota axis Linux - Security 5 09-01-2003 11:33 PM
Limit Disk Quota per user ? mikeshn Linux - General 1 06-19-2003 07:33 PM
disk quota root partition fosky Linux - Newbie 0 06-23-2002 05:49 PM
Disk Quota for user and group ??? sultan Linux - General 0 05-13-2002 07:37 AM


All times are GMT -5. The time now is 12:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration