Operating System - HP-UX
1833313 Members
2834 Online
110051 Solutions
New Discussion

/ not showing recent disk availability

 
SOLVED
Go to solution
TWBSupport
Regular Advisor

/ not showing recent disk availability

I have deleted several large files from my /home and /tmp directory that computes to about 400mb. When I run a bdf after I have deleted the files root still shows the same usage and mb available as before I deleted the files, although /home and /tmp show the decrease. What am I missing here?

HPUX
B.11.11 U 9000/800

Thanks for any insight.
27 REPLIES 27
Patrick Wallek
Honored Contributor

Re: / not showing recent disk availability

Ummm....If you deleted files from /home and /tmp, why would you expect / to decrease?

/ is a filesystem separate from /tmp and /home. /tmp and /home are mounted on /. The space available in / has nothing to do with the space available in /tmp and /home.

Did you also delete files from /, or one of the directories under / (one that is NOT a separate mount point)? If not, then the usage of / will not change.
Ivan Ferreira
Honored Contributor

Re: / not showing recent disk availability

Space is per file system, when you run bdf you will see the file systems available in your system.

If you delete a file in a directory, and the directory is listed in the bdf output, then you are freeing space in that file system, and other are not afected.

If you want to free space from /, you must delete files in any other directory that is not under any directory listed by bdf.

Probably, my english is not good enough to explain this.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
IT_2007
Honored Contributor

Re: / not showing recent disk availability

you might have deleted unknowingly some open files under /. use lsof or "ps -ef |grep -i defunct" processes then if you can kill their PPID of defunct'd processes other than with PPID of 1.

Bill Hassell
Honored Contributor

Re: / not showing recent disk availability

Disk space is not returned until the files are closed. You can remove the name of a file in a directory but unless the file is locked, the rm will succeed but the space will not be released until the programs close the files.


Bill Hassell, sysadmin
TWBSupport
Regular Advisor

Re: / not showing recent disk availability

I understand that however, why does everyone, hp included state to look for large files within /home, /var, /tmp, /stand when they have / fill up? Mine is not at that level, however, I'm confused on the connection then.
sysadm_1
Valued Contributor

Re: / not showing recent disk availability

In hp-ux default installation,
/ (root),/var and /tmp is seperate filesystems.
It is just mounted on /.
WHen you delete a file from /tmp or /var, it wont affect the size of / filesystem.

-sysadm
TWBSupport
Regular Advisor

Re: / not showing recent disk availability

wow - you guys are fast.. The previous response from me is for the answers of /, /tmp, /home, /var, etc.. are separate file systems therefore / would not show the increase.

I'll check to see if any of the files were open and go from there, but I really would like an explaination of why HP and others state to look for large files in the above file systems if / (root) is filling up. Thanks to you all for your quick responses.
Patrick Wallek
Honored Contributor

Re: / not showing recent disk availability

Where are you hearing this from HP? If someone is telling you to look in those directories when '/' fills up then they are wrong.

If / when you see '/' fill up, you should first do a 'du -kx / | sort -n' to see what the largest items in '/' (NOT counting the mountpoints are).

The usual culprits for '/' filling up is an incorrect tape device file, ie. someone used om rather than 0m (that is a lowercase o instead of a zero).

If / fills up, there is absolutely no reason to look anywhere else (/home, /tmp, /var, etc. if they are separate mountpoints).
Bill Hassell
Honored Contributor

Re: / not showing recent disk availability

> I understand that however, why does everyone, hp included state to look for large files within /home, /var, /tmp, /stand when they have / fill up? Mine is not at that level, however, I'm confused on the connection then.

Bill's rule #1 for full filesystems:

NEVER LOOK FOR BIG FILES.

(hopefully that got everyone's attention). First, a big file is *NOT* necessarily an extra file that should be removed. I personally took a call from an admin where his manager 'cleaned up' the large files and destroyed the system. The large files? vmunix and vmunix.prev

You manage disk space by percentage full and as a specific filesystem approaches 85-90%, you then look fof big DIRECTORIES, not big files. You do this by running the du command as in:

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

That shows you the largest directories in /. Do the same for /var and /tmp if they are getting full. Now that you've found large directories, look inside the directory. There may be 1000 files that are just 1 meg each...no large files but 1 Gb of space has been used, probably a big mistake. To sort the files within a directory by size, use:

ll | sort -rnk5 | head -20

Now as mentioned above, / is a separate filesystem. It is not affected by any other filesystem. In the / directory, you should see something like this:

75240 /
32728 /etc
32344 /sbin
14536 /etc/opt
13216 /etc/vx

As you can see, / is using 75 megs, but the two largest directories in / are /etc and /sbin, each using about 32 megs. This is normal, so if you see any other large directory in /, then there is a mistake. NOTE: always check / for files -- there should be none because all good sysadmins move root's HOME out of /. Check for a core file in / (also a sign of problem scripts or root's home is still in /)


Bill Hassell, sysadmin
TWBSupport
Regular Advisor

Re: / not showing recent disk availability

Patrick Wallek
Honored Contributor

Re: / not showing recent disk availability

You may be taking things out of context. In your first link, it talks about file systems filling up in general, with some specific sections on what to do when certain file systems fill up. The things they talk about are not intended as specific instructions for the / filesystem, but just things in general.

I really don't see anything in the 2nd and 3rd links that talks about much other than /. I just skimmed them, but most of the info looked to be related to / only.
TWBSupport
Regular Advisor

Re: / not showing recent disk availability

No core file, and no backup screw ups (rmt) I checked those right away. It just may be time to purchase online JFS and extend root in the next coming months. Like I said not an emergency, I was just house cleaning and noticed that, thought I could nip something quicker and without spending $$. Thanks to all of you
Patrick Wallek
Honored Contributor

