1837112 Members
2361 Online
110112 Solutions
New Discussion

Re: root file system

 
tarek_3
Frequent Advisor

root file system

hi
is there any way to set quota on root file system ? for example the size of the root filesystem should not exceed 85%.
Regards
Hassoun
4 REPLIES 4
RAC_1
Honored Contributor

Re: root file system

While you can set quota on root file system, why it is required. / file system is static file system, and no body should be writing to it. I would also recommand to have seperate home for root (like /home/root or /root), but not /.

Also check if you have appropriate perms on /
I have rwx for root and rx for group and others.

Anil
There is no substitute to HARDWORK
Deoncia Grayson_1
Honored Contributor

Re: root file system

You might find this link of interest in setting up quotas:

http://docs.hp.com/en/B2355-90672/ch05s03.html

also, please note what RAC stated, / should not grow if var,opt,usr,tmp,home and stand are mounted seperately.
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Paul_481
Respected Contributor

Re: root file system

Hi Hassoun,

I suggest you create a buffer file with size around 15 % of your / filesystem. Then when / becomes 100%, you can immediately delete the buffer file so that your / will be less than 100% while you are cleaning up the / filesystem.

Regards,
Paul
Bill Hassell
Honored Contributor

Re: root file system

The / filesystem has a permission of 755 which allows no one but root to create files or directories there. So if this directory is growing, it is root's fault. / is a static directory.

Start by moving root's HOME directory to either /root (still part of / volume) or /home/root which is a separate filesystem. You can make this change with vipw and change root's home in the passwd file. Now move all files in / to root's HOME. During that process, remove any files that are not needed by root. This includes .profile, .exrc, etc

Now move any directories that root created that are known to be root's personal directoeries such as .elm or Mail. The purpose in these steps is to isolate root user stuff from the rest of the system. Normally, these files and directories are trivial in size.

Now find the largest directories in the / mountpoint by using this command:

du -kx / | sort -rn | head 20

The largest directories will be /etc, /sbin, /etc/vx and /etc/opt. If anything is larger that these directories, a big mistake has been made. Here are sample sizes for / directories:

# du -kx / | sort -rn | head -5
74848 /
34448 /etc
32616 /sbin
14736 /etc/vx
14624 /etc/opt

If /dev is significantly larger than 100, then a spelling error was made by a root user, most likely during a backup. Search /dev for any 'normal' files (there must be none):

find /dev -type f

Remove any files in /dev. This may decrease the usage of / by 50-90%.

Then look at any directory that is part of / and not: /etc /sbin /dev (possibly /root) and mounted filesystems (see bdf for a list of mounted filesystems). Whatever is left is likely to be a mistake. Some poorly written applications will create directories in / without permission from the root administrator. These can be moved to another volume and replaced with a symbolic link.

Another source of files in the wrong location are logfiles that are in /etc. Although this is a clear violation of the recommendations for logfiles (should be in /var/adm or possibly /var/opt/), there may be some growing logs. These can also be moved to an appropriate /var location and replaced with a symlink.


Bill Hassell, sysadmin