I attached the 80 GB external USB drive I wanted to use to a Windows system that already had two internal IDE drives in it. I didn't want those modified at all, however.
To prevent the CentOS installation process from seeing those drives, I went into the system's BIOS and configured the BIOS so the two drives were listed as "not detected". One of the drives was the primary master and the other was the secondary slave. After modifying the BIOS settings, I then booted from the CentOS 5.1 Live CD.
When I booted the system from the LiveCD, I chose the option to install in graphical mode by hitting Enter. I skipped the test of the DVD I used as the LiveCD, since I had tested it previously.
Even though I had told the BIOS that the two internal drives were "not detected", CentOS saw them. It listed all 3 drives and asked me about which one I wanted to use for the installation.
|sda||76317 MB||HTS5410R 0G9AT00|
Linux identifies IDE drives with an "hd" designator, so
the primary master was
hda. There was no primary
slave drive, so there was no
hdb drive listed.
hdc drive was a DVD writer, so it wasn't shown.
hdd drive was the secondary slave. Linux identifies
SATA and USB
drives with "sd", so the external USB drive was listed
I selected the
sda drive for the installation
by checking it. I left the other two drives unchecked. When I
started the partitioning process, I saw the following error:
Could not allocate requested partitions. Partitioning failed. Could not allocate partitions as primary partitions.
Not enough space left to create partition for /boot.
I realized the problem was due to the drive already being
partitioned, so I needed to delete the existing partition.
I hit Ctrl-Alt-Del to switch to a second terminal window.
I then ran
fdisk and checked the partition on the
external USB drive, which is identified as
I then deleted the partition, wrote the change to disk, and exited
from the shell.
sh-3# fdisk /dev/sda The number of cylinders for this disk is set to 9729. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = 80 cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 1 9729 78148161 7 HPFS/NTFS Command (m for help): d Selected partition 1 Command (m for help): p Disk /dev/sda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = 80 cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System Command (m for help): w The partition table has been altered! Calling iotcl() to re-read partition table. Syncing disks. sh-3.1# exit logout
I then hit Ctrl-Alt-F6 to return to the graphical
installation window. I then clicked on the Next button
again to create a default partition layout on
Again, I was warned about loss of data on the drive:
You have chosen to remove all Linux partitions
(and ALL DATA on them) on the following drives:
Are you sure you want to do this?
I chose "Yes".
The next screen showed the partition layout on all 3 drives.
format column was checked only for /dev/sda.
The following was shown for that drive:
I then clicked on the Next button where I saw two options:
The GRUB boot loader will be installed on /dev/hda.
No boot loader will be installed.
You can configure the boot loader to boot other operating systems. It will allow you to select an operating system to boot from the list. To add additional operating systems, which are not automatically detected, click 'Add.' To change the operating system boted by defaut, select 'Default' by the desired operating system.
GRUB stands for "GRand Unified Boot Loader". A bootloader is loaded from the Master Boot Record (MBR) on a hard disk. It is the first software that runs after the Basic Input Output System (BIOS) is loaded into memory. GRUB will load the linux kernel, which starts the boot process for Linux. For further information on GRUB see Getting Started with GRUB.
Since I didn't want any changes to the existing internal hard
drives in the system, one of which was
chose the option "No boot loader will be installed." I then
clicked on the Next button.
At the next screen, I chose to use DHCP for the network settings, so just clicked on Next and then went through the other configuration options. Prior to the installation commencing, I saw the following:
A complete log of the installation can be found in the file
/root/install.log' after rebooting your system.
A kickstart file containing the installation options selected can be found in the file 'root'anaconda-ks.cfg' after rebooting your system.
When the installation completed, the LiveCD was ejected. When the system rebooted, I went into the BIOS, which was an American Megatrends, Inc. (AMI) v02.53 BIOS, again to verify the system was configured to try booting from an external USB drive. The BIOS showed the following for the boot device priority:
Boot Device Priority
1st Boot Device [SM-Memorex DVD16+/] 2nd Boot Device [Removable Dev] 3rd Boot Device [HTS54108 0G9AT00]
The system was configured to attempt booting from the USB drive, which is model number HTS54108 0G9AT00, but I received a "Missing operating system" message when I attempted to boot from it.
I booted from the LiveCD again and typed
and hit Enter at the
boot: prompt. After
prompts regarding network support, I saw the following:
I chose the "Continue" option rather than the "Read-Only" or "Skip" options. I then saw the following:
I hit Enter to get a shell. I then entered
chroot /mnt/sysimage. I then
issued the command
sh-3# grub-install /dev/sda Probing devices to guess BIOS drives. This may take a long time. 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'. (fd0) /dev/fd0 (hd0) /dev/hda (hd1) /dev/hdd (hd2) /dev/sda sh-3.1#
When I entered the command
cd /boot/grub, I then
saw 14 files there where only
splash.xpm.gz had been
there previously. One of those was
hd2 lines shown
I checked the
/boot directory and saw the following,
along with other files.
I then typed
reboot and removed
the DVD as the system started to boot. I then saw the following
when the system rebooted:
GNU GRUB version 0.97 (639K lower / 1047232K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.] grub>
I entered the GRUB commands to load the Linux kernel and boot the system.
grub> root (hd0,0) Filesystem type is ext2fs, partition type 0x83 grub> kernel /vmlinuz-2.6.18-53.el5 root=/dev/sda1 [Linux-bzImage, setup=0x1e00, size=0x1b3634] grub> boot ... VFS: Cannot open root device "sda1" or unknown-block(0,0) Please append a correct "root=" boot option Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
When I tried
root (hd2,0) before trying
root (hd0,0), I saw the message
Error 21: Selected disk does not exist. Note:
you can type
kernel /vmlinuz and hit Tab
to have the rest of the vmlinuz filename completed automatically
Since the system was crashing and none of the options I tried
root= with the
kernel command worked.
I went back into the BIOS and
configured it to detect the two internal drives again, thinking that
might be causing the confusion, since I now had to use
(hd0,0) even though the
file on the USB drive had the following:
(fd0) /dev/fd0 (hd0) /dev/hda (hd1) /dev/hdd (hd2) /dev/sda
I also specified the hard disk drive priority to have the external USB drive as the first hard drive to check. In the version of the AMI BIOS on the system I was using, there is a Hard Disk Drives option under Boot to specify the priority for using hard disk drives to boot [Note: I noticed, if I removed the external USB drive and then plugged it in again later, I had to move it to the 1st Drive spot in the list again, since it would be listed last by default].
I then saved the BIOS settings and rebooted. I then tried
init command, since I found a comment
Grub from the Ground Up, that adding one could
sometimes help when a system would display a "kernel panic"
message, but that didn't help.
GNU GRUB version 0.97 (639K lower / 1047232K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.] grub> root (hd0,0) Filesystem type is ext2fs, partition type 0x83 grub> kernel /vmlinuz-2.6.18-53.el5 root=/dev/sda1 [Linux-bzImage, setup=0x1e00, size=0x1b3634] grub> initrd /initrd-2.6.18-53.el5.img [Linux-initrd @ 0x37cfc000, 0x2f3391 bytes] grub> boot ... WARNING: Can't access (null) exec of itnit ((null)) failed!!!: Bad address Kernel panic - not syncing: Attempted to kill init!
I then decided to check the
file on a working CentOS 5.1 system. When I did, I saw the following
in that file.
title CentOS (2.6.18-53.el5) root (hd0,0) kernel /vmlinuz-2.16.el5 root=/dev/VolGroup00/LogVol00 rhgb quiet crashkernel=128M@16M initrd /initrd-2.6.18-53.1.14.el5.img
I booted from the USB drive again and entered
rescue at the
boot: prompt. I then tried using
the root value I saw in the
I saw on the working CentOS system, which has an internal SATA
drive on which CentOS 5.1 is installed.
GNU GRUB version 0.97 (639K lower / 1047232K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.] grub> root (hd0,0) Filesystem type is ext2fs, partition type 0x83 grub> kernel /vmlinuz-2.6.18-53.el5 root=/dev/VolGroup00/LogVol00 [Linux-bzImage, setup=0x1e00, size=0x1b3634] grub> initrd /initrd-2.6.18-53.el5.img [Linux-initrd @ 0x37cfc000, 0x2f3391 bytes] grub> boot
This time, when I used
/vmlinuz-2.6.18-53.el5 root=/dev/VolGroup00/LogVol00, the system
booted into CentOS where I could continue
with the setup of CentOS. After answering various prompts to continue
with the setup, including creating a user account, I just got a cursor
I could move with the mouse on a black background, though. I rebooted
with the reset button on the system. I entered the same grub commands
again and got to a login screen. I was able to login as root and
got a GUI
display. The system had picked up an IP address via DHCP and
I was notified there were 210 package updates available, which
I installed. At first it didn't appear anything was happening when
I clicked on the Apply Updates button, but eventually
I saw the packages being downloaded and installed.
So that I don't have to enter the grub commands each time I boot
from the USB drive, I created a
Using the version on the working system as a template, I put the
following commands in the file.
# GRUB - created on 2008-07-22 # default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-53.el5) root (hd0,0) kernel /vmlinuz-2.6.18-53.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet crashkernel=128M@16M initrd /initrd-2.6.18-53.el5.img
I could have just put in the
initrd commands and left out the
crashkernel parameters from
kernel command, but I decided to match the other
system's configuration options.
hiddenmenu command hides the menu interface
and automatically boots the default entry, unless interrupted by
ro parameter on the kernel line causes the
kernel to mount the drive read-only initially; later the drive
will be remounted read/write. This is generally done so
fsck can run on
/ at bootup.
rhgb on the kernel line stands for "redhat
graphical boot". This is a GUI mode booting screen which displays
brief information regarding what the computer is doing while booting.
quiet option on the kernel line hides the
majority of boot messages before rhgb starts. According to
Re: What is "rhgb" on the grub, kernel line?,
"These are supposed to make the common user more comfortable. They
get alarmed about seeing the kernel and initializing messages, so they
hide them for their comfort." The poster likens the messages that
would appear to messages that appear when Windows XP or 2000 are
booted into Safe Mode.
crashkernel option specifies the amount of
memory to reseve for the dump-capture kernel, to be used for
troubleshooting should something go wrong with the operating
system. It is specified in the form
where Y specifies how much memory to reserve and X specifies
the beginning of this reserved memory. So, in this case,
I'm specifying that 128 Megabytes of memory be reserved at
physical address 0x01000000, i.e. the hexadecimal address
for 16 MB.
The upgrade of packages provided an update to the kernel as well.
When I checked
/boot after the packages were installed,
prior to rebooting the system, I saw the following files:
config-2.6.18-53.el5 config-2.6.18-92.1.6.el5 initrd-2.6.18-53.el5.img initrd-2.6.18-92.1.6.el5.img symvers-2.6.18-53.el5.gz symvers-2.6.18-92.1.6.el5.gz System.map-2.6.18-53.el5 System.map-2.6.18-92.1.6.el5 vmlinuz-2.6.18-92.1.6.el5
So, I added a section for the kernel update in
/boot/grub/menu.lst above the section
for version 2.6.18-53.
# GRUB - created on 2008-07-22 # default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-92.1.6.el5) root (hd0,0) kernel /vmlinuz-2.6.18-92.1.6.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet crashkernel=128M@16M initrd /initrd-2.6.18-92.1.6.el5.img title CentOS (2.6.18-53.el5) root (hd0,0) kernel /vmlinuz-2.6.18-53.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet crashkernel=128M@16M initrd /initrd-2.6.18-53.el5.img
Since I have
listed the new kernel first in the list, it is the "0" option and
will be loaded. Leaving the old one referenced as the second or
"1" menu option allows me to boot from it as well, if needed.
menu.lst, I issued the
command to reboot. I was presented with the grub prompt again rather
than the system booting to CentOS automatically as I expected after
I had created
GNU GRUB version 0.97 (639K lower / 1047232K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.] grub> root (hd0,0) Filesystem type is ext2fs, partition type 0x83 grub> kernel /vmlinuz-2.6.18- Possible files are: vmlinuz-2.6.18-53.el5 vmlinuz-2.6.18-92.1.6.el5 grub> kernel /vmlinuz-2.6.18-92.1.6.el5 root=/dev/VolGroup00/LogVol00 rhgb quiet crashkernel=128M@16M [Linux-bzImage, setup=0x1e00, size=0x1b6cf4] grub> initrd /initrd-2.6.18-92.1.6.el5.img [Linux-initrd @ 0x37cfc000, 0x1 bytes] grub> boot
This time when I entered
kernel /vmlinuz and hit
Tab, I saw two options listed for the
file. I chose the newer one. After I entered the
command, the system booted into CentOS 5.1. When I issued the
uname -a, I saw 2.6.18-92.1.6.el5 listed
as the kernel version.
I wasn't sure why the system hadn't used
to automatically select the latest kernel on the systm and boot
using it. I looked at the working CentOS system again and found
menu.lst was actually linked to
# ls -l menu.lst lrwxrwxrwx 1 root root 11 Mar 29 07:40 menu.lst -> ./grub.conf # ls -l grub.conf -rw------- 1 root root 811 Mar 29 15:13 grub.conf
So I renamed
on the USB drive and changed the permissions on
to match those on the working system. I then created a symbolic link
# mv menu.lst grub.conf # chmod 600 grub.conf # ln -s grub.conf menu.lst
I rebooted the system. This time, the system booted
automatically according to the configuration listed in