Operating System - HP-UX
1830729 Members
2141 Online
110015 Solutions
New Discussion

LVM - Increasing LV size and then deciding to reduce it before you have done anything with it.

 
SOLVED
Go to solution
James Armstrong
Advisor

LVM - Increasing LV size and then deciding to reduce it before you have done anything with it.

I have increase a logical volumes size by 100 Mb but I haven't extended the filesystem. Now I realise that I don't have to increase the size of the filesystem and therfore I want to reclaim back the 100 Mb I added to the LV.
I am very worried that if I simply reduce the LV back to it's original size that LVM in all it's wisdom might decide to remove 100 Mb from an area that has a filesystem on it rather than the 100 Mb I have just increased it by! Is there any guarantee that this won't happen, HP can't seem to guarantee it!!!!!!!
5 REPLIES 5
Rainer_1
Honored Contributor

Re: LVM - Increasing LV size and then deciding to reduce it before you have done anything with it.

there's no guarantee that lvreduce does not touch the filesystem area.
Rita C Workman
Honored Contributor

Re: LVM - Increasing LV size and then deciding to reduce it before you have done anything with it.

I would guess not.
You may want to take the course of 'prudence' here and follow the procedures for reducing a logical volume to ensure no loss of data.
Backup your data first, then reduce the lvol and reset the f/s. Normally on a lvreduce you would have to recreate the filesystem (since the lvol would now be less then the f/s..). But here your 'unique'..you may simple need to do a extendfs to reset it to the lvol. -or- you may want to take the course of recreating it.
Last restore your data.

Just a thought,
rcw



James R. Ferguson
Acclaimed Contributor
Solution

Re: LVM - Increasing LV size and then deciding to reduce it before you have done anything with it.

James:

I presume that you are using JFS and have done an 'lvextend' but not the 'fsadm' to actually expand the filesystem. I would complete the process and then reduce the filesystem. You may need to quiesce the filesystem before you get fsadm to reduce it.

...JRF...
Carlos Fernandez Riera
Honored Contributor

Re: LVM - Increasing LV size and then deciding to reduce it before you have done anything with it.

I think there is no problem, but a little of security is always welcome.

DO a backup os that filesystem and then reduce. check it with fsck... OK ..

No problem.

All bad, No problem ... , reduce lvol, do newfs and recover from backup.
unsupported
Tony Willis_1
Frequent Advisor

Re: LVM - Increasing LV size and then deciding to reduce it before you have done anything with it.

I have performed the extend and reduce before adding the added space to the fs.

It worked when I did ir BUT, I did a complete level 0
backup prior BECAUSE, it was the SAFE thing to do.
"Not Today,Nice Try, Next Time"