LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 10-10-2011, 12:14 PM   #1
michaelarice
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Rep: Reputation: Disabled
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.

Any ideas how I can get it to boot?

Thanks.
 
Old 10-10-2011, 12:47 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,534

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
Did you select to install Grub to the master boot record of the external drive?

You can use any Linux Live CD, open a terminal, log in as root (type: su) usually no password is needed then type the following at the prompt:

Quote:
fdisk -l
That's a lower case Letter L in the command. Post the output here. Have the external attached when you run the command.
 
Old 10-10-2011, 01:26 PM   #3
michaelarice
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-10-2011, 03:41 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,534

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
Quote:
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.

http://www.centos.org/docs/5/html/5....ootloader.html

Have you booted into windows since completing the CentOS install? That works?
 
Old 10-11-2011, 09:22 AM   #5
michaelarice
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
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)'
root (hd1,0)
Filesystem type unknown, partition type 0x7
kernel /xen.gz-2.6.18-194.el5
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.

Thanks for the help and the pointers.
 
Old 10-11-2011, 06:38 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Quote:
Originally Posted by michaelarice View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] CentOS DVD hangs and won't boot from usb drive. deadalus.globalnode Linux - Hardware 9 09-27-2010 02:00 PM
USB hard drive as an HDD boot drive jonp Linux - Newbie 5 03-07-2010 01:28 PM
Installing Debian on USB Hard Drive/USB Jump Drive kushalkoolwal Debian 10 02-26-2009 01:46 PM
can't boot from usb: how to boot linux from ext. hard drive? bernhardtjeff Linux - Newbie 5 07-07-2006 01:42 AM
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration