Operating System - HP-UX
1830453 Members
2242 Online
110004 Solutions
New Discussion

Re: how to extendfs'ing /var (or /usr etc..)

 
SOLVED
Go to solution
Mark Henry_1
Frequent Advisor

how to extendfs'ing /var (or /usr etc..)

Hi All,

How does one extend a filesystem such as /var or /usr - i.e. one that is an 'important' to the system? (is there a better term for these?)

Single user mode is slapping me in the face but to possibly avoid having to shutting down...

Thx,

Mark
8 REPLIES 8
Animesh Chakraborty
Honored Contributor

Re: how to extendfs'ing /var (or /usr etc..)

Hi,
How about moving/deleting some files of /var ?

http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x3feac6af36b7d5118ff10090279cd0f9,00.html

Another solution is online JFS.

Regards
Animesh
Did you take a backup?
Roger Baptiste
Honored Contributor

Re: how to extendfs'ing /var (or /usr etc..)

Hi,

If you have advanced JFS installed on the
system, you can extend the FS on the fly.

Decide on the new Size(in MB) you want. Then do,
#lvextend -L /dev/vgxx/lvol

#blocks=newsize*1024

#fsadm -F vxfs -b

Now the filesystem is with the new size.
All done without unmounting it.

If you do not have JFS, then you would need
to boot in single user mode and
run lvextend & extendfs.

-raj
Take it easy.
Ravi_8
Honored Contributor

Re: how to extendfs'ing /var (or /usr etc..)

Hi,
/var and /usr are system related file systems, you can't increase/decrease their size without getting into single user mode(since they were under use all the time).

reboot the machine(#reboot) when the sysem ask to press amy key within 10 secs.press any key, which gives a prompt. If you know the boot device in which /usr and /var needs to be increased type
prompt> boot Px
interact with ISL? press Y. his gives you the ISL prompt
ISL> hpux -iS
takes you to single user mode
#mount -a
note the /dev/vgxx/lvolx for /usr /var
#umount /usr /var
#lvextend -L size(in MB) /dev/vgxx/lvolx
#exendfs -F vxfs /dev/vgxx/rlvolx
#mount /dev/vgxx/lvolx /usr or /var
(where vgxx is the respective vg for /usr or /var, lvolx for lv for /usr or /var. you need to repeat the procedure twice.once each for /usr and /var)
# init 3

never give up
Michael Tully
Honored Contributor

Re: how to extendfs'ing /var (or /usr etc..)

Hi Mark,

Unless you have on-line JFS product you find great
difficulty in doing without being in single
user mode. I have not seen one instance
where it has been done in multi-user as the
system depends so much on files being open.
You best bet is to boot the system into
single-user mode, 'lvextend' the logical volume
and run 'extendfs' on it. Extending '/' '/stand' or your primary swap 'lvol2' you will need to do
these from an ignite tape as these volumes must
be contiguous.

-Michael
Anyone for a Mutiny ?
David Allen
Frequent Advisor

Re: how to extendfs'ing /var (or /usr etc..)

Hi Mark,

As mentioned already, Online JFS is the product you need to be able to extend/reduce filesystems on the fly. Otherwise you are stuck with booting to single user mode to maintain these filesystems.

NOTE: You can extend a logical volume in multi-user mode, but you have to be in single user mode to extend the filesystem.

Regards,
Dave
Deshpande Prashant
Honored Contributor

Re: how to extendfs'ing /var (or /usr etc..)

Hi
Online JFS product will be really helpful for such on-fly extension of file systems (vxfs), except fot the /stand, which being hfs the way to extend is after booting machine at single user mode.

Thanks.
Prashant.
Take it as it comes.
David Allen
Frequent Advisor

Re: how to extendfs'ing /var (or /usr etc..)

Hi Mark,

I should clarify my previous comment regarding booting to single user mode. To extend a filesystem (extendfs), the filesystem needs to be unmounted (if you don't have Online JFS). So for a non-root filesystem you don't need to boot to single user mode, simply shutdown any processes that would be using that filesystem (can use fuser to check) and then unmount it to extend it. Obviously this is an interruption to your customers business needs so you would need to do this out of hours.

Filesystems, such as, /var, /usr, /tmp and /opt are typically in use by many root processes, so the safest way is to boot the server to single user mode. That way these filesystems are not mounted and therefore not in use, so can be extended safely.

Regards,
Dave
Bill Hassell
Honored Contributor
Solution

Re: how to extendfs'ing /var (or /usr etc..)

/usr and /var are both very difficult to un-mount as there are so many processes that depend on these volumes, including HP-UX. It's important to define single user mode, or more accurately, how to get there.

init s (nope, that only shuts down a few processes in the inittab table and anything owned by init that is not listed in inittab.

shutdown 0 (nope, although it used to work really well to bypass the machine's selftest. Now, it often leaves /var, /usr and even /opt mounted)

shutdown -r 0 (then interrupt the boot process as mentioned by others. This always works. Verify that /var and /usr are not mounted...note that bdf won't work since /usr should be mounted. Use just: mount to report the current munt points.


Bill Hassell, sysadmin