All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Reduce an LVM volume split on two physical disks
@ 2010-03-29 20:24 Mathieu Chartier
  2010-03-29 21:18 ` Bryan Whitehead
  2010-03-29 21:41 ` chris procter
  0 siblings, 2 replies; 3+ messages in thread
From: Mathieu Chartier @ 2010-03-29 20:24 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

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?
 
The volume is in LVM2 
 
Regards,
 
Mathieu Chartier
Technicien Informatique
Cégep de Saint-Hyacinthe
tél:  450 773-6800 Poste 153
ligne Mtl (514) 875-4445 Poste 153

[-- Attachment #2: HTML --]
[-- Type: text/html, Size: 891 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Reduce an LVM volume split on two physical disks
  2010-03-29 20:24 [linux-lvm] Reduce an LVM volume split on two physical disks Mathieu Chartier
@ 2010-03-29 21:18 ` Bryan Whitehead
  2010-03-29 21:41 ` chris procter
  1 sibling, 0 replies; 3+ messages in thread
From: Bryan Whitehead @ 2010-03-29 21:18 UTC (permalink / raw)
  To: LVM general discussion and development

Reducing the size of the LV is possible, but the filesystem sitting on
top likely cannot be reduced.
(there are some guides to resize ext3, such as:
http://www.howtoforge.com/linux_resizing_ext3_partitions )

Suggestion:
Use an external disk (usb/firewire) and add it to the volume group
where the two logical disks are on. migrate data off the second disk,
replace disk, then migrate data off the external disk, and then remove
the external disk.

On Mon, Mar 29, 2010 at 1:24 PM, Mathieu Chartier
<mchartier@cegepsth.qc.ca> wrote:
> 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?
>
> The volume is in LVM2
>
> Regards,
>
> Mathieu Chartier
> Technicien Informatique
> C�gep de Saint-Hyacinthe
> t�l:� 450 773-6800 Poste 153
> ligne Mtl (514) 875-4445 Poste 153
> _______________________________________________
> 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/
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Reduce an LVM volume split on two physical disks
  2010-03-29 20:24 [linux-lvm] Reduce an LVM volume split on two physical disks Mathieu Chartier
  2010-03-29 21:18 ` Bryan Whitehead
@ 2010-03-29 21:41 ` chris procter
  1 sibling, 0 replies; 3+ messages in thread
From: chris procter @ 2010-03-29 21:41 UTC (permalink / raw)
  To: LVM general discussion and development


>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



      

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-29 21:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-29 20:24 [linux-lvm] Reduce an LVM volume split on two physical disks Mathieu Chartier
2010-03-29 21:18 ` Bryan Whitehead
2010-03-29 21:41 ` chris procter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.