Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Thanks!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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 ?

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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