Just had a bit of a mission recovering data from my old hard drive and in the true spirit of open source and community support, I thought I'd publish the details here. Hopefully it gets indexed by google and someone having similar difficulties will find some answers or help from my experiences.
Data Recovery: Old Linux Drive into USB housing
===============================================
So my old computer gives up the ghost and I get a brand spanking new one. What to do about the data sitting on the old hard drive?
What was that? Yes, of course I had backups. And they worked. But one thing.... the only thing not in the
backup were my photos from our skiing trip. Downloaded seconds before the blasted thing crashed.
AFAIK the hard drive (and photos) were fine. So I thought I'd just plug it into my new computer and get the data off.
Except....
New computer is all SATA and old is IDE. No IDE connector!
So I order one of those external bays - you know, you for backups AND I can get my data off. Right?
Wrong- not so easy.
I plug the sucker in and FC7 automounts it... but it only mounts the boot partition. I forgot the thing was partitioned.
Uh oh.
So I unmount (using umount) that one from the command line and attempt to mount the correct (data) partition.
How do I know what it is? Well, running fdsik -l gives:
>>>>
Disk /dev/sdb: 80.0 GB, 80025279488 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00074b79
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 9729 78043770 8e Linux LVM
>>>>
Aha! Then, /dev/sdb2 is what I'm after.
So I try
#mount /dev/sdb2 /media/main
no dice. I think it asked for an fstype at the time and I couldn't supply one that worked.
Turned out the problem is that the second partition above is not just Linux (ie ext2) but Linux LVM. This means it is a logical volume story.
So, the journey begins:
First, we run pvs to check out the physical volumes.
first time I ran pvs, the USB drive didn't show, so:
Ran pvs on /dev/sdb2
and it showed the good stuff:
>>>>>>
PV VG Fmt Attr PSize PFree
/dev/sdb2 VolGroup00 lvm2 a- 74.41G 32.00M
>>>>>
but, next time I ran pvs with no arguments:
>>>>>
WARNING: Duplicate VG name VolGroup00: Existing ynE4fb-efC3-Yqz2-gY9u-72rp-rEUf-N7iJgs (created here) takes precedence over 775r5u-IFr7-8Hlf-wMIS-ziFX-EBjW-YR3qVb
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 232.62G 32.00M
/dev/sdb2 VolGroup00 lvm2 a- 74.41G 32.00M
>>>>>>
uh-oh: problems, they have the same VG name. But the gobbledegook after "Existing" in the line above is the UUID so we can use that and vgrename to rename the offensive (2nd) one to something better so...
with much trepidation:
#vgrename 775r5u-IFr7-8Hlf-wMIS-ziFX-EBjW-YR3qVb VolGroup00_tmp
>>>>>>>
WARNING: Duplicate VG name VolGroup00: Existing ynE4fb-efC3-Yqz2-gY9u-72rp-rEUf-N7iJgs (created here) takes precedence over 775r5u-IFr7-8Hlf-wMIS-ziFX-EBjW-YR3qVb
Volume group "VolGroup00" successfully renamed to "VolGroup00_tmp"
>>>>>
OK, seemed succesful.
Now when we pvs, we get:
>>>>>>
/dev/sda2 VolGroup00 lvm2 a- 232.62G 32.00M
/dev/sdb2 VolGroup00_tmp lvm2 a- 74.41G 32.00M
>>>>>>
phew. So far so good. Now we need to mount the bugger:
We try
#mount /dev/VolGroup00_tmp/LogVol00 /media/main
but somehow keep mounting the existing (Volgroup00) LogVol00 to this point. Not sure why.
So I decide to rename the logical volume (LogVol00) under the volume group VolGroup00_tmp to avoid lv naming confusion:
#lvrename /dev/VolGroup00_tmp/LogVol00 /dev/VolGroup00_tmp/newlv
>>>>>
Renamed "LogVol00" to "newlv" in volume group "VolGroup00_tmp"
>>>>>
OK, seems succesful.
Try to mount and it can't find /dev/VolGroup00_tmp/newlv. But I've just created it? What's up?
now run lvdisplay and you get, among other things:
>>>>>>
LV Name /dev/VolGroup00_tmp/newlv
VG Name VolGroup00_tmp
LV UUID BE6gLt-cTZD-1JKL-ADy5-ksLX-2Obv-gSB1Pm
LV Write Access read/write
LV Status NOT available
LV Size 73.62 GB
Current LE 2356
Segments 1
Allocation inherit
Read ahead sectors 0
>>>>>>
NOT available??? apparently you have to run vgchange -a y /dev/VolGroup00_tmp
and.....
2 logical volume(s) in volume group "VolGroup00_tmp" now active
So....
and now we can mount the bugger
mount /dev/VolGroup00_tmp/newlv /media/main/
Success!!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment