Operating System - HP-UX
1752643 Members
5639 Online
108788 Solutions
New Discussion юеВ

Reducing of /dev/vg00/lvol8 (/var)

 
Kerry_1
Contributor

Reducing of /dev/vg00/lvol8 (/var)

Dear All
I must to reduce the size of /dev/vg00/lvol8 (/var)from 2Gb to 0,5Gb of the working HP-UX11i without stopping it.
So the steps I plan to make are:
1.tar cvhf /dev/rmt/0m /var
2.umount /dev/vg00/lvol8
3.lvremove -f /dev/vg00/lvol8
4.lvcreate -L 500 -n lvol8 /dev/vg00
5.newfs -F vxfs /dev/vg00/rlvol8
6.mount -F vxfs /dev/vg00/lvol8 /var
7.tar xvf /dev/rmt/0m
But I now that there is the /var/adm/syslog/syslog.log file which permanently in use. So should I switch it off before my actions and switch on it after? And if yes then how to do switching? Are my steps correct?
Thanks
Kerry
13 REPLIES 13
Pete Randall
Outstanding Contributor

Re: Reducing of /dev/vg00/lvol8 (/var)

Kerry,

Your steps are basically correct but you're going to have a problem with number 2 - the unmount. I believe the only way you're going to be able to accomplish this is to go to single user mode.

Pete

Pete
Bill Hassell
Honored Contributor

Re: Reducing of /dev/vg00/lvol8 (/var)

Not possible while HP-UX is running in multi-user mode. /var is the busiest filesystem in Unix. There are many open logfiles, printers use it, email, and of course applications may use it for temp files. So you won't be able to unmount /var while the system is running.

You'll have to shutdown and reboot into single user mode, then perform the above tasks except you can reduce the number of steps by combining lvremove and lvcreate into one step: lvreduce. It accomplishes the same thing.


Bill Hassell, sysadmin
Pete Randall
Outstanding Contributor

Re: Reducing of /dev/vg00/lvol8 (/var)

Kerry,

One other thought. You're going to be making /var fairly small which could cause maintenance issues in the future. I assume that you need to re-assign the 1.5GB from /var to some other filesystem. Are there any other alternatives available to you? Like reducing another filesystem than /var or adding some disk space?

Pete

Pete
Martin Burnett_2
Trusted Contributor

Re: Reducing of /dev/vg00/lvol8 (/var)

Hello Kerry,

I agree with Bill and Pete, I run into lots of customers who are running out of spce with var do to patches added to the system and log files. So the question is, why are you reducing /var? Is it to reclaim space for another filesystem? /var in HP-UX requires a significant amount of space to be available to it for normal system operations. If you tell us why it needs to be reduced maybe we can provide an alternative.

Thanks for participating in the forums,

Martin
Chaos reigns within. Reflect, repent, and reboot. Order shall return.
Sean OB_1
Honored Contributor

Re: Reducing of /dev/vg00/lvol8 (/var)

Kerry,

The first question to ask is why the need to reduce it? Remember that /var gets hit hard on a system and often needs to be very large.

Then if you do need to reduce it you'll need to do it in single user mode as the system won't let you unmount it since so many process will be using it.

Sean
Martin Johnson
Honored Contributor

Re: Reducing of /dev/vg00/lvol8 (/var)

Another method would be to do an Ignite backup of the system, then do a restore. Interact with the restore to change the size of var. You also change the file system type to JFS, if it is not already JFS.

Yes, this does require down time, but so does your method. /var must be unused to umount it. The only way for that to occur is to be in single user mode.

HTH
Marty
Judy Traynor
Valued Contributor

Re: Reducing of /dev/vg00/lvol8 (/var)

I like to create a /var2 partition of the size I want, then on the original var,
find . -depth -print | cpio -p d /var2

This dupes the dir to the new /var2,
edit /etc/fstab, to switch var and var2, and reboot.

(or umount both, and bcheckrc it all)

If you need the space on another filesystem, you can always move data to an empty area on your var partition and link it.

have fun
Sail With the Wind
Judy Traynor
Valued Contributor

Re: Reducing of /dev/vg00/lvol8 (/var)

As far as the syslog,
ps -ef | grep syslogd

kill it, or use the script in /sbin/init.d to stop it.
Sail With the Wind
Steve Post
Trusted Contributor

Re: Reducing of /dev/vg00/lvol8 (/var)

FYI: Single User Mode. There are TWO things that are BOTH called "single user mode."

One is you run the shutdown command. In this version you can't unmount /opt /var /usr or any other hpux file system.

The other version is you power DOWN the computer, you interupt it's boot process, then run the method to boot into single user mode. In this version almost all of the filesystems are unmounted.