[CentOS] OT: Fortunate clueless dd chum - lvm recovery

Chan Chung Hang Christopher christopher.chan at bradbury.edu.hk
Fri Aug 14 09:00:41 UTC 2009


>
> First of all, I would dd a copy of the whole drive off to another drive, so you can have a few goes at this.
>
> How do you know only those bits where lost?
>   

The dd command zeros the first 64 sectors, that is, the mbr and then the 
next 63 sectors which would the bootsector of the first partition and 
the next 62 sectors following that. The first partition on both disks 
belong to the md device that is the basis for the physical volume for 
the system. And if it had not, it would have belonged to the md device 
for the /boot partition which is not a great loss. Default Redhat layout 
this.

The box is still live and I am glad he was not clueless enough to say 
yes to the mkefs2 command he was following from whatever howto he had 
been looking at. It looks like the lvm survived having the first 62 
sectors being zeroed. Apparently lvm uses the first 255 sectors/blocks 
for lvm config data. No alarms/warnings in the logs. Certainly no panics 
otherwise I would not even be able to get in.

I get to learn something new at his expense, (which is now just a scare) 
nice successor eh? :-D

Absolutely zero data loss. What can I say?



More information about the CentOS mailing list