I have a virtual box running with CentOS,.
I am attachinghave attached a new virtual disk to the existing centosCentOS VM and I'm now trying to install grubGRUB on this newly attached virtual disk.
Later, I will bring-up up a second VM with a newly prepared bootable hard-disk disk with a custom root file-systemfilesystem and kernel.
I have tried the following steps,:
- Attached a new virtual disk to the existing working centosCentOS machine.
- Created a new partition with
fdisk /dev/sdb. While portioningpartitioning, givenI chose the options primary partition,partition partition number 1 and other options default options. - Formatted the disk with
mkfs.ext3 /dev/sdb1. - Mounted the disk to
/media/new_drive. - Installed grubGRUB
grub-install /dev/sdb1 --root-directory=/media/new_drive/.
After this, the second VM with the newly prepared hard disk didn't come-up withboot; I got the error: could not read from the boot medium ie. It seems the MBR is not updated after grub-installgrub-install, but I can see grubGRUB installed under /boot/grub inon the new drive.
But
But the worst thing is, it has corrupted my existing CentOS grub,GRUB: The CentOS VM hangs withshowing a black screen with the only text being GRUB.
Why grub-installdoes /dev/sdb1 isgrub-install /dev/sdb1 not modifyingmodify the MBR of sdb1? Is this not the right way to install grubGRUB on new drive?