Can't Boot After Installing CentOS 5.5 to USB Hard Drive
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Can't Boot After Installing CentOS 5.5 to USB Hard Drive
I have installed CentOS 5.5 x86_64 to an external 500GB USB hard drive, but it will not boot. I'm selecting the USB device from the BIOS to boot from it - I am using a Lenovo T420 laptop. It appears to start to boot - it displays "GRUB", but no list of OSs or anything else - it just stops with that one word on the screen.
During the disk partitioning phase of installation, I told it to install the GRUB on the USB drive (/dev/sdc) and to make it a primary partition. The CentOS installation completed successfully.
I did choose to install GRUB to the external drive, but I didn't see any options regarding creating a MBR. I have Windows installed on the internal drive, and I don't want to mess with the MBR on that disk.
I started up a VM with CentOS, and here is the output from 'fdisk -l':
Disk /dev/sdb: 500.1 GB, 500107861504 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 131 1052226 83 Linux
/dev/sdb2 132 60801 487331775 8e Linux LVM
I didn't see any options regarding creating a MBR.
Not creating an MBR but installing to the MBR OF THE EXTERNAL DISK. Each hard drive has a master boot record. Choosing to install to the external (or any) drive will usually give you three options: install to mbr, install to root partition, install to separate boot partition. The first option should boot the system. The second and third options won't unless you configure some other bootloader to boot them.
I've never used CentOS so I'm not sure what options you had. I believe CentOS still uses Grub Legacy but am not sure. You can find out by mounting sdb1 and navigating to the /boot/grub folder. If you have a grub.conf or menu.lst file there, you have Grub Legacy. If not, Grub2.
I would suggest you read the link below for installing bootloader on CentOS. I think you need to select Advanced Bootloader Config.
Yes, I was able to boot into Windows. I did eventually get this working. I post this high-level detail in case it might be useful to someone else.
I searched around some more and found some instructions for reinstalling GRUB:
1. Boot from install disc into 'rescue' mode
2. chroot /mnt/sysimage
3. grub-install /dev/sd[x] (where sd[x] is sdc in my case)
This got a little further down the road. GRUB would display the menu and let me pick options, but when I selected one, it would display the following error message:
Booting 'CentOS (2.6.18-194.el5xen)'
Filesystem type unknown, partition type 0x7
Error 17: Cannot mount selected partition
I looked at the /boot/grub/device.map file and it looked fine (hd0 was /dev/sda and hd1 was /dev/sdc).
As it turns out (and I don't quite understand this), it looks to me like the BIOS ordering of the drives didn't match what was in the device.map. I used 'fdisk' to examine the partition types on /dev/sda and /dev/sdc, and they were backward from what I expected - /dev/sda was the Linux disk and /dev/sdc was the internal Windows disk.
I edited the /boot/grub/grub.conf to change the "root (hd1,0)" references to "root (hd0,0)" for the Linux entries and vice versa for the "Other" entry (which I tweaked to boot Windows). The /boot/grub/menu.lst file is a symbolic link to grub.conf.
So now I have the following configuration, which is exactly what I wanted:
1. If the external USB drive is plugged in, it will boot from it and use the GRUB boot loader, from which I can boot into Linux or Windows.
2. If the external USB drive is not plugged in, it will boot into Windows on internal hard drive.
As it turns out (and I don't quite understand this), it looks to me like the BIOS ordering of the drives didn't match what was in the device.map.
You changed the order by selecting to boot from the external. What-ever is booted from becomes hd0.
In these situation it is better not to use a wrapper like grub-install, but the "native" grub commands. grub2 (despite its awkwardness) allows this to be worked around.