1753882 Members
7375 Online
108809 Solutions
New Discussion юеВ

Re: utmpx

 
SOLVED
Go to solution
Kenneth Woolard
Advisor

utmpx

I'm trying to free some space up in root FS and was wondering if ther would be any harm in issuing this command:-

cat /dev/null > /etc/utmpx

7 REPLIES 7
James R. Ferguson
Acclaimed Contributor
Solution

Re: utmpx

Hi Kenneth:

You don't want to truncate this file. It holds current login information for users currently logged on to your server.

That aside, it isn't going to return you much space.

Look for regular files (non-special ones) in '/dev' and look for core files.

A common error is a mis-typed device file name during a backup like : /dev/rmt/om which will appear as a regular file.

# du -xk / | sort -krn1,1

...will show where the most space is consumed in various root directories. This is useful for your analysis.

Regards!

...JRF...
Johnson Punniyalingam
Honored Contributor

Re: utmpx

Hi ,

The below commands will help to find some large file located under / root File system

find / -xdev -type f -size +5000000c -exec ll {} \; | sort -nk 5

or

cd /
du -sk * --> this list down the directories which also contains big files , so that you can narrow down, trim your / File system

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Kenneth Woolard
Advisor

Re: utmpx

Thanks for the replies so far. some very useful commands there.
My main problem is that the current size of root is only 100Mb - which aint to big.
Johnson Punniyalingam
Honored Contributor

Re: utmpx

would be prefer to "Extend / File system ..?
do you have enough space on your vg00.?

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Kenneth Woolard
Advisor

Re: utmpx

Unfortunately there is no allocation available for vg00.
Bill Hassell
Honored Contributor

Re: utmpx

100 MB for / is really a big problem. You are correct that it is not very much but the problem is much more serious. If / becomes full, a lot of things will break and root may not even be able to login. This will get worse and worse as you add disks and lvols because your /etc/lvmconf will continue to grow. Normal sizes for the two biggest directories (/etc and /sbin) are about 30 MB each. That leaves only 40 MB for everything else.

The first thing to do right now is to move root's $HOME -- immediately. The / directory is a legacy mistake that causes big problems for all Unix sysadmins. Move root's files and subdirectories to /home/root and change /etc/passwd to reflect the new location. Good sysadmin practices prohibit ordinary files in /, so find them all and move them to root's $HOME (or remove them). This will show all the misplaced files:

ll -d /* | grep -- ^-

The / directory is static, changing slightly as config files are created or extended in /etc, and additional disks and lvols are created (/etc/lvmconf). You can move the /etc/lvmconf files that end with ".old" every time you perform LVM maintenance.

To summarizr the largest directories (which will be /etc/ and /sbin), use the command:

du -kx / | sort -rn | head -20

Then look in each directory at the top of the list for unusual large files:

ll /etc | sort -rnk5 | head -20

You'll have a permanent job to do this every week or two, forever, until you create an Ignite tape backup (make 2 copies), then reinstall from the Ignite tape and resize / to about 200 to 400 MB.


Bill Hassell, sysadmin
Johnson Punniyalingam
Honored Contributor

Re: utmpx

in that case,

we need narrow down with helps of the commands which posted earlier, eye -ball any Application related files writing to / file system

how about your /var/adm/crash ..? does it resides under vg00 ..?


Thanks,
Johnson
Problems are common to all, but attitude makes the difference