Skip to contentSkip to conversation

Can I dd one disc of a lv

linux-lvm Tobias Wagener 3 participants 8 messages Nov 6, 2003

lore
Share & tools
lore
#0 lore raw

Hi,

I have 3 discs, two 180 GB and one 200 GB drive, every drive is one Partion with a one PV which builds a 560 GB VG from that I get a 500 GB LV.

Now the 200 GB hdd is faulty. But I have no change to extend the LV, because the Max LV Size is 512 GB. So pvmove isn't possible. But I have another 200 GB Drive in my system.

Now the question: Can I "dd" the faulty 200 GB drive to the new 200 GB drive? And if, how? Does "dd if=/dev/hde1 of=/dev/hdf1" the job, or what have I to do?

Greetings Tobias

#1 lore raw
Quoted 3 lines · Tobias Wagener

Now the question: Can I "dd" the faulty 200 GB drive to the new 200 GB drive? And if, how? Does "dd if=/dev/hde1 of=/dev/hdf1" the job, or what have I to do?

Heinz told me:
"You need to dd starting from the first physical extent (use pvdata -PP on the old one and look for pe_on_disk.base) to the same offset on the new disk (skip and seek dd option) and you want dd to continue after read errors (noerror option)."

Also, I was recently told about the dd_rescue utility, but I haven't had the misfortune/opportunity to try that one yet.

/ Rickard Olsson,IT-Konsult/
/ Telefon: +46 70 635 01 42/
/ http://www.webhackande.se/

#7 lore raw
In reply to Tobias Wagener
Quoted 7 lines

Hi,

I have 3 discs, two 180 GB and one 200 GB drive, every drive is one Partion with a one PV which builds a 560 GB VG from that I get a 500 GB LV.

Quoted 7 lines

Now the 200 GB hdd is faulty. But I have no change to extend the LV, because the Max LV Size is 512 GB. So pvmove isn't possible. But I have another 200 GB Drive in my system.

Now the question: Can I "dd" the faulty 200 GB drive to the new 200 GB drive? And if, how? Does "dd if=/dev/hde1 of=/dev/hdf1" the job, or what have I to do?

Use dd_rescue instead. That tool is developed to be better than dd for copying data off bad drives. dd_rescue can also walk backwards. If your system freezes when reaching bad blocks then you can write down the block and tell dd_rescue to copy the disk backwards up to that block.

Quoted 9 lines

Greetings Tobias

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#2 lore raw
In reply to Rickard Olsson

Hi,

OK, currently dd (or better dd_rescue) is at work. What have I to do after the dd?

vgexport the VG, and then vgimport with the new device? Or do I use a "vgcfgrestore" and "vgcfgbackup" also?

Greetings Tobias

Quoted 25 lines · Rickard Olsson
Quoted 3 lines · Tobias Wagener

Now the question: Can I "dd" the faulty 200 GB drive to the new 200 GB drive? And if, how? Does "dd if=/dev/hde1 of=/dev/hdf1" the job, or what have I to do?

Heinz told me:
"You need to dd starting from the first physical extent (use pvdata -PP on the old one and look for pe_on_disk.base) to the same offset on the new disk (skip and seek dd option) and you want dd to continue after read errors (noerror option)."

Also, I was recently told about the dd_rescue utility, but I haven't had the misfortune/opportunity to try that one yet.

/ Rickard Olsson,IT-Konsult/
/ Telefon: +46 70 635 01 42/
/ http://www.webhackande.se/

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#3 lore raw
Quoted 2 lines · Tobias Wagener

vgexport the VG, and then vgimport with the new device? Or do I use a "vgcfgrestore" and "vgcfgbackup" also?

vgexport/import shouldn't be needed. pvcreate the new disk, vgcfgrestore, vgscan and vgchange -ay.

/ Rickard Olsson,IT-Konsult/
/ Telefon: +46 70 635 01 42/
/ http://www.webhackande.se/

#4 lore raw

After I switched the new disc to the "hdX" of the old one? Or in which way knows the lvm to use the new disc?

Quoted 18 lines · Rickard Olsson
Quoted 2 lines · Tobias Wagener

vgexport the VG, and then vgimport with the new device? Or do I use a "vgcfgrestore" and "vgcfgbackup" also?

vgexport/import shouldn't be needed. pvcreate the new disk, vgcfgrestore, vgscan and vgchange -ay.

/ Rickard Olsson,IT-Konsult/
/ Telefon: +46 70 635 01 42/
/ http://www.webhackande.se/

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#5 lore raw
Quoted 1 line · Tobias Wagener

After I switched the new disc to the "hdX" of the old one?

Yes. You can remove the old disk after the dd_rescue is done.

Quoted 1 line

Or in which way knows the lvm to use the new disc?

I believe vgcfgrestore does that. If you don't want to (or can't) move the disks around, check the -o option.

If you want to, you can use the LVM2 pvcreate instead, to create the new disk with the PVUUID from the old one. pvdisplay /dev/olddisk tells you the ID.

/ Rickard Olsson,IT-Konsult/
/ Telefon: +46 70 635 01 42/
/ http://www.webhackande.se/

#6 lore raw
In reply to Tobias Wagener
Quoted 5 lines

Hi,

OK, currently dd (or better dd_rescue) is at work. What have I to do after the dd?

Nothing. The drives will be identical to LVM so you should remove the faulty drive and then everything should be normal. :) Do not run any restore/backup commands.

Quoted 38 lines

vgexport the VG, and then vgimport with the new device? Or do I use a "vgcfgrestore" and "vgcfgbackup" also?

Greetings Tobias

Quoted 20 lines · Rickard Olsson
Quoted 3 lines · Tobias Wagener

Now the question: Can I "dd" the faulty 200 GB drive to the new 200 GB drive? And if, how? Does "dd if=/dev/hde1 of=/dev/hdf1" the job, or what have I to do?

Heinz told me:
"You need to dd starting from the first physical extent (use pvdata -PP on the old one and look for pe_on_disk.base) to the same offset on the new disk (skip and seek dd option) and you want dd to continue after read errors (noerror option)."

Also, I was recently told about the dd_rescue utility, but I haven't had the misfortune/opportunity to try that one yet.

/ Rickard Olsson,IT-Konsult/
/ Telefon: +46 70 635 01 42/
/ http://www.webhackande.se/

Quoted 5 lines

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/