1835396 Members
2642 Online
110078 Solutions
New Discussion

Re: extendfs vs fsadm

 
SOLVED
Go to solution
L. Younes
Occasional Advisor

extendfs vs fsadm

Hi, on a hp-ux 11.00 system
I wanted to extend the /tmp filesystem which is /dev/vg00/lvol4, so I did lvextend -L xxx /dev/vg00/lvol4
(I had a lot of free space on vg00)
then I got confused between using two options:
1- fsadm -F vxfs -b xxxxxxx /tmp
2- umount /dev/vg00/lvol4
extendfs /dev/vg00/rlvol4
mount /dev/vg00/lvol4/tmp

the first option gave me the error :
vxfs fsadm: cannot open /tmp/lost+found/.fsadm

the second option didn't let me do umount, stating that /tmp is busy which is normal (three processes displayed with fuser -u /tmp)

so I created lost+found under /tmp and did touch .fsadm, and the first option worked.
The question is; did I extend the filesystem ??, because bdf shows the new size for /tmp, but I'm not sure, I still have doubts;
Does fsadm and extendfs do the same thing ?, or they should both be used simultanously ?
Another question is I tried to do fuser -ku /tmp, it executed well, fuser -u /tmp didn't display anything, yet I still had the error : device busy with umount.
Should I boot into single user mode ? to be able to use extendfs on /tmp.
is there a way to see what is causing the device busy message ? may be a process lock or something.
And finally, for a given process how can I see it's opened files list ?

Thank You for reading !
12 REPLIES 12
Armin Feller
Honored Contributor

Re: extendfs vs fsadm

Hi,

if 'bdf' shows the filesystem with the new size it should be ok, please check also with 'du'.

I know this problem and to touch the /tmp/lost+found/.fsad file was the right thing.

There are a lot of processes and systmcalls with keep /tmp open, if 'fuser' didn't show any you should try 'lsof'.

http://hpux.asknet.de/hppd/hpux/Sysadmin/lsof-4.64/

Regards,
Armin

Ravi_8
Honored Contributor

Re: extendfs vs fsadm

Hi,

unless you have online JFS installed you can't increase the file system size in mutiuser mode,
You need to be in single user mode.

fsadm is for file system administartion, extendfs is for extending the file system size.
In your first option you have told the system to convert /tmp to file system of type vxfs(which by default is vxfs), even though bdf shows new size, you can't use the extended space untill you use extendfs.
you should be in single user mode to use extendfs since you are specifying raw device
(extendfs -F vxfs /dev/vg00/rlvol4).

you can opened files using lsof
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.55/
never give up
Ravi_8
Honored Contributor

Re: extendfs vs fsadm

Hi,

unless you have online JFS installed you can't increase the file system size in mutiuser mode,
You need to be in single user mode.

fsadm is for file system administartion, extendfs is for extending the file system size.
In your first option you have told the system to convert /tmp to file system of type vxfs(which by default is vxfs), even though bdf shows new size, you can't use the extended space untill you use extendfs.
you should be in single user mode to use extendfs since you are specifying raw device
(extendfs -F vxfs /dev/vg00/rlvol4).

you can find opened files using lsof
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.55/
never give up
Jean-Louis Phelix
Honored Contributor
Solution

Re: extendfs vs fsadm

hi,

extendfs is use to extend an unmounted filesystem only (arg is a lvol), while fsadm extents a mounted filesystem (arg is a mountpoint). It works on mounted filesystems if you have OnlineJFS which seems to be the case. If bdf tells it's OK, then trust it ...

Concerning your lost+found directory, using mkdir is not the correct way to do it. You should have used 'mklost+found' command and you can read in the manpage that it's more than mkdir :

The mklost+found command creates a directory named lost+found in the current directory. It also creates several empty files which are then removed to provide empty slots for the fsck command (see fsck(1M)).

Also, trying to umount a /tmp on a running system is not really a good idea because of all existing system processes which could use it. After fuser -ku /tmp, I would perhaps have a sanity reboot if I could :^) ...

