1

i use a debian box with a MD-RAID1 with two drives and a LVM. My problem is that, obviously, i#m only able to boot from the first drive, but not the second.

root@myhost:/home/myuser# fdisk -l
Disk /dev/sda: 447,1 GiB, 480103981056 bytes, 937703088 sectors
Units: sectors of 1 * 512 = 512 bytes                     
Sector size (logical/physical): 512 bytes / 4096 bytes                     
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xdd0f9cf2                                      

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1  *     2048 937701375 937699328 447,1G fd Linux raid autodetect

Disk /dev/sdb: 447,1 GiB, 480103981056 bytes, 937703088 sectors
Units: sectors of 1 * 512 = 512 bytes                     
Sector size (logical/physical): 512 bytes / 4096 bytes                     
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x30a70a91                                                       

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1        2048 937701375 937699328 447,1G fd Linux raid autodetect

Disk /dev/md0: 447 GiB, 479967838208 bytes, 937437184 sectors                          
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x91da7a92

Device     Boot  Start       End   Sectors   Size Id Type
/dev/md0p1          63    498014    497952 243,1M 83 Linux
/dev/md0p2      498076 937424879 936926804 446,8G  5 Extended
/dev/md0p5      498078 937424879 936926802 446,8G 8e Linux LVM

a boot record is available only on the first drive

root@mybox:/home/myuser# dd if=/dev/sda bs=512 count=1 | xxd | grep -i grub
1+0 Datensätze ein
1+0 Datensätze aus
512 Bytes kopiert, 6,1662e-05 s, 8,3 MB/s
00000180: 7de8 2e00 cd18 ebfe 4752 5542 2000 4765  }.......GRUB .Ge
root@Iteanova018:/home/iteanova# dd if=/dev/sdb bs=512 count=1 | xxd | grep -i grub
1+0 Datensätze ein
1+0 Datensätze aus
512 Bytes kopiert, 4,4592e-05 s, 11,5 MB/s

i then copied the boot record to second drive

dd if=/dev/sda of=/dev/sdb bs=446 count=1

but was still not able to boot from the second drive.

The reason for that is that i want to replace the drives witrh bigger ones, which is no problem with the second drive, but with the first cause as soon as i remove the first drive, i gopt no boot any more.

How can i get both drives to boot the system?

1
  • 1
    Run grub-install /dev/sda and grub-install /dev/sdb. Don't copy boot code by hand; grub places something also into sectors that follow the MBR or into special biosgrub partition, so just your dd is not sufficient. Oh, and in case you use EFI, you need to have two separate ESP (on each disk) and setup booting from either one with efibootmgr. I've explained that somewhere here or on unix stackexchange, too lazy to search for it, please look it up yourself, please. May 14, 2023 at 16:08

0

You must log in to answer this question.

Browse other questions tagged .