FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-07-2012, 03:04 AM
Marc Shapiro
 
Default How to remove a PV from an LVM VG?

I think that my old disk is dying and I want to get the data off of it
before that happens. I just had the system drop out of X-windows and
lock up completely.


The screen was blank, except for three lines at the top:

[120497,729655] nouveau 0000:01:00.0: Setting dpms mode 3 on vga encoder
(output 0)
[120497,749909] nouveau 0000:01:00.0: Setting dpms mode 0 on vga encoder
(output 0)
[120497,749915] nouveau 0000:01:00.0: Output VGA-1 is running on CRTC 0
using Output A


This is the second time that this has happened. I was not home the
first time and I found it like that when I got home. I rebooted and
everything seemed OK.


This time, on rebooting I was dropped into single user mode. Apparently
the system had mounted my OLD / partition from the old drive instead of
the new partition on the new drive (neither of these partitions are in
the lvm group, they are physical partitions). I reran lilo and the
correct partition is being mounted as /, but I don't trust the old disk
any more. The old disk is a 40GB drive. I have previously installed a
1TB drive and have added it to the VG. I just need to make sure that I
do everything in the correct order so that I don't lose my data.



The old drive is /dev/sda and there are two PVs on the disk /dev/sda3
and /dev/sda4, both are in vg1


The new drive is /dev/sdc and it has only 1 LVM PV and that is /dev/sdc4


$ sudo pvdisplay
--- Physical volume ---
PV Name /dev/sda3
VG Name vg1
PV Size 17.24 GiB / not usable 1.38 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 4414
Free PE 0
Allocated PE 4414
PV UUID y0A9w2-Es63-ju5z-bSV0-JSbU-AdMj-j2U58I

--- Physical volume ---
PV Name /dev/sda4
VG Name vg1
PV Size 19.47 GiB / not usable 4.05 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 4984
Free PE 0
Allocated PE 4984
PV UUID hYLZpk-8lWT-Kna5-JwbV-3NpP-f3wP-zvKD63

--- Physical volume ---
PV Name /dev/sdc4
VG Name vg1
PV Size 928.56 GiB / not usable 1.83 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 237710
Free PE 224910
Allocated PE 12800
PV UUID N30XAD-155f-fRdA-0tch-dLU2-WMxP-z8jLCx



Is this the correct method to preserve my data:

pvmove /dev/sda3 /dev/sdc4

wait for it to finish

pvmove /dev/sda4 /dev/sdc4

once that has finished

vgreduce vg1 /dev/sda3
vgreduce vg1 /dev/sda4

pvremove /dev/sda3
pvremove /dev/sda4


I really need to know that this is the correct procedure and get this
done as quickly as possible. I don't want to lose data.


Marc Shapiro


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4FA73BC3.8080309@gmail.com">http://lists.debian.org/4FA73BC3.8080309@gmail.com
 
Old 05-07-2012, 06:57 AM
Philippe Marzouk
 
Default How to remove a PV from an LVM VG?

On Sun, May 06, 2012 at 08:04:35PM -0700, Marc Shapiro wrote:
> I think that my old disk is dying and I want to get the data off of
> it before that happens. I just had the system drop out of X-windows
> and lock up completely.
>

[...]

> The old drive is /dev/sda and there are two PVs on the disk
> /dev/sda3 and /dev/sda4, both are in vg1
>
> The new drive is /dev/sdc and it has only 1 LVM PV and that is /dev/sdc4
>

[...]

>
> Is this the correct method to preserve my data:
>
> pvmove /dev/sda3 /dev/sdc4
>
> wait for it to finish
>
> pvmove /dev/sda4 /dev/sdc4
>
> once that has finished
>
> vgreduce vg1 /dev/sda3
> vgreduce vg1 /dev/sda4
>
> pvremove /dev/sda3
> pvremove /dev/sda4
>
>
> I really need to know that this is the correct procedure and get
> this done as quickly as possible. I don't want to lose data.
>

This is the method I use.
pvmove fails sometimes, you just need to restart it and it will continue
where it stopped.

Philippe


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120507065726.GA17681@ozigo.org">http://lists.debian.org/20120507065726.GA17681@ozigo.org
 

Thread Tools




All times are GMT. The time now is 12:47 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org