0

I had lost my boot partition. This happened quite frequently. I used to boot for recovery and rewrite the existing partioning. Last time I missed the correct option and installed LVM by mistake. Is it possible to get the previous partioning table back?

larsks
  • 43,623
  • 14
  • 121
  • 180

1 Answers1

0

You just need to change the partition type with fdisk. It was created as LVMwith the same start and end cylinders, right?

To begin modifying the partition table. (Replace the below block device if applicable.)

# fdisk /dev/sda

Then, set the type for the applicable partition number. (Probably #1.)

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): 83
Changed system type of partition 1 to 83 (Linux)      
Command (m for help): w

Reboot.

If the file system hasn't been clobbered every thing should be intact. Otherwise, you may need to restore the contents of the partition from backup.

Also, count me in for explanation on why this was a problem in the first place.

Aaron Copley
  • 12,525
  • 5
  • 47
  • 68
  • I had a f13 partioned as: /dev/sda1 - 300M boot /dev/sda2 - 50G root /dev/sda3 - swap /dev/sda4 - home. And I installed lvm by my mistake. How to go back my previous partions? Thank you. – Marcio Carneiro Mar 09 '12 at 19:44