GrubOnRemovableExternalHardDiskNotBooting

From Super Grub Disk Wiki
Jump to navigationJump to search

I install Linux in a external hard disk but even with it plugged it does not boot.

Other Titles

I get error 21 after installing Linux in a external hard disk.

Introduction

If you install Linux into a external hard disk and when rebooting, even with the hard disk connected it does not boot there might be two problems.

  1. menu.lst is not generated ok.
  2. BIOS does not provide access to the external hard disk.

This article covers the BIOS does not provide access to the external hard disk problem and some tricks that we can use in order to make our Linux bootable.

FAT32 Rescue partition method

Introduction

Some hard disks (internal ones) have a recovery partition that it is in the FAT32 filesystem. We can use this partition to install grub and Linux kernel there. Once grub and Linux kernel boot from the internal hard disk they can boot themselves the external hard disk and continue to boot.

Example specs

This example is based in a Ubuntu distribution that was installed into a external hard disk:

Internal hard disk partitions were:

  1. sda1 NTFS 10 GB Windows XP
  2. sda2 FAT32 2 GB Recovery partitions.

External hard disk partitions were (after the initial installation):

  1. sdb1 EXT3 20 GB Linux /
  2. sdb2 SWAP 5 GB


If you are not very sure about how to adapt these instruction to your own situation please feel free to ask in the Super Grub Disk forum (remember to post your sudo sfdisk -lu output.

Commands to install Grub into the rescue partition

  1. Application
  2. System
  3. Terminal
ubuntu@ubuntu:~$ sudo su
root@ubuntu:/home/ubuntu#
root@ubuntu:/home/ubuntu# mkdir /mnt/fat32
root@ubuntu:/home/ubuntu# mkdir /mnt/externalhd
root@ubuntu:/home/ubuntu# mount -t vfat /dev/sda2 /mnt/fat32
root@ubuntu:/home/ubuntu# mount -t ext3 /dev/sdb1 /mnt/externalhd
root@ubuntu:/home/ubuntu# cp -r /mnt/externalhd/boot /mnt/fat32
root@ubuntu:/home/ubuntu# rm -rf /mnt/fat32/grub/
root@ubuntu:/home/ubuntu# gedit /mnt/fat32/boot/grub/menu.lst

Here we need to Find "(hd1,0)" and Replace it with "(hd0,1)"

root@ubuntu:/home/ubuntu# umount /mnt/fat32
root@ubuntu:/home/ubuntu# umount /mnt/externalhd
root@ubuntu:/home/ubuntu# sync

After rebooting we boot into Super Grub Disk and fix the boot of Linux.

Grub boots

We should be able to log into Ubuntu and have Grub at boot. Even if our external hard disk is unplugged the GRUB will be there because it is found in the internal hard disk.