1832300 Members
1680 Online
110041 Solutions
New Discussion

/var Increasing Size

 
Jim Thrash
Occasional Contributor

/var Increasing Size

I need to increase the size of the /var filesystem (/dev/vg00/lvol8) from 1200 MB to 1300 MB. When trying to do this from LVM I get the message unable to umount /var because device is busy. How do I get the /var filesystem umounted safely so I can increase the size. Also, after the /var file system is mounted again will those processes that were preventing the file system from being umounted re-spawn themselves?
16 REPLIES 16
Helen French
Honored Contributor

Re: /var Increasing Size

I would boot the system in single-user mode (hpux -is from ISL prompt) and then do this job. Unmounting /var while system is online will be a risky and big task.

Once extended, check the file system with fsck commmand and mount it. Check whether everything is proper. Once all done, restart the system as normal mode.
Life is a promise, fulfill it!
A. Clay Stephenson
Acclaimed Contributor

Re: /var Increasing Size

Hi Jim:

This is the very reason you buy OnlineJFS. You could grow the LVOL and the filesystem 'on-the-fly'. Without it, the realistic answer is that you are going to have to drop to single-user.

The answer to your second question is that some of them will but almost certainly not all.
If it ain't broke, I can fix that.
S.K. Chan
Honored Contributor

Re: /var Increasing Size

Umounting /var would NOT be possible in a multi-user mode because a lot of active processes/daemons are dependent on /var and simply cannot be killed. The only way to do this is in single-user mode unless you have OnlineJFS which allow you to increase a filesystem size on-the-fly.
Martin Johnson
Honored Contributor

Re: /var Increasing Size

Without OnlineJFS, you need to halt the system and boot into single user mode. Then you can do the lvextend and extendfs.


HTH
Marty
MANOJ SRIVASTAVA
Honored Contributor

Re: /var Increasing Size

Hi Jim


There are acutally 3 ways to do it :

1. If online JFS is ther you can do it online.
2. GO to single user and then increase it .
3. Make a ignite recovery tape and reinstall it with more size of /var.


Manoj Srivastava
Dave Chamberlin
Trusted Contributor

Re: /var Increasing Size

If you do not have Online JFS - you will need to be in single user mode to extend the filesystem. If you go down from your current level, you will kill processes that will not restart. If you can reboot, boot to single user mode, extend the filesystem, then proceed to multiuser mode.
Arockia Jegan
Trusted Contributor

Re: /var Increasing Size

Do u have online JFS on your system? If you have online JFS on your system by using the following command you can increase the size of /var file system

#fsadm -F vxfs -b 1300M /var

If you don't have online JFS ,

Then you need to boot the system in to single user mode to increase the size of the /var file system. You can't unmount the /var file system in the multi user mode. Even if you use "fuser -ck /var " to kill the processes using /var file system it won't allow you to unmount the /var file system.
Rather it will just kill your login session.

So boot the system in single user mode
#lvextend -L 1300
# extendfs -F vxfs
Deshpande Prashant
Honored Contributor

Re: /var Increasing Size

Hi
If you do not have Online JFS, you will have to boot system with single user to increase size of /var.

Thanks.
Prashant.
Take it as it comes.
Steve Post
Trusted Contributor

Re: /var Increasing Size

You can't unmount /var because it's busy running stuff for UNIX. When you go to "single user mode" to fix it please note there are TWO "single user modes".

1. There is the single user mode where you run shutdown.
2. There is the single user mode where you remove power from the computer, then interupt the boot process, then boot it up into single user mode.

The first "single user mode" still uses /var.
The 2nd "single user mode" works.
Chris Fadrowski
Super Advisor

Re: /var Increasing Size

1. reboot
2. interupt the boot process
3. interact with ipl
4. hpux -is
(this will boot into single user)
then do your lvextend -L 100 etc...etc...
Bill Hassell
Honored Contributor

Re: /var Increasing Size

Just a note about /var: 1200 to 1300 megs? Hardly seems werth the effort. /var is *THE* most widely variable (hint: /var = variable) filesystem in HP-UX and it constantly needs to be cleaned.

/var/tmp will have junk files from apps and users, /var/adm has logfiles that grow forever, /var/adm/sw will have patch and application files, /var/spool has print jobs that never completed and /var/mail can have hundreds of megs of junk mail.

Regularly analyze /var and have cron handle logfile trimming. To analyze the space, use:

du -kx /var | sort -rn > /tmp/du.var

Look in /tmp/du.var to see where the lrgest directories are located, then use:

ll | sort -rnk5 | more

to show the files sorted by size.

Also use the cleanup command regularly (ideally, right after installing new patches and/or applications).



Bill Hassell, sysadmin
V. V. Ravi Kumar_1
Respected Contributor

Re: /var Increasing Size

hi,

see this link, beautiful document on extending /usr /var and /tmp if u don't have online JFS.

http://support1.itrc.hp.com/service/cki/docDisplay.do?docId=200000046785431

regds
ravi
Never Say No
Michael Lampi
Trusted Contributor

Re: /var Increasing Size

The suggestions to bring the system down to single user mode, or to use Online JFS are all good.

However, an easy way to "extend" a mounted file system is to find an appropriately large directory in your /var file system that can be moved to another volume. If necessary, create another volume that has the amount of space needed to hold the directory to be moved. Using tar or find/cpio move that directory to the new location. Finally, place a link in /var pointing to the new location, and you are all set.

This will not require the system to be shut down or rebooted, and does not require online JFS.
A journey of 1000 steps ends in a mile.
hpuxhelp
Regular Advisor

Re: /var Increasing Size

To Michael Lampi,
After creating a new filesystem, mount it and use cpio to copy all the contents from old /var to new /var. Does it need to be edit in the /etc/fstab file ?
and how do i perform a link from old to new
ln -s ???
harry d brown jr
Honored Contributor

Re: /var Increasing Size

v7e,

You really should start your own new thread being that the last response to this thread was July 2002.

live free or die
harry
Live Free or Die
Martin Johnson
Honored Contributor

Re: /var Increasing Size

Go get'm Harry!

:-)
Marty