Re: Reduce an LVM volume split on two physical disks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>Hi,
> 
>I have an LVM volume of 1.8TB split on two physical disk that have a 900 someting GB partition on each of them.
> 
>I need to change the second disk, and only 396GB og the 1.8TB is used...so can I reduce the size of the LVM volume to only the first disk, change the second disk and expand after the LVM volume to the second disk?


You should be able to do this.

You'll need to reduce the size of the filesystem (using resize2fs if its ext3) so it will fit on the one disk, it will probably need to be unmounted for this bit, and its not entirely risk free so make sure you have a good backup before you start.

Then you can use lvreduce to shrink the lv down so its small enough to fit on the one disk. 

vgdisplay should then show how many PE are in use on each disk, if you're lucky then the whole lv will be on the right disk already, if not then you can use pvmove to migrate all the used pe on the 2nd disk onto the first disk. This should leave the second disk completly empty (i.e. all of its pe free)

Once the lv is entirely on the disk you want to keep then you can use vgreduce to remove the unused second disk from the vg.

Then replace the disk and use vgextend to add the replaced disk into the volume group, lvextend the lv back up to the original size, and extend2fs will expand the filesystem to file the newly resized lv.


But its late so you probably want to read the appropriate man pages and check my logic before you do anything  :)

chris



      


_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux