Operating System - HP-UX
1753481 Members
4478 Online
108794 Solutions
New Discussion юеВ

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

 
SOLVED
Go to solution
Chris2005
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
James R. Ferguson
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...
Sundar_7
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 ?
Steven E. Protter
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
Basheer_2
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
Basheer_2
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
Chris2005
Regular Advisor

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

Thank you all once again!
Chris2005
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
A. Clay Stephenson
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.
James R. Ferguson
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...