Tuesday, August 5, 2008

Mounting a disk formatted in FC6 on FC9

This is annoying enough that I have to geek out for a minute and write these instructions down.

I had Fedora Core 6 installed on a hard drive, which I used happily for a couple of years. I then bought a new hard drive, and installed Fedora Core 9 on it. I connected the original drive on as a slave drive so that I could pull over some custom configuration files over. The old hard disk was assigned /dev/hdc, so I tried:


root# mount -t auto /dev/sdc2 /asdf
mount: unknown filesystem type 'lvm2pv'


Well, crap! What is lvm2pv? I'm sure I formatted it as an ext3 filesystem, which is the default for most Linux distributions..... hmm.

A bit of Google searching turned up the answer, but it wasn't obvious how to do it in my case.


root# fdisk -l


Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00027ac4

Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 60801 488183220 8e Linux LVM

Disk /dev/sdb: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 1 36481 293033601 83 Linux

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00051754

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 13 104391 83 Linux
/dev/sdc2 14 60801 488279610 8e Linux LVM

Disk /dev/dm-0: 497.7 GB, 497779998720 bytes
255 heads, 63 sectors/track, 60518 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 2080 MB, 2080374784 bytes
255 heads, 63 sectors/track, 252 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30307800




...but, but, but, there's the hard disk, recognised right there! Hold it, what's a Linux LVM?


# pvdisplay /dev/sdc2
--- Physical volume ---
PV Name /dev/sdc2
VG Name VolGroup00
PV Size 465.66 GB / not usable 3.56 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 14901
Free PE 1
Allocated PE 14900
PV UUID 88qBvg-DSwX-hCr2-X0uU-O1Cq-rlR5-q7fJr9


Oh man, this is a harder problem than I thought.

It seems that both sda1 (my boot disk) and sdc2 (my old disk) have metadata that claim them to bve VolGroup00. Apparently you have to use a Live CD, reboot into that, and rename using LVM tools the second drive to VolGroup01. This should not be so hard, but "it's the wave of the future", damnit.

No comments: