* [linux-lvm] Removing a very old physical drive
@ 2009-10-26 8:59 Nicholas Robinson
2009-10-26 13:09 ` Matthew Gillen
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Nicholas Robinson @ 2009-10-26 8:59 UTC (permalink / raw)
To: linux-lvm
Hi
I've been using lvm for quite a few years, but only occasionally when I
need to add/remove new drives. So, my knowledge is limited and a bit
rusty! I should have removed the old drive when I added a new one a
couple of years ago, but for reasons I cannot remember, I didn't.
I only know how to remove a drive when there is a new drive about to
move the stuff onto. My problem now is that the new drive is fully
allocated and so this route won't work. There is plenty of free space on
the new drive so it should be possible to move everything that might be
on the old physical drive and then remove it from the lvg. I just can't
work out how. The HOWTOs and threads don't seem to cover this starting
point.
My questions are:
1. Can I do move the data off the old drive to the new drive without
adding another new drive?
2. I don't understand the output from pvdisplay - why is it telling me
about /dev/sda1 at the bottom when this partition is a boot partition
and tiny?
3. Where has the LogVol01 come from and what is it doing? Can I remove
it?
4. Can I rename the volgroup/logvols to the same pattern used by new
installations? e.g. vg_hostname and lv_root, etc.
If you've read this far, then thank you! I hope the following extracts
are sufficient.
Best Wishes
Nick
# pvdisplay
--- Physical volume ---
PV Name /dev/sdb2
VG Name VolGroup00
PV Size 27.76 GB / not usable 13.73 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 888
Free PE 30
Allocated PE 858
PV UUID V7XQmw-wMkv-fA4H-UUzn-d4CR-sfju-jHYjNZ
--- Physical volume ---
PV Name /dev/sda2
VG Name VolGroup00
PV Size 315.00 GB / not usable 31.81 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 10079
Free PE 987
Allocated PE 9092
PV UUID tXBnAO-0D0U-yLvg-XhaA-vEw3-Niz7-p23dAt
"/dev/sda1" is a new physical volume of "298.09 GB"
--- NEW Physical volume ---
PV Name /dev/sda1
VG Name
PV Size 298.09 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID T1XNow-VO83-JVW5-8NBh-1fiF-VzWT-m5mj2P
# fdisk -l /dev/sda
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30b7d346
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6 48163+ 83 Linux
/dev/sda2 7 38913 312520477+ 83 Linux
# lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID LPxYrN-E62m-L8uh-Ms0O-vZNI-EWM6-GlBD4E
LV Write Access read/write
LV Status available
# open 1
LV Size 310.00 GB
Current LE 9920
Segments 3
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID u3rWh0-NHxf-pn3F-o0Du-Mbnw-LG5V-2l2t3T
LV Write Access read/write
LV Status available
# open 1
LV Size 960.00 MB
Current LE 30
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
314908972 145080044 153584540 49% /
/dev/sdb1 198129 13938 173962 8% /boot
tmpfs 239080 0 239080 0% /dev/shm
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [linux-lvm] Removing a very old physical drive
2009-10-26 8:59 Nicholas Robinson
@ 2009-10-26 13:09 ` Matthew Gillen
2009-10-26 16:10 ` malahal
2009-10-26 18:32 ` Ray Morris
2 siblings, 0 replies; 9+ messages in thread
From: Matthew Gillen @ 2009-10-26 13:09 UTC (permalink / raw)
To: linux-lvm
On 10/26/2009 04:59 AM, Nicholas Robinson wrote:
> Hi
>
> I've been using lvm for quite a few years, but only occasionally when I
> need to add/remove new drives. So, my knowledge is limited and a bit
> rusty! I should have removed the old drive when I added a new one a
> couple of years ago, but for reasons I cannot remember, I didn't.
> ...
> 1. Can I do move the data off the old drive to the new drive without
> adding another new drive?
Is there any reason you can't use 'cp -a'? If that isn't an option for some
reason, then you're out of luck, if I understood correctly: if the new disk is
completely allocated to another VG and you can't free up some partition (PV)
to add to the 'old' VG, there's not much you can do, AFAIK (since any given
partition/PV can only belong to one VG).
> 3. Where has the LogVol01 come from and what is it doing? Can I remove
> it?
Given your potentially flaky memory, it might be wise to try mounting it
somewhere first to see what's on it... ;-)
> 4. Can I rename the volgroup/logvols to the same pattern used by new
> installations? e.g. vg_hostname and lv_root, etc.
The GUI tool in fedora (system-config-lvm) appears to allow you to change the
names of VGs, presumably it's also possible from the command line. Just be
sure that your /etc/fstab is consistent with whatever changes you make.
HTH,
Matt
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [linux-lvm] Removing a very old physical drive
2009-10-26 8:59 Nicholas Robinson
2009-10-26 13:09 ` Matthew Gillen
@ 2009-10-26 16:10 ` malahal
2009-10-26 19:29 ` Nicholas Robinson
2009-10-26 20:33 ` Nicholas Robinson
2009-10-26 18:32 ` Ray Morris
2 siblings, 2 replies; 9+ messages in thread
From: malahal @ 2009-10-26 16:10 UTC (permalink / raw)
To: linux-lvm
Nicholas Robinson [npr@bottlehall.co.uk] wrote:
> Hi
>
> I've been using lvm for quite a few years, but only occasionally when I
> need to add/remove new drives. So, my knowledge is limited and a bit
> rusty! I should have removed the old drive when I added a new one a
> couple of years ago, but for reasons I cannot remember, I didn't.
>
> I only know how to remove a drive when there is a new drive about to
> move the stuff onto. My problem now is that the new drive is fully
> allocated and so this route won't work. There is plenty of free space on
> the new drive so it should be possible to move everything that might be
> on the old physical drive and then remove it from the lvg. I just can't
> work out how. The HOWTOs and threads don't seem to cover this starting
> point.
>
> My questions are:
>
> 1. Can I do move the data off the old drive to the new drive without
> adding another new drive?
pvmove followed by vgreduce. If you have enough free space, pvmove
should work and there is no need to add another new drive.
> 2. I don't understand the output from pvdisplay - why is it telling me
> about /dev/sda1 at the bottom when this partition is a boot partition
> and tiny?
It also reports a large size! Somehow, it detected PV signature in that
partition. You can remove such signature by running pvremove. Note that
it wipes out LVM label, so back up your data in /dev/sda1 somewhere else
before you run "pvremove /dev/sda1". If the partition is mountable after
'pvremove', you are fine. Otherwise restore the backup!
> 3. Where has the LogVol01 come from and what is it doing? Can I remove
> it?
Try mounting it and see if there is anything there. You can use lvremove
if you don't need it.
> 4. Can I rename the volgroup/logvols to the same pattern used by new
> installations? e.g. vg_hostname and lv_root, etc.
Yes, see lvrename and vgrename commands.
> If you've read this far, then thank you! I hope the following extracts
> are sufficient.
You are welcome.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [linux-lvm] Removing a very old physical drive
2009-10-26 8:59 Nicholas Robinson
2009-10-26 13:09 ` Matthew Gillen
2009-10-26 16:10 ` malahal
@ 2009-10-26 18:32 ` Ray Morris
2 siblings, 0 replies; 9+ messages in thread
From: Ray Morris @ 2009-10-26 18:32 UTC (permalink / raw)
To: LVM general discussion and development
I think you want "pvmove". It moves LVs off of a physical
volume onto other ones in the same volume group.
> My problem now is that the new drive is fully allocated and
> so this route won't work. There is plenty of free space on
> the new drive
The drive is fully allocated and it has plenty of free
space? Do you mean that the drive is part of the volume
group, but does not yet have all it' sectors full?
--
Ray Morris
support@bettercgi.com
Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/
Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/
Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php
On 10/26/2009 03:59:58 AM, Nicholas Robinson wrote:
> Hi
>
> I've been using lvm for quite a few years, but only occasionally when
> I
> need to add/remove new drives. So, my knowledge is limited and a bit
> rusty! I should have removed the old drive when I added a new one a
> couple of years ago, but for reasons I cannot remember, I didn't.
>
> I only know how to remove a drive when there is a new drive about to
> move the stuff onto. My problem now is that the new drive is fully
> allocated and so this route won't work. There is plenty of free space
> on
> the new drive so it should be possible to move everything that might
> be
> on the old physical drive and then remove it from the lvg. I just
> can't
> work out how. The HOWTOs and threads don't seem to cover this starting
> point.
>
> My questions are:
>
> 1. Can I do move the data off the old drive to the new drive without
> adding another new drive?
>
> 2. I don't understand the output from pvdisplay - why is it telling me
> about /dev/sda1 at the bottom when this partition is a boot partition
> and tiny?
>
> 3. Where has the LogVol01 come from and what is it doing? Can I remove
> it?
>
> 4. Can I rename the volgroup/logvols to the same pattern used by new
> installations? e.g. vg_hostname and lv_root, etc.
>
> If you've read this far, then thank you! I hope the following extracts
> are sufficient.
>
> Best Wishes
>
> Nick
>
> # pvdisplay
> --- Physical volume ---
> PV Name /dev/sdb2
> VG Name VolGroup00
> PV Size 27.76 GB / not usable 13.73 MB
> Allocatable yes
> PE Size (KByte) 32768
> Total PE 888
> Free PE 30
> Allocated PE 858
> PV UUID V7XQmw-wMkv-fA4H-UUzn-d4CR-sfju-jHYjNZ
>
> --- Physical volume ---
> PV Name /dev/sda2
> VG Name VolGroup00
> PV Size 315.00 GB / not usable 31.81 MB
> Allocatable yes
> PE Size (KByte) 32768
> Total PE 10079
> Free PE 987
> Allocated PE 9092
> PV UUID tXBnAO-0D0U-yLvg-XhaA-vEw3-Niz7-p23dAt
>
> "/dev/sda1" is a new physical volume of "298.09 GB"
> --- NEW Physical volume ---
> PV Name /dev/sda1
> VG Name
> PV Size 298.09 GB
> Allocatable NO
> PE Size (KByte) 0
> Total PE 0
> Free PE 0
> Allocated PE 0
> PV UUID T1XNow-VO83-JVW5-8NBh-1fiF-VzWT-m5mj2P
>
> # fdisk -l /dev/sda
>
> Disk /dev/sda: 320.0 GB, 320072933376 bytes
> 255 heads, 63 sectors/track, 38913 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> Disk identifier: 0x30b7d346
>
> Device Boot Start End Blocks Id System
> /dev/sda1 * 1 6 48163+ 83 Linux
> /dev/sda2 7 38913 312520477+ 83 Linux
>
> # lvdisplay
> --- Logical volume ---
> LV Name /dev/VolGroup00/LogVol00
> VG Name VolGroup00
> LV UUID LPxYrN-E62m-L8uh-Ms0O-vZNI-EWM6-GlBD4E
> LV Write Access read/write
> LV Status available
> # open 1
> LV Size 310.00 GB
> Current LE 9920
> Segments 3
> Allocation inherit
> Read ahead sectors auto
> - currently set to 256
> Block device 253:0
>
> --- Logical volume ---
> LV Name /dev/VolGroup00/LogVol01
> VG Name VolGroup00
> LV UUID u3rWh0-NHxf-pn3F-o0Du-Mbnw-LG5V-2l2t3T
> LV Write Access read/write
> LV Status available
> # open 1
> LV Size 960.00 MB
> Current LE 30
> Segments 1
> Allocation inherit
> Read ahead sectors auto
> - currently set to 256
> Block device 253:1
>
> # df
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/mapper/VolGroup00-LogVol00
> 314908972 145080044 153584540 49% /
> /dev/sdb1 198129 13938 173962 8% /boot
> tmpfs 239080 0 239080 0% /dev/shm
>
> _______________________________________________
> 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] 9+ messages in thread
* Re: [linux-lvm] Removing a very old physical drive
2009-10-26 16:10 ` malahal
@ 2009-10-26 19:29 ` Nicholas Robinson
2009-10-26 19:54 ` malahal
2009-10-26 20:33 ` Nicholas Robinson
1 sibling, 1 reply; 9+ messages in thread
From: Nicholas Robinson @ 2009-10-26 19:29 UTC (permalink / raw)
To: LVM general discussion and development
On Mon, 2009-10-26 at 09:10 -0700, malahal@us.ibm.com wrote:
> Nicholas Robinson [npr@bottlehall.co.uk] wrote:
> > Hi
> >
> > I've been using lvm for quite a few years, but only occasionally when I
> > need to add/remove new drives. So, my knowledge is limited and a bit
> > rusty! I should have removed the old drive when I added a new one a
> > couple of years ago, but for reasons I cannot remember, I didn't.
> >
> > I only know how to remove a drive when there is a new drive about to
> > move the stuff onto. My problem now is that the new drive is fully
> > allocated and so this route won't work. There is plenty of free space on
> > the new drive so it should be possible to move everything that might be
> > on the old physical drive and then remove it from the lvg. I just can't
> > work out how. The HOWTOs and threads don't seem to cover this starting
> > point.
> >
> > My questions are:
> >
> > 1. Can I do move the data off the old drive to the new drive without
> > adding another new drive?
>
> pvmove followed by vgreduce. If you have enough free space, pvmove
> should work and there is no need to add another new drive.
>
Thanks, I will give this a go. I think I was getting confused between
allocated and used. I thought the destination PV had to have enough
unallocated extents on it to absorb the old PV data rather than just
unused.
> > 2. I don't understand the output from pvdisplay - why is it telling me
> > about /dev/sda1 at the bottom when this partition is a boot partition
> > and tiny?
>
> It also reports a large size! Somehow, it detected PV signature in that
> partition. You can remove such signature by running pvremove. Note that
> it wipes out LVM label, so back up your data in /dev/sda1 somewhere else
> before you run "pvremove /dev/sda1". If the partition is mountable after
> 'pvremove', you are fine. Otherwise restore the backup!
>
Although it is listed as a boot partition in fdisk -l, it is not
currently used. The old disc is still the boot disc and so /dev/sda1 is
not being used at all. I can safely do a pvremove and make this
partition the real boot partition.
> > 3. Where has the LogVol01 come from and what is it doing? Can I remove
> > it?
>
I tried mounting it as you suggest and it muttered about it looking like
swap. So, I checked and it is mounted as swap! That explains that one.
The newer naming convention of ...lv_swap would have made this much
clearer!
> Try mounting it and see if there is anything there. You can use lvremove
> if you don't need it.
>
> > 4. Can I rename the volgroup/logvols to the same pattern used by new
> > installations? e.g. vg_hostname and lv_root, etc.
>
> Yes, see lvrename and vgrename commands.
>
> > If you've read this far, then thank you! I hope the following extracts
> > are sufficient.
>
> You are welcome.
>
You are very kind. I have printed your reply out and will follow it
carefully. Thank you very much.
> _______________________________________________
> 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] 9+ messages in thread
* Re: [linux-lvm] Removing a very old physical drive
2009-10-26 19:29 ` Nicholas Robinson
@ 2009-10-26 19:54 ` malahal
0 siblings, 0 replies; 9+ messages in thread
From: malahal @ 2009-10-26 19:54 UTC (permalink / raw)
To: linux-lvm
Nicholas Robinson [npr@bottlehall.co.uk] wrote:
> > pvmove followed by vgreduce. If you have enough free space, pvmove
> > should work and there is no need to add another new drive.
> >
> Thanks, I will give this a go. I think I was getting confused between
> allocated and used. I thought the destination PV had to have enough
> unallocated extents on it to absorb the old PV data rather than just
> unused.
Allocated PEs is the number of PEs allocated to logical volumes, Free
PE's is the number PEs not yet allocated. Free PEs+Allocated PEs =
Total PEs. I think you have enough free PEs to cover the old drive if I
remember your output correctly.
> I tried mounting it as you suggest and it muttered about it looking like
> swap. So, I checked and it is mounted as swap! That explains that one.
> The newer naming convention of ...lv_swap would have made this much
> clearer!
That explains why the '#open count is 1" in your lvdisplay output!
Thanks, Malahal.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [linux-lvm] Removing a very old physical drive
2009-10-26 16:10 ` malahal
2009-10-26 19:29 ` Nicholas Robinson
@ 2009-10-26 20:33 ` Nicholas Robinson
2009-10-26 21:17 ` malahal
1 sibling, 1 reply; 9+ messages in thread
From: Nicholas Robinson @ 2009-10-26 20:33 UTC (permalink / raw)
To: LVM general discussion and development
Help!
I did the pvremove command and everything seemed fine. I carried on
working on the first question and tried to do the pvmove
Immediately the machine hung and when I try to reboot, it finds the boot
partition and begins the boot, but then hangs with a blank screen and
top-left cursor. Occasionally, I can stop it with some messages about
dm-1 and logical block 0 to 8 missing.
I wonder if the pvremove over-wrote something important on the other
partition as it had an incorrect view of the size of the sda1?
Thanks
Nick
On Mon, 2009-10-26 at 09:10 -0700, malahal@us.ibm.com wrote:
> Nicholas Robinson [npr@bottlehall.co.uk] wrote:
> > Hi
> >
> > I've been using lvm for quite a few years, but only occasionally when I
> > need to add/remove new drives. So, my knowledge is limited and a bit
> > rusty! I should have removed the old drive when I added a new one a
> > couple of years ago, but for reasons I cannot remember, I didn't.
> >
> > I only know how to remove a drive when there is a new drive about to
> > move the stuff onto. My problem now is that the new drive is fully
> > allocated and so this route won't work. There is plenty of free space on
> > the new drive so it should be possible to move everything that might be
> > on the old physical drive and then remove it from the lvg. I just can't
> > work out how. The HOWTOs and threads don't seem to cover this starting
> > point.
> >
> > My questions are:
> >
> > 1. Can I do move the data off the old drive to the new drive without
> > adding another new drive?
>
> pvmove followed by vgreduce. If you have enough free space, pvmove
> should work and there is no need to add another new drive.
>
> > 2. I don't understand the output from pvdisplay - why is it telling me
> > about /dev/sda1 at the bottom when this partition is a boot partition
> > and tiny?
>
> It also reports a large size! Somehow, it detected PV signature in that
> partition. You can remove such signature by running pvremove. Note that
> it wipes out LVM label, so back up your data in /dev/sda1 somewhere else
> before you run "pvremove /dev/sda1". If the partition is mountable after
> 'pvremove', you are fine. Otherwise restore the backup!
>
> > 3. Where has the LogVol01 come from and what is it doing? Can I remove
> > it?
>
> Try mounting it and see if there is anything there. You can use lvremove
> if you don't need it.
>
> > 4. Can I rename the volgroup/logvols to the same pattern used by new
> > installations? e.g. vg_hostname and lv_root, etc.
>
> Yes, see lvrename and vgrename commands.
>
> > If you've read this far, then thank you! I hope the following extracts
> > are sufficient.
>
> You are welcome.
>
> _______________________________________________
> 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] 9+ messages in thread
* Re: [linux-lvm] Removing a very old physical drive
2009-10-26 20:33 ` Nicholas Robinson
@ 2009-10-26 21:17 ` malahal
0 siblings, 0 replies; 9+ messages in thread
From: malahal @ 2009-10-26 21:17 UTC (permalink / raw)
To: linux-lvm
Nicholas Robinson [npr@bottlehall.co.uk] wrote:
> Help!
>
> I did the pvremove command and everything seemed fine. I carried on
> working on the first question and tried to do the pvmove
>
> Immediately the machine hung and when I try to reboot, it finds the boot
> partition and begins the boot, but then hangs with a blank screen and
> top-left cursor. Occasionally, I can stop it with some messages about
> dm-1 and logical block 0 to 8 missing.
Culprit seems to be pvmove. Get a liveCD and try to activate the VG and
see if you can mount the LV. You can read of the LVM metadata from the
disk partitions (PVs). This is really sad and you need lot more LVM
expertise to fix things.
> I wonder if the pvremove over-wrote something important on the other
> partition as it had an incorrect view of the size of the sda1?
Even if pvremove tries to write something beyond /dev/sda1's size, the
write would fail. It can't do anything other than writing to /dev/sda1.
In other words, it can't mess with /dev/sda2.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [linux-lvm] Removing a very old physical drive
[not found] <7vgn6o$494l6v@smtpout.karoo.kcom.com>
@ 2009-10-27 0:20 ` malahal
0 siblings, 0 replies; 9+ messages in thread
From: malahal @ 2009-10-27 0:20 UTC (permalink / raw)
To: postmaster; +Cc: linux-lvm
postmaster@bottlehall.eclipse.co.uk [postmaster@bottlehall.eclipse.co.uk] wrote:
> Fixed it!
>
> Rummaging around with dmsetup, I discovered that lvm wasn't making the
> pvmove lv active - it was suspended. It seems everything trying to run
> against it was waiting for it to unsuspend. Using dmsetup to resume it
> then meant that pvmove --abort worked and then a normal re-boot followed.
That is good to know!
Thanks, Malahal.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-10-27 0:20 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <7vgn6o$494l6v@smtpout.karoo.kcom.com>
2009-10-27 0:20 ` [linux-lvm] Removing a very old physical drive malahal
2009-10-26 8:59 Nicholas Robinson
2009-10-26 13:09 ` Matthew Gillen
2009-10-26 16:10 ` malahal
2009-10-26 19:29 ` Nicholas Robinson
2009-10-26 19:54 ` malahal
2009-10-26 20:33 ` Nicholas Robinson
2009-10-26 21:17 ` malahal
2009-10-26 18:32 ` Ray Morris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).