Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

2 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
    
This does not answer the OPs question at all. –  Johan Mar 17 '13 at 8:15
add comment

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.