Operating System - HP-UX
1836872 Members
2480 Online
110110 Solutions
New Discussion

Re: Increasing the size of /var

 
SOLVED
Go to solution
Chris Fadrowski
Super Advisor

Increasing the size of /var

Trying to increase the size of my /var directory.. I don't have JFS online. Can this be done from single user mode? When i try to unmount it i get the message BLOCK DEVICE REQUIRED . What is the best way to expand the size of this directory?

If i can't do it here i can always do it thru a make_tape_recovery reload.
10 REPLIES 10
Marco Santerre
Honored Contributor

Re: Increasing the size of /var

Yes Chris,

You can increase it in single-user mode. If you've already increase your logical volume, and once you booted in single-user mode, just do an extendfs of the logical volume of your /var file system.
Cooperation is doing with a smile what you have to do anyhow.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Increasing the size of /var

It's going to be difficult to unmount /var because files in /var/tmp are almost certainly in use as well as others BUT you can easily do this if your bring the machine up in single-user mode by interrupting the boot process and doing an hpux -is. All the commands you need are in /sbin so that no other filesystems need be mounted.
If it ain't broke, I can fix that.
Sanjay_6
Honored Contributor

Re: Increasing the size of /var

Hi Chris,

Boot the system into single user mode and then change the size of var using lvextend and extendfs. to boot the system in single user mode, interrupt the boot process and boot thru pri, interact with ipl and boot into single user mode, hpux -is.

Hope this helps.

Regds
RAC_1
Honored Contributor

Re: Increasing the size of /var

You will have to reboot and enter the single user mode.(If you do not have Advanced Online JFS)

Once in single user mode, do lvextend on logical volume and then extendfs.

You can also create a seperate file system for directories under /var so as to avoid future problems.
There is no substitute to HARDWORK
Pete Randall
Outstanding Contributor

Re: Increasing the size of /var

Chris,

Another possibility if you've got room to spare is to create another lvol of the desired size and copy the contents of your current /var into it. The switch the mount points in /etc/fstab and reboot.


Pete

Pete
Geoff Wild
Honored Contributor

Re: Increasing the size of /var

I think you have to boot to Logical Volume Maintenance mode:

ISL> hpux -lm

# vgchange -a y /dev/vg00
# lvextend -L /dev/vg00/
# extendfs /dev/vg00/r

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Alzhy
Honored Contributor

Re: Increasing the size of /var

If you can afford longer downtime and can do a make_*_recovery - I suggest you repartition your entire bootdisk and follow the "minimalist" partitioning as follows (of course this will be applicable if you are using your bootdisks for just the OS and nothing else...):

Radical:
/stand -- 512MB
swap -- 4-8 GB
/ -- everything that remains...

What I have (on 36GB Bootdisks):
/stand - 512MB
/ - 8GB
swap - 8GB
/var - 8GB
/tmp - 4GB

There'll be /opt/??? and /var/??? mounts that you will need to have on separate Filesystems when the situation dictates but overall -- having a minimalist and sensible partitioning strategy future proofs you... I know there'll be folks that are totally against it that would rather have separate /, /usr, /usr/local, /opt, /whatever...
Hakuna Matata.
Chris Fadrowski
Super Advisor

Re: Increasing the size of /var

thanks for the replies, i would have thought it would be required to umount the /var dir before increasing the size. However i just did the lvextend and extendfs while it was mounted and it appeared to work.
Pete Randall
Outstanding Contributor

Re: Increasing the size of /var

Chris,

I'm surprised that worked. The man page for lvextend says quite firmly that you need to unmount. From the Examples section:



Increase the size of a file system existing on a logical volume.

First, increase the size of the logical volume.

lvextend -L 400 /dev/vg06/lvol3

Unmount the file system.

umount /dev/vg06/lvol3

Extend the file system to occupy the entire (larger) logical volume.

extendfs /dev/vg06/rlvol3

Remount the file system.

mount /dev/vg06/lvol3 /mnt



Pete

Pete
Chris Fadrowski
Super Advisor

Re: Increasing the size of /var

I am quite surprised myself, i have always had to umount before extending.

It appeared to umount it for me.