Regards.
It works for me (© Bill McNAMARA ...)
Chuck J
Valued Contributor

Re: extendfs vs fsadm

If you have OnlineJFS then you can use:
# lvextend -L /dev/vg00/lvolxx
then
# fsadm -F vxfs -b m /tmp

If you do not then you will have to boot into single user mode because /tmp is a required file system in multi-user mode and you cannot unmount it. fsadm can only be used on mounted file systems. So if you don't have onlineJFS then boot into single user mode then:
# lvextend -L /dev/vg00/lvolxx
then
# extendfs /dev/vg00/rlvolxx
# init 3

regards...
L. Younes
Occasional Advisor

Re: extendfs vs fsadm

Armin: Thank You for your feedback

Ravi: I did
swlist | grep -i jfs
B3929BA B.11.00 HP OnLineJFS (Advanced VxFS)

So I have Online JFS, and I already read in another thread that fsadm is sufficient when OJFS is installed, so I do not need to reboot into single user and do extendfs, do I ?

Jean-Louis: Thanks for the mklost+found, very useful information.

Jean-Louis And Armin: Regarding the /tmp, well the machine isn't in production so I took the liberty to try and do twisted :) stuff" I wouldn't do fuser -ku in a normal situation. The machine is already rebooted.

Thank You for your Help
L. Younes
Occasional Advisor

Re: extendfs vs fsadm

Thanks Chuck;
I can see clearly now
Chuck J
Valued Contributor

Re: extendfs vs fsadm

No Probs!

rgs Chuck J
Bill Hassell
Honored Contributor

Re: extendfs vs fsadm

Both methods will work in your case. fsadm works because you have Online JFS installed, an optional product that allows extending an active filesystem. As you've seen, extendfs requires an unmounted filesystem. bdf definitely indicates the current size (in an easy to read format). du -ks /tmp will show the occupied space in kbytes.

NOTE: Check every mounted filesystem for the lost+found directory. It must be present and empty. If not present, fsck will unable to salvage broken links between directories and inodes, and if lost+found contains anything (ie, files starting with #) then these are 'lost' inodes from a some previous improper shutdown. These might be temp files but they also might be important files or directories that have been missing for some time. Identifying what they used to be (to rename them back to their original name) will require some sleuthing using the 'file' command and looking at the contents. Remember that the # character means something to the shell so always escape it with \#

fuser works less than 50% of the time in identifying open files on a filesystem (ie, the reason that you can't umount /tmp). You can help fuser just a bit by rerunning it against the lvol rather than the mountpoint. It will still fail occasionally. For instance, if someone cd's into a mountpoint, fuser has trouble seeing the open file (actually the directory is open).

The solution is to download the best program in the Unix world for this task: lsof. Get a copy for HP-UX from http://hpux.connect.org.uk/

lsof shows all open files including network sockets. As far as looking at a given process for all it's open files, there is nothing in HP-UX that can do this. You'll need to load Glance/PLus from your application CDROMs. It will load as a trial version so you can use it for a couple of months. Glance is the best performance monitoring tool for HP-UX.


Bill Hassell, sysadmin
Dietmar Konermann
Honored Contributor

Re: extendfs vs fsadm

Just a short notice about fuser.

The "fuser /tmp" command only finds processes that have the directory /tmp open...

If you want to find processes that use resources of the file system then you need to use "fuser -c /tmp" or "fuser /dev/vgxx/lvoly" (which in fact is the same)... and even these are not designed to find all types of resources.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Chuck J
Valued Contributor

Re: extendfs vs fsadm

By the way, if you do have onlineJFS you can easily also extend it via sam if you don't want to mess around with the command line:

sam
disks & file systems
logical volumes

Chuck J
L. Younes
Occasional Advisor

Re: extendfs vs fsadm

Chuck:
I did exactly that, so
it extended the lvol, but that's when in the Sam Log window it displayed the fsadm error, then I switched to command line