Operating System - HP-UX
1829705 Members
2437 Online
109992 Solutions
New Discussion

reduce volume and allocate it to another

 
M.Thomas
Frequent Advisor

reduce volume and allocate it to another

Below is my BDF command for M02 and M09.

/dev/data/M02 40960000 246952 40395064 1% /M02

/dev/data/M09 172105728 158790536 13211184 92% /M09

There is a request to shrink M02 by 32Gig and allocate that to M09. what steps i would do here, given i have no Online Jfs.Currently the VG data has only 2G free space, if i reduce 32G from M02 is their any step i have to do to make the VG see that space? Please help

Thanks

Thomas.
11 REPLIES 11
Pete Randall
Outstanding Contributor

Re: reduce volume and allocate it to another

LVM, I presume? Without Online JFS, you will have to back up your data, run lvreduce, then newfs, then restore the data to M02. For M09, you run lvextend and extendfs.


Pete

Pete
Pete Randall
Outstanding Contributor

Re: reduce volume and allocate it to another

Oh, I'm also assuming these are two logical volumes within the same volume group.


Pete

Pete
Patrick Wallek
Honored Contributor

Re: reduce volume and allocate it to another

You would be better off backin up the data in /M02, and then removing and recreating that LV.

Then you can extend M09.

Since you do not have online jfs you will need to make sure the application that access those is shut down.

Here's what I would do in your case (general steps):

1) Backup /M02
2) Umount /M02
3) Remove /dev/data/M02
4) Recreate /dev/data/M02
5) Mount /M02
6) Restore /M02
7) umount /M09
8) lvextend /M09
9) extendfs /M09
10) Moount /M09

M.Thomas
Frequent Advisor

Re: reduce volume and allocate it to another

Yes this is LVM.Since they are in the same volume group, can't i just lvreduce the M02 and then lvextend the M09 after unmounting the filesystems?


Thanks

Thomas
Geoff Wild
Honored Contributor

Re: reduce volume and allocate it to another

Yes you can lvreduce /dev/data/M02 then lvextend /dev/data/M09

fsadm -b 7232M /M02
lvreduce -L 7232 /dev/data/M02

lvextend -L 200840 /dev/data/M09
fsadm -b 200840M /M09

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Pete Randall
Outstanding Contributor

Re: reduce volume and allocate it to another

Geoff,

He doesn't have OnlineJFS!


Pete

Pete
Patrick Wallek
Honored Contributor

Re: reduce volume and allocate it to another

If you lvreduce M02, then you will likely have to newfs it and restore your data. Not having online JFS makes this much more difficult.

I still recommend recreating M02 from scratch.
M.Thomas
Frequent Advisor

Re: reduce volume and allocate it to another

can't i do this...

umount /M02
umount /M09
fsadm -b 7232M /M02
lvreduce -L 7232 /dev/data/M02

lvextend -L 196000 /dev/data/M09
fsadm -b 196000M /M09

I thought the only issue of NOT having online JFS was the downtime (since i have to umount). is this correct?

Thanks

Thomas
Yang Qin_1
Honored Contributor

Re: reduce volume and allocate it to another

Hi, Tomas, be careful with lvreduce. Here is warning from man page:

LVM does not store any information about which physical extents within a logical volume contain useful data; therefore, reducing the space allocated to a logical volume without doing a prior backup of the data could lead to the loss of useful data. The lvreduce command on a logical volume containing a file system of greater length than the size being reduced to will cause data corruption.
Geoff Wild
Honored Contributor

Re: reduce volume and allocate it to another

Sorry - without Online JFS - use extendfs:

umount /M02
umount /M09
lvreduce -L 7232 /dev/data/M02
extendfs /dev/data/rM02


lvextend -L 196000 /dev/data/M09
extendfs /dev/data/rM09

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Geoff Wild
Honored Contributor

Re: reduce volume and allocate it to another

Man - too much turkey (it was thanksgiving here in Canada this past weekend).

Anyways - forget my last post - you can't use extendfs to reduce a file system.

You have to do it the way Patrick says - backup M02, then umount it, then lvreduce it, then newfs it, then restore your data.

For M09, yes, you can umount it and lvextend and extendfs it.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.