1

Two of my disks have a boot label. How can I find from which disk my system (Debian Sid) booting? How can I find whether the boot sector is in the Master Boot Sector or in a Volume Boot Sector (at the beginning of the first disk partition)? How can I move Boot Sectors from one disk to another?

Bernhard
  • 12,272
erwin
  • 11
  • As far as I know on Linux this is not easy to do. On Solaris you can find out which device was originally used to read the kernel, even if it got mounted over afterwards. On Linux I believe you have to trust that the first WORKING disk specified as a bootable device in the BIOS boot list is the one from which the MBR was read, which points to a location where a boot loader resides, which is loaded and executed by the BIOS to load the kernel. – Johan Mar 19 '13 at 12:25

2 Answers2

1

You can find the canonical name of the block device through the uuid by investigating the symbolic link at /dev/disk/by-uuid .

ls -l /dev/disk/by-uuid

This should help determine whether you are booting on the old drive or the new one.

umeboshi
  • 306
0

fdisk -l /dev/sd{a,b} shows you which of your partition has bootable flag. With fdisk you can also mark your partition as bootable by pressing a. You can examine MBR data by typing dd if=/dev/sda of=/tmp/mbr bs=512 count=1; hexdump -C /tmp/mbr. grub-install is used for setting boot records to disk.

I recommend you to create a virtual machine to make some practice before.

dchirikov
  • 3,888