Re: / not showing recent disk availability

I must stop you right here.

While onlineJFS / AdvancedJFS is a must have (all my systems have it), it will do you absolute NO GOOD whatsoever if you attempt to extend '/'.

The reason is that '/', PRI SWAP and '/stand' MUST all be contiguous. Attempting to extend '/' will fail.

The only real supported way to extend '/' is via Ignite/UX. You create a make_tape_recovery tape, or make_net_recovery image on an Ignite server, boot your machine from that backup and then increase the amount of space assigned to '/' and '/stand' if needed.
Bill Hassell
Honored Contributor

Re: / not showing recent disk availability

And to amplify Patrick's comment: there is NO reason to extend / unless it is only 75 to 100 megs. The largest server with thousands of users, dozens of Gb of RAM and dozens of processors needs about 150 to 200 megs for /. Anything more means the sysadmin is dumping (or allowing dumoing) of junk files in /. / is static and won't change very much if properly managed. Expanding / requires a reinstallation of HP-UX, either by Ignite/UX or from scratch.


Bill Hassell, sysadmin
TWBSupport
Regular Advisor

Re: / not showing recent disk availability

Again, I thought I read somewhere that Online JFS would allow me to extend root as long as I moved the next filesystem to a different disk to allow root to be contiguous. I really haven't read much up on this since as I said before, it's not an emergency and have been getting bugged by my developer on why root is at 90%. It has increased a whole 3% in the last 5 years, but I'm being told that 'Oracle' states it must be under 90%. Now, I think that is bull and I too see no reason on why 90% is a reason for an alarm, since / is clean, no huge files (sorry, Bill, that is always the first thing I look for, but I will change my ways from here). But I started thinking maybe she has something here and I need to investigate a tad more. That is where this journey has started. I knew I would get good answers here, that's why I posted since how I was interpreting things was not correct.
Patrick Wallek
Honored Contributor

Re: / not showing recent disk availability

Well, yes you could extend the / filesystem IF you move the next LV on the disk after / to another location. You should then have enough free contiguous extents to enlarge /.

However, what will you do with the other lvol? Do you have enough free extents on the disk to move it back onto its original disk?

Just something to check before getting too far down the road of extending /.

I see no reason why Oracle would care how large / is. It is irrelevent to Oracle. As long as it isn't growing and isn't causing problems, I would worry too much.
TWBSupport
Regular Advisor

Re: / not showing recent disk availability

Thanks for the info Patrick. Can you point me to a document that I can read about what exactly affects root space? I'm not writing anything to root, as I said before, it's clean, no core, but it does increase a small amount per year. I would like to know exactly what is increasing root.

This system is a 24/7 system, since our business is 24/7 and 3 remote plants feed off this same server, so it hasn't been bounced in over a year, could that be an issue?
Bill Hassell
Honored Contributor

Re: / not showing recent disk availability

RE: analyzing the root filesystem

Post the results of:

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

Also make sure you've moved the superuser root's home directory to something like /root and all the junk files in / to that directory. NOTE: you need to identify all the files in / as to their purpose. Occasionally, unknowledgeable sysadmins will put critical scripts in / and refer to them in cron and other locations. Cleanup of the / directory, especially when there is no change control process, can be interesting. Also check /dev for rogue files:

find /dev -type f

(there should be nothing returned from this command).


Bill Hassell, sysadmin
TWBSupport
Regular Advisor

Re: / not showing recent disk availability

ProdServ # du -kx / | sort -rn | head -20
118040 /
79760 /etc
43552 /etc/opt
37488 /sbin
32224 /etc/opt/OV
32216 /etc/opt/OV/share
24568 /etc/vx
20208 /etc/vx/type
15168 /etc/opt/OV/share/bitmaps/C
15168 /etc/opt/OV/share/bitmaps
10240 /etc/opt/OV/share/conf
7936 /etc/vx/type/static
6008 /etc/opt/resmon
5904 /sbin/fs
5624 /etc/vx/type/gen
5328 /etc/lvmconf
5120 /etc/vx/type/raid5
4184 /etc/opt/OV/share/conf/analysis
3784 /etc/opt/OV/share/backgrounds
3568 /etc/opt/resmon/lbin
ProdServ # find /dev -type f
ProdServ #

Nothing as you can see above comes back within /dev and there are no script's in or writing to root. I cat /dev/null a couple old log files from resmon but can't find much more that I'm sure can be removed or cat /dev/nulled .

Thanks for your patience.
Patrick Wallek
Honored Contributor
Solution

Re: / not showing recent disk availability

The /etc/directory looks a bit large to me, especially /etc/opt.

On most of the machines I've checked /etc/opt is less than 10 MB.
TWBSupport
Regular Advisor

Re: / not showing recent disk availability

Thanks. I'll look a little closer and see what else I can find other than just log files. Thanks again.
TWBSupport
Regular Advisor

Re: / not showing recent disk availability

I removed Samba from the server since none of the developers used it a while ago. There is a samba directory that still resides in /etc/opt/ that takes up about 300Mb. Any harm in me deleting the /etc/opt/samba directory?
Patrick Wallek
Honored Contributor

Re: / not showing recent disk availability

If you don't have CIFS / Samba loaded then you should be able to remove that directory. I would be interested in seeing what in /etc/opt/samba is taking up 300MB though.

I checked a couple of my servers and /etc/opt/samba is less than 4MB on those machines.
TWBSupport
Regular Advisor

Re: / not showing recent disk availability

Thanks. The files are in the codepages directory within samba. About 25 unicode_map files at 13 Mb@.