0

On a VM-ware insatnce, I am trying to install grub2 bootloader onto a brand new SCSI disk. I want to install it onto the disk's MBR.

I run sudo grub-install /dev/sda and got the error "unable to identify a filesystem in hotdisk//dev/sda; safety check can't be performed."

Questions

  1. What am I doing wrong?
  2. And why is there a need for a filesystem? I thought since I am trying to install it to the MBR (not a partition's boot record), it should not care about filesystem/partition. I should just simply write the bootloader to the first 512 bytes of the disk.
1

1 Answer 1

0

The 512 bytes available in the MBR is nowhere near sufficient for all the functionality of Grub2. The code in the MBR (boot.img) loads the next part (core.img) which is typically stored in the disk sectors between the MBR and the first partition. core.img contains code that understands the filesystem and can access /boot/grub, which contains the rest of Grub2, including code for menu handling and loading the kernel image. /boot/grub is a normal directory on a file system, and this file system must exist to be able to install Grub2.

3
  • On a MBR partitioned disk, it is normally possible to embed the core.img in the empty space between the actual MBR block and the beginning of the first partition. In old DOS-era partitioning rules, a partition would begin at the start of a C/H/S track, so the space after the MBR to the end of the first track would be empty. On modern systems, the accepted rule is to align partitions to multiples of 1 MiB, so there would be even more space after the MBR and before the first partition. But on an unpartitioned disk, the start location of the first partion will be unknown.
    – telcoM
    Commented Mar 17, 2019 at 10:38
  • I wish we could all forget about all this nonsense and move on to UEFI or at least GPT. Intel pledged in 2017 that they will end support all legacy BIOS support by 2020. Commented Mar 17, 2019 at 11:18
  • What I did was 1) create a partition on the drive with fdisk 2) grub-install again and it works... Maybe it was because of what @telcoM says "But on an unpartitioned disk, the start location of the first partion will be unknown"
    – Tran Triet
    Commented Mar 18, 2019 at 13:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .