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

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
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...
Chris2005
Regular Advisor

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

I have got another diskcabinet which I could attach to do system to gain more disk space. The only problem is I don't have a SCSI cable for that. I've contacted HP so now I'm waiting on their reply.

Thanx for you help.
Chris2005
Regular Advisor

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

I have got another diskcabinet which I could attach to the system to gain more disk space. The only problem is I don't have a SCSI cable for that. I've contacted HP so now I'm waiting on their reply.

Thanx for you help.
Chris2005
Regular Advisor

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

Actually it's not the root filesystem I need to reduce, but /opt. I made mistake about that.

Is it possible to reduce /opt in single mode without using Ignite or OnlineJFS?
OldSchool
Honored Contributor

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

you can re-size /opt in single user mode. note all of the warning about backup, resize, then restore (from above) still apply
Bill Hassell
Honored Contributor

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

The only file systems you cannot increase or reduce are / and /stand. You can reduce /opt in single user mode. HOWEVER: you must remove the data because it will be destroyed. You must backup /opt (twice if this server is important), then boot into single user mode. /opt will not be mounted so you just use lvreduce to change the lvol to size you want. Run newfs to recreate the directory structure and then restore /opt from your backup tape.


Bill Hassell, sysadmin
RED-Dragon
Occasional Visitor

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

Hi Sundar,

 

We want to reduce lvol13 which is currently 1700GB, but there is another mount lvol14 point which is under this mount point lvol13. Now can we follow your solution?

 

/dev/vgvedas/lvol13
                   1782579200 542028352 1234416248   31% /CDBLprodrun
/dev/vgvedas/lvol14
                   102400000 60213192 41866424   59% /CDBLprodrun/dat

 

 

 

Thanks.

Tanjil

Dennis Handly
Acclaimed Contributor

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

>there is another mount lvol14 point which is under this mount point lvol13

 

You should be able to umount /CDBLprodrun/data and mount it elsewhere.  Or remount it later.