![]() ![]() ![]() preserve all attributes (timestamp, owner, permission).Copy the data from the old boot partition to the new one: cp -afv /mnt/oldBoot /mnt/newBoot.Using a root console in GParted, mount the old boot partition (let's say it's /dev/sda1) and the new partition ( /dev/sdb1): mount /dev/sda1 /mnt/oldBoot & mount /dev/sdb1 /mnt/newBoot.Using the GParted live CD, create the boot and root partition on the new drive.This is how I moved a Debian installation consisting of a boot partition /boot and a root partition / to a new drive and made it bootable using GNU GRUB: Clone partitions You are meant to use -boot-directory and refer to the actual boot directory, so this would give you: grub-install /dev/sdb -skip-fs-probe -boot-directory=/media/new_drive/boot Reading man grub-install and googling I see that -root-directory is not really meant to be used for grub2 versions 1.99++, though it does work in my experience. Grub2 installs in sector 0 of the whole disk drive, and this 'stub' is what runs at boot time, but it needs to know whereabouts on the disk it should install the files for the next stage of booting - this is what the -root-directory parameter is for. ![]() I learned the hard way.Īnd as pointed out (kudos), you should specify a drive not a partition. This isn't a problem if you are inside Centos but with SystemRecover圜D both versions are available and so you have to use grub2-install. ![]() I think that without this parameter grub-install, instead of doing what you tell it, thinks it is cleverer than you, and may do something different.Īnother thing is to be sure you are using the right grub-install (i.e. I'm not a grub2 expert (sorry) but try adding -skip-fs-probe to your grub-install line, I have found this prevents creation of /boot/grub/device.map which can cause booting to a grub prompt. Why does grub-install /dev/sdb1 not modify the MBR of sdb1? Is this not the right way to install GRUB on new drive? It seems the MBR is not updated after grub-install, but I can see GRUB installed under /boot/grub on the new drive.īut the worst thing is, it has corrupted my existing CentOS GRUB: The CentOS VM hangs showing a black screen with the only text being GRUB.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |