Operating System - HP-UX
1839238 Members
3300 Online
110137 Solutions
New Discussion

Re: Logical Volume Manager

 
Chris Campbell_10
Occasional Contributor

Logical Volume Manager

This is my first time attempting to use the LVM. The default HP-UX install
allocated a lot of space for /var. Only 31% is being used. I would like to
use some of that space for /opt and /usr. I tried to shrink the logical volume
but I'm told that it will corrupt the filesystem. I was able to enlarge a
volume, but the size of the filesystem remains unchanged. So the question is,
can the filesystem be resized, or must I copy the files, change the volume size
create a new filesystem, and copy everything back? If I have to do the less
desireable of the two (obiously the second one), what is the best way to do
it?
3 REPLIES 3
Joey Sta. cruz_1
New Member

Re: Logical Volume Manager

Hi,

Regarding your problem on how to reduce your /var filesystem. We usually do it
here in this way.

* Reducing a logical volume
1. Backup filesystem /var
2. go to single user bec you cannot unmount /var
3. lvreduce -L /dev/vg?/lvol?
4. newfs /dev/vg?/lvol?
5. go to multi-user
5. Restore backup

Here, we never reduced our /var, it's either we maintain the default size
during UX fresh installation or increased the size which is 2x or 3x the size
of the default size. Which is currently configured on some of our server here.
Also, it depends on the applications requirement

Hope I could be of help
Joey
Jim Butler_4
Advisor

Re: Logical Volume Manager

I agree with not reducing var - since when you install patches, this space will
be used to backup patches, and write log files (/var/adm/sw/patch, and
/var/adm/syslog, etc.) If you still want to, and have free disk available, what
I normally do is this
1. Use SAM to add a new logical volume to the size you want it - mount it on
/var2
2. copy everything from /var to /var2 - (I use a find then pipe that to cpio)
i.e..
cd /var
find . * | cpio -rfp * /var2 - check the syntax - this is just off the top of
my head (B4 coffee).
3. Once everything looks OK, just edit /etc/fstab and switch var and var2
mount points.

reboot

your done.

Wait a week and see if everything is OK (usually is) - then kill the old /var
good luck
Carlos Riera
Frequent Advisor

Re: Logical Volume Manager

Hi:

Here are mi tricks:

1- on /var must be free spaced . /var/tmp is used in sort operations and
/var/preserve is used by vi to make a copy file before edition.

2- /var/adm/sw/patch ( 10.20) /var/adm/sw/save( 11.00) is used in software
update to keep copies of updated software.

4- /var/adm/crash is used to store dumps after panics.

3- /opt is used to add new software.

/var cannot be unmounted without change to single-user.

/opt may be unmonuted ( with little luck)


I use create separated lv for:

/var/adm/sw/pacth -> many times you must enlarge this filesystem in software
updates. So you can unmmount and enlarge online.

/var/adm/crash. If it were on /var filesystem could be casue of /var filesystem
full after panics.

/var-> keeping 'suficient' space available

/opt-> You can enlarge this filesystem when you need it. Dont share space with
/var using symbolic links.


/var/adm/sw/patch and /var/adm/crash needs lots of space so if you have
mirrored lvs you can leave these without mirror.


Whats then better procedure?.

First, make a make_recovery and backup of root vg.

If you can reinstall your server, this is the better procedure. Select advanced
instalation to custom your vg and lvs.

You cant: well, just create lvs and make copies between filesystems.

good luck.