1820241 Members
3029 Online
109620 Solutions
New Discussion юеВ

Re: lvextend pain

 
Kevin Epstein
Occasional Advisor

lvextend pain

Hi All,

I very absent-mindedly did an lvextend on a logical volume that was still mounted! The lv was not extended, but if I do a vgdisplay I see that the extents have been used up! how can I reverse what I've done?

I've thought of lvreducing the logical volume and then re-extending it. I realise I'll probably end up having to go to backup tapes to restore the data.

Before I try this I was hoping that someone could confirm that this is the way to go, of if someone can suggest a better way.

Thanks.
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor

Re: lvextend pain

Hi Kevin:

I think you mean that you *did* the 'lvextend' on the logical volume, but did *not* exten the file system.

If that is the case, you should be able to 'lvreduce' the logical volume back to its original size without harm.

As insurance, of course, be sure to backup the filesystem that lives in the logical volume beforehand!

Regards!

...JRF...
Kevin Epstein
Occasional Advisor

Re: lvextend pain

Hi,

I think you're right. I did lvextend -L 20000 /dev/vg02/lvol1

Can I not just do the extendfs command now?
Do I have to first reduce?

Kevin
Pete Randall
Outstanding Contributor

Re: lvextend pain

You should be able to unmount the file system and run extendfs. No need to lvreduce.


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: lvextend pain

Hi (again):

Again, if I understood you, and you mean that you 'lvextend'ed the wrong logical volume, and thus you want to reclaim the phyical extents it took, then read my first post.

If you mis-sized the logical volume too large, you can also 'lvreduce' it to a smaller size, AS LONG AS you do not reduce it smaller than the size of the fileystem it contains. Then extend the filesystem.

Regards!

...JRF...
SGUX
Valued Contributor

Re: lvextend pain

The LV still being mounted is no problem.
The extends have not been used since you did not extend the filesystem yet, so lvreducing should be OK if you need these extends for another LV. If you would like to extend this FS then this could be done on-line when you have onlineJFS installed using "fsadm -F vxfs -b ........" (see man fsadm_vxfs) [if this is a vxfs-FS) If no onlineJFS is available then the only option is unmounting the filesystem and use "extendfs ....."
Kevin Epstein
Occasional Advisor

Re: lvextend pain

Hey All - it's been a long week. After the first response about not actually extending the FS I realized no mistake had been made - rather I'd only done half the job!
After unmounting and doing the extendfs all was well in the world once again.

Thanks again for all the replies
Kevin
Kevin Epstein
Occasional Advisor

Re: lvextend pain

Thanks all