Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Correct Method

1) Boot from the Live CD/ Live USB 2) Mount the desired disk partition/ volume under an appropriate mount point, say /mnt/sda1. # mount /dev/sda1 /mnt/sda1 # mount /dev/sda7 /mnt/sda1/boot sda1----rooot sda7----boot

Note: The mount point must be an existing directory in the file system. If the intended mount point is not present, create the directory with the name of the mount point.

3) Rebind (attach) the following directories under the file system on the attached device (disk partition). Most important is attaching /dev # mount -o bind /proc /mnt/sda1/proc/ # mount -o bind /dev /mnt/sda1/dev/ # mount -o bind /sys /mnt/sda1/sys After this step, /dev and /mnt/sda1/dev will be the same. 4) Change the root of the file system. # chroot /mnt/sda1 After this step, / refers to the earlier /mnt/sda1 (which is the mounted device /dev/sda1) Now all references will be relative to the changed root. 5. Install GRUB boot loader in the master boot record (MBR) of the first hard disk. [chroot]# grub-install /dev/sda Installation finished. No error reported. This is the contents of the device map /boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'. 6. After restarting the computer sudo update-grub exit This is all it takes.

Wrong Sequence :

Note: /dev after root will not have device information after chroot. # mount /dev/sda1 /mnt/sda1 # chroot /mnt/sda1/ [chroot]# grub-install /dev/sda /dev/sda: Not found or not a block device. [chroot]# exit exit This is why we need to rebind /dev to the mounted file system as given in step 3 above.

You might also like