Can't boot

General support questions including new installations

Can't boot

Postby newcosguy » 2006/07/30 04:02:55

VFS: Cannot open root device "sda7" or unknown-block (0,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS Unable to mount root on unknown-block(0,0)

Here's the story, originally this partition was located on /dev/sda1
But I needed to install Windows and we know how it insists on the root partition :)

So I created an extended partition of the same size /dev/sda7 to move Centos to
I did an "dd if=/dev/sda1 of=/dev/sda7" and it completed successfully.
I can use Knoppix and mount /dev/sda7 and access the files no problem.

I've tried to not specify the root= option with GRUB with the same result.
When I specific root=/dev/sda7 things still don't work right.

I've spent a few hours now and any help would be appreciated!

Any ideas guys?

Thanks :-D
newcosguy
 
Posts: 55
Joined: 2006/05/07 15:06:57

Re: Can't boot

Postby WhatsHisName » 2006/07/30 18:22:16

You need to edit both /etc/fstab and /boot/grub/grub.conf to reflect the changes when you move the installation to another partition.

If you moved /boot, then you will also need to reconfigure grub to point to the new partition containing /boot.
User avatar
WhatsHisName
 
Posts: 1497
Joined: 2005/12/19 20:21:43
Location: /earth/usa/nj

Re: Can't boot

Postby newcosguy » 2006/07/30 20:53:21

Hi Thanks for the advice but I don't that's the problem. I did update fstab and grub.conf already

I'm also booting with a GRUB boot CD and the problem is still there :(

I'm not sure if this offers any clues but I can't even boot from the MBR GRUB.
I installed it to hd0,0 where Windows is
but instead all I see is a cursor that scrolls across the screen for a few seconds and then it stops and I see a character that looks like it has a smiley face in the middle.

My fstab for root had something like label=root/

so I changed it to explicitly /dev/sda7 and the problem is still there.

Any ideas guys?
newcosguy
 
Posts: 55
Joined: 2006/05/07 15:06:57

Re: Can't boot

Postby newcosguy » 2006/07/30 21:03:06

The one thing I noticed is that FSTAB root was set like this:
LABEL=/

so I can see that specifying root=/dev/sda7 would confuse fstab right?

So I changed that part to /dev/sda7 and booted from the GRUB boot CD like so:
root (hd0,6)
kernel (hd0,6)/boot/kernelimage root=/dev/sda7
boot

that didn't work

But now I'm going to try
kernel (hd0,6)/boot/kernel ro root=LABEL=/


It still doesn't work :(

This is just upsetting?

Does anyone have any ideas?
newcosguy
 
Posts: 55
Joined: 2006/05/07 15:06:57

Re: Can't boot

Postby Lenard » 2006/07/31 03:29:32

kernel (hd0,6)/boot/kernelimage root=/dev/sda7

kernel (hd0,6)/boot/kernel ro root=LABEL=/




Nope, they should read something like;

kernel /boot/vmlinuz-XXX root=/dev/sda7

The change in the /etc/fstab file should not matter in either case as long as the partition label is correct for the desired partition.

I.E /dev/sda7 == LABEL=/

It might be a good idea to re-install grub also;

/sbin/grub-install --recheck /dev/sda7
Lenard
 
Posts: 2283
Joined: 2005/11/29 02:35:25
Location: Indiana

Re: Can't boot

Postby newcosguy » 2006/07/31 15:40:16

Thanks Lenard.

I've also run
root (hd0,6)
setup(hd0,0)

and setup(hd0)

from the GRUB boot CD.

When I ran grub-install as you asked it said "Could not find device for /boot: Not found or not a block device"

I wonder if this problem has more to do with sda7 having GRUB and SDA7 is an extended partition.

I'm beyond what to do now :(

I guess there are 2 apparently problems possibly from the same source:

#1 GRUB won't boot properly, it has a scrolling line for a few seconds and ends in a weird character
#2 I can boot fine with the GRUB boot CD but CentOS insists it can't find the root partition no matter what I try
newcosguy
 
Posts: 55
Joined: 2006/05/07 15:06:57

Re: Can't boot

Postby WhatsHisName » 2006/07/31 17:04:30

It would be helpful if you posted the contents of /boot/grub/grub.conf and /etc/fstab.

Also, from Knoppix, CentOS Live-CD, grub boot floppy/CD/flash, etc., run the grub shell and see where it finds stage1:

Code: Select all
# grub
grub> find /boot/grub/stage1
grub> find /grub/stage1
grub> quit

Also, please run:

Code: Select all
# lvm pvscan
# lvm lvscan
# fdisk -l /dev/sda

and post the output. Only the latest Knoppix (v5...) has native lvm2 support for the lvm commands.
User avatar
WhatsHisName
 
Posts: 1497
Joined: 2005/12/19 20:21:43
Location: /earth/usa/nj

Re: Can't boot

Postby newcosguy » 2006/07/31 21:54:29

Thanks Guys. I just sshd' in so here are the results of fdisk:

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 1530 12289693+ 7 HPFS/NTFS
/dev/sda2 * 3060 12786 78132127+ 83 Linux
/dev/sda3 12787 30401 141492487+ 5 Extended
/dev/sda5 12787 13806 8193118+ 82 Linux swap / Solaris
/dev/sda6 13807 15081 10241406 e W95 FAT16 (LBA)
/dev/sda7 15082 18140 24571386 83 Linux
/dev/sda8 18141 30401 98486451 83 Linux

fstab:

# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
#/dev/sda7 / ext3 defaults 1 1
# VMWare Virtual Machines partition
#/dev/sda2 /mnt/sda2 ext3 defaults 1 1
/dev/sda2 /boot ext3 defaults 1 1
/dev/sda8 /mnt/sda8 ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
#LABEL=SWAP-sda2 swap swap defaults 0 0
/dev/sda5 swap swap defaults 0 0
/dev/hdc /media/cdrecorder auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0


/boot/grub/grub.conf:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-version.img
boot=/dev/sda7
default=0
timeout=5
splashimage=(hd0,6)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.9-34.0.2.EL)
root (hd0,6)
kernel /boot/vmlinuz-2.6.9-34.0.2.EL ro root=LABEL=/
initrd /boot/initrd-2.6.9-34.0.2.EL.img
title CentOS (2.6.9-34.0.1.EL)
root (hd0,6)
kernel /boot/vmlinuz-2.6.9-34.0.1.EL ro root=LABEL=/
initrd /boot/initrd-2.6.9-34.0.1.EL.img
title Memtest86+ (1.26)
root (hd0,6)
kernel /boot/memtest86+-1.26 ro root=LABEL=/
title CentOS-4 x86_64 (2.6.9-34.EL)
root (hd0,6)
kernel /boot/vmlinuz-2.6.9-34.EL ro root=LABEL=/
initrd /boot/initrd-2.6.9-34.EL.img

grub:

grub> find /boot/grub/stage1
(hd0,1)
(hd0,6)

grub> find /grub/stage1

Error 15: File not found

grub>


Sorry I can't run the last set of commands because I'm using Knoppix 4.0.2

Thanks again everyone for your help and suggestions.

I'm going to post a complete how-to fix on my website once we get this solved :)
:-D
newcosguy
 
Posts: 55
Joined: 2006/05/07 15:06:57

Re: Can't boot

Postby WhatsHisName » 2006/07/31 23:54:21

fstab:

/dev/sda2 /boot ext3 defaults 1 1

grub.conf:

splashimage=(hd0,6)/boot/grub/splash.xpm.gz

title CentOS (2.6.9-34.0.2.EL)
root (hd0,6)
kernel /boot/vmlinuz-2.6.9-34.0.2.EL ro root=LABEL=/
initrd /boot/initrd-2.6.9-34.0.2.EL.img


Is /boot located in sda2 or in sda7?

If sda2 is /boot, then grub.conf should contain “root (hd0,1)”, not “root (hd0,6)”. In grub.conf, “root (hd...)” refers to the location of the grub setup, not the location of the root filesystem. Also, sda2 contains a /boot folder (as per the grub find output), so mounting sda2 as /boot would not give you the desired outcome (i.e., /boot/boot/grub/...).

If sda7 is /boot, then you need to correct the fstab /boot entry.


Also, when in doubt about the LABEL= entry, change it to the device designation. You can have two partition/filesystems with the same LABEL= when you duplicate an installation using dd. Typically, the first one will be selected by/as LABEL=. For that reason, I routinely change LABEL= to the device designation.
User avatar
WhatsHisName
 
Posts: 1497
Joined: 2005/12/19 20:21:43
Location: /earth/usa/nj

Re: Can't boot

Postby newcosguy » 2006/08/01 01:43:03

Thanks. Well as trial and error I copied /boot to sda2 and installed GRUB there to see if it was an extended partition issue.

sda7 is the true boot drive, it has the OS + boot on the same partition.

It still doesn't help though :(

I've tried a raw /dev/sda7 and it doesn't work

Let's keep digging :)
Is /boot located in sda2 or in sda7?

If sda2 is /boot, then grub.conf should contain “root (hd0,1)”, not “root (hd0,6)”. In grub.conf, “root (hd...)” refers to the location of the grub setup, not the location of the root filesystem. Also, sda2 contains a /boot folder (as per the grub find output), so mounting sda2 as /boot would not give you the desired outcome (i.e., /boot/boot/grub/...).

If sda7 is /boot, then you need to correct the fstab /boot entry.


Also, when in doubt about the LABEL= entry, change it to the device designation. You can have two partition/filesystems with the same LABEL= when you duplicate an installation using dd. Typically, the first one will be selected by/as LABEL=. For that reason, I routinely change LABEL= to the device designation.
newcosguy
 
Posts: 55
Joined: 2006/05/07 15:06:57

Next

Return to CentOS 4 - General Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest