dual-boot messed up partition table?
Greetings
Being an advocate for LVM, I was called upon to help "fix things", and I soon realized I'm in over my head on this one. User has already Opensuse (w/LVM) running and tried to install Windows on a unused hard drive as dual-boot. Install failed and LVM disappeared from boot. The system now just partly boots. Booting fails and stops when VG is not found and three LVs are not mounted. There is one VG, vg00, on one PV with three LVs. System has three hard drives. I suspect the failed installation messed up partitioning badly. Such that a /dev/sda4 partition is missing. (System is temporarily running on liveCD) Alas this is a very poorly documented system. Backup is way outdated. User accepts the risk of loosing all data. But thinks it's worth a try to exploit any chances of getting any data off the disk... Here's the fdisk print out. Code:
$ sudo fdisk -l Here's the LVM configuration (/etc/LVM) Code:
mint@mint ~ $ sudo ls -lR /mnt/opensuse/etc/lvm Code:
mint@mint ~ $ sudo cat /mnt/opensuse/etc/lvm/backup/vg00 Code:
mint@mint ~ $ sudo cat /mnt/opensuse/etc/fstab I can see there is a sector number in the archived configuration file (/etc/lvm/backup/vg00). To restore the missing partition, can I use the sector number listed in "/etc/lvm/backup/vg00"? If so how? BTW: I spent some time to figure out which category to post this. Not sure if this one is the right one. |
It's probably just a matter of re-creating sda4. Please post the output from "fdisk -lu /dev/sda" to show the partitioning in exact sector units.
(Since this is very much Linux related, I've asked that it be moved to a more appropriate forum.) |
Code:
mint ~ # fdisk -lu /dev/sda Code:
mint ~ # sfdisk -uS -l /dev/sda |
The space following partition 4 on the disk (156301488-29511679 = 126789809 sectors) is just a little larger than the size of pv0 (dev_size = 126789632). I was hoping to see an exact match, but I would try running "fdisk -u /dev/sda" and creating, in sector address mode, a partition starting right after sda3 (sector 29511680) and extending to the end of the disk. (Note that creating/deleting primary partitions with fdisk is 100% safe. The only writes that occur are to the partition table in the MBR.) Set the partition type to 8e "Linux LVM" (not that it really matters), and see if then running pvscan doesn't make your volume group reappear.
Failing that, I would download one of the live CDs that includes testdisk (my own favorite is System Rescue CD) and see if testdisk can locate your LVM Physical Volume. |
Excellent. I will try that later today. I suspect the reason for no exact match in sectors is due to rounding of numbers. It might me that the partition is created using rounded GigaBytes.
I've used testdisk some time ago for fixing Grub/MBR. If it comes to recovering partitions I hope I can get some pointers? Should I then continue this thread or start a new? |
If you have questions about testdisk in general, it's probably best to start a new thread. For details about solving this particular problem, keep it here to keep the thread together. My own experience with testdisk is very limited as I've never had to use it for a real problem, but it looks like a fair number of people are following this thread so you'll probably get some answers right here.
|
Got it! Here's the log
Code:
mint ~ # fdisk -u /dev/sda The VG was found, the lV's was found (and fsck-ed; no bugs) and mount. User is extremely happy. Thanx rknichols |
All times are GMT -5. The time now is 11:30 AM. |