I have a Linux derivative OS on a non-bootable hard drive. I'm currently using a LiveCD to help diagnose the issue; however, I mistakingly deleted the MBR in the process via testdisk.

Is there any way to recover the MBR? Is this the same difference as writing a bootloader to the disk, LILO in this case? Sorry for my lack of knowledge.

To do this I need to mount the hard drive, but I don't know the file system type of the disk.

enter image description here

UPDATE: I was able to restore the MBR with the LILO bootloader. I used blkid to list the filesystem types of the partitions and used fdisk -l to reference the Device Boot so I could mount the drive.

I then used:

mount -o dev /dev/hd(x) /mnt/hd chroot /mnt/hd lilo -v



As long as you have workable Linux system on the drive you can install bootloader and use it to boot the system. For example it can be GRUB. Lilo would work as well. After installation you will have to configure it and point out which kernel to boot and where it is. For that you need to know what partitions are on the hard drive and where is kernel.

First, see structure of the hard drive by doing fdisk -l

After that try to mount partitions with default settings. Hopefully Live CD system will be able to do that. If no, you will have to try to mount them manually.

Take a look at /etc/fstab on the Linux system on the hard drive. It may reveal filesystem and other useful data.

Could you post output of fdisk -l ?


Have you tried GParted?

It could help you to identify which filesystem is on your disk. Once you know the filesystem type, it will be easier to mount your partitions.

If you want to restore the bootloader, I advice you to install (or reinstall) grub:

grub-install /dev/sda

For the configuration of grub (grub.cfg), you should go to your distribution support page. Some linux distributions, like debian, have tools to generate automatically the grub menu/cfg.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.