System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to decrease logical volume on HP-UX?

 
SOLVED
Go to solution
Highlighted
Regular Advisor

How to decrease logical volume on HP-UX?

I want to decrease a logical volume to get more disk space for another logical volume.

In SAM you can increase a volume, but there's no option to decrease.

Regards,
Chris
16 REPLIES 16
Highlighted
Acclaimed Contributor

Re: How to decrease logical volume on HP-UX?

Hi Chris:

You need to _first_ reduce the size of the _filesystem_ contained within the logical volume (with 'fsadm') and then 'lvreduce' the logical volume.

If this isn't a VxVS (JFS) filesystem (unlikely) or if you don't have OnlineJFS (I hope not) then you must backup any data that you want saved; 'lvreduce' the filesystem; 'newfs' a filesystem within the logical volume; and reload your data.

Regards!

...JRF...
Highlighted
Honored Contributor
Solution

Re: How to decrease logical volume on HP-UX?

Chris,

1) Take a full backup of the filesystem
2) Check if you have OnlineJFS
3) If yes, defragment the filesystem to increase the chances of successful size reduction

fsadm -F vxfs -D -E -d -e /

4) Reduce the size of the filesystem

fsadm -F vxfs -b m /

Note the affix "m"

5) if the above command was succesful then you can reduce the LV size

lvreduce -L /

Sundar.
Learn What to do ,How to do and more importantly When to do ?
Highlighted
Exalted Contributor

Re: How to decrease logical volume on HP-UX?

Shalom Chris,

Safe method w/o OnlineJFS

Take a full backup, with all databases and such down. (can be done with sam)

umount the filesystem (can be done with sam)

lvremove the logical volume (can be done with sam)

lvcreate the newer, smaller logical volume (can be done with sam).

Restore the data(yes can be done with sam).

I recommend a backup before using any of the above methodologies. Onlinejfs is excellent, but not perfect.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Highlighted
Trusted Contributor

Re: How to decrease logical volume on HP-UX?

Chris,

We did this few weeks ago.
1) make backup
2) make another backup

Fsadm â D â E mount-point

Reduce file system /dev/vgprod/lvred to 6GB = 6,291,456 (6,144,000)

1) fsadm â d â D â e â E mount-point
2) fsadm â d â D â e â E mount-point
3) fsadm â F vxfs â b 6144000 mount-point
4) lvreduce â L 6000 /dev/vgprod/lvred

Verify
Vgdisplay â v vgred
Should display the logical volume with the new size


Increase the file system mount-point-2 to 10GB
Current size is 5 GB
Next size after extension = 10 GB

lvextend â L 10000 /dev/vgprod/lvredqa
fsadm â F vxfs â b 10240000 /dev/vgprod/lvredqa

Verify
Vgdisplay â v vgprod
Lvdisplay â v /dev/vgprod/lvredqa
Highlighted
Trusted Contributor

Re: How to decrease logical volume on HP-UX?

Chris,
that cut and paste did not work properly.

here is the cut and paste from text
Fsadm -D -E mount-point

Reduce file system /dev/vgprod/lvred to 6GB = 6,291,456 (6,144,000)

1) fsadm -d -D -e -E mount-point
2) fsadm -d -D -e -E mount-point
3) fsadm -F vxfs -b 6144000 mount-point
4) lvreduce -L 6000 /dev/vgprod/lvred

Verify
Vgdisplay -vv vgred
Should display the logical volume with the new size


Increase the file system mount-point-2 to 10GB
Current size is 5 GB
Next size after extension = 10 GB

lvextend -L 10000 /dev/vgprod/lvredqa
fsadm -F vxfs -b 10240000 /dev/vgprod/lvredqa

Verify
Vgdisplay -v vgprod
Lvdisplay -v /dev/vgprod/lvredqa
Highlighted
Regular Advisor

Re: How to decrease logical volume on HP-UX?

Thank you all once again!
Highlighted
Regular Advisor

Re: How to decrease logical volume on HP-UX?

I want to know my options reducing my root filesystem and volume without onlineJFS (it's my own server for testing things out and don't want to buy onlineJFS as it would cost me about severall hundreds of dollars I was told).

As Steven sad it's possible using SAM via a backup, resize and restore action, but I'm wondering that is still the case when it's the root filesystem and volume I want to reduce. I mean I could go into single mode, but is SAM still available then? Anyway I don't have enough diskspace to keep the backup.

Anyone any ideas.........?

Thanx in advance.

Regards,
Chris
Highlighted
Acclaimed Contributor

Re: How to decrease logical volume on HP-UX?

There are no options. Your system will not run without the / filesystem mounted. It might be possible if you can install your disk in another system and treat it as a data disk but you easist option is to take an Ignite image and restore the system from that.
If it ain't broke, I can fix that.
Highlighted
Acclaimed Contributor

Re: How to decrease logical volume on HP-UX?

Hi Chris:

> I want to know my options reducing my root filesystem and volume without onlineJFS.

Ignite is the best choice. Make an Ignite recovery tape of vg00 and boot from it. Choose the Advanced Installation mode and tab to the filesystem menus to size your filesystems to your tastes.

Regards!

...JRF...