You are not logged in.

#1 2009-10-31 20:31:27

csergec
Member
Registered: 2009-09-29
Posts: 62

root partition not found if usbkey not plugged [SOLVED]

Hi

I have updated my pc by changing the mobo and the cpu (intel i5).
With this new mobo , there is no IDE, just SATA, so I ould not use my DVD-ROM.
So I installed Arch with a usbkey. Everything went ok.
At reboot, I had a problem with the kernel which did not find the right root partition.
I changed the UUD naming to the traditional one [dev/sda5] for the root partition in the grub menu.lst.
I rebooted eveything was OK. I installed X. KDE and lots of other stuffs. I had then a 32 bit system, now I have a fresh 64 bit on.
I rebooted and then again I could not boot because it could not find the root partition.
Then I plugged in my arch installation usbkey again and the system loaded without a problem.
Now I have to add, that in the bios the usbkey is not anymore in the boot selection. [I had to add it to be able to boot with the usbkey]. The bios chooses directly my first HDD.
Why I cannot boot without this usbkey unplugged???

Thank for your help

Serge

Last edited by csergec (2009-11-02 14:31:14)

Offline

#2 2009-10-31 20:58:29

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: root partition not found if usbkey not plugged [SOLVED]

Are you certain that grub was installed on the the hdd and not the usb drive?  What is the exact error you're seeing?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2009-10-31 21:03:16

csergec
Member
Registered: 2009-09-29
Posts: 62

Re: root partition not found if usbkey not plugged [SOLVED]

Hi

I do not get any grub error, so it means that grub is installed correctly

I have 2 hard drives: sda and sdb
grub is in the boot partition which is at sdb1
root is at sda5
my usbkey is identified as sdc

Serge

Offline

#4 2009-11-01 13:08:15

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: root partition not found if usbkey not plugged [SOLVED]

So you'll present w/ the grub menu.lst when you boot wo/ your usbstick installed?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2009-11-01 16:41:31

csergec
Member
Registered: 2009-09-29
Posts: 62

Re: root partition not found if usbkey not plugged [SOLVED]

Hi

Today I tried to re-instal grub with the cd.

For what I see, I do not think it is a grub problem.

Whent it fails to boot, I get this message:
/dev/sda5 does not exist. Attempting to create it.

And then it says it cannot create it. /dev/sda5 is the root partition.

The problem seems to come from the bios:

If I suppress the booting from usb and the usbkey is not listed  as a hard drive it fails.
It will fail if I keep the booting from usb and my usbkey is not plugged.

It seems to be a kernel thing. Next step I will reinstall the kernel without the usbkey when chrooting with the Arch Install CD.

Maybe someone has another idea...

EDIT:
I have reinstalled the kernel in a chroot mode.
No success.
So I has something to do with the bios.
My mobo is an Intel DP55WB one

Serge

Last edited by csergec (2009-11-01 18:08:32)

Offline

#6 2009-11-02 05:44:19

thetrivialstuff
Member
Registered: 2006-05-10
Posts: 191

Re: root partition not found if usbkey not plugged [SOLVED]

csergec wrote:

grub is in the boot partition which is at sdb1
root is at sda5

That's a little odd -- are you *sure* the BIOS isn't trying to boot from sda?

Also, the /dev/sdX naming scheme is not guaranteed to be the same from one boot to the next -- it's quite possible that this is happening:

from the install CD, the hard drives are seen by the kernel in order:
physical drive 1 = sda
physical drive 2 = sdb

when you boot from the hard drive:
physical drive 2 = sda (because the BIOS booted this one, maybe grub/the kernel saw it before the other one and called it sda)
physical drive 1 = sdb

I'm guessing your physical drive 2 doesn't have a partition 5 -- that's why sda5 doesn't exist. When you're at that failed boot prompt, do "echo /dev/sd*" and see what comes up.

As a fix for this, try setting root=/dev/disk/by-path/whatever-your-disk-is -- to figure that out, boot from the CD and ls -l /dev/disk/by-path -- you'll see something like:

lrwxrwxrwx 1 root root  9 2009-11-01 21:24 pci-0000:00:02.5-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 2009-11-01 21:24 pci-0000:00:02.5-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 2009-11-01 21:24 pci-0000:00:02.5-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 2009-11-01 21:24 pci-0000:00:02.5-scsi-0:0:0:0-part3 -> ../../sda3

That big long pci-whatever-scsi-whatever string identifies your drive by exactly where it's physically plugged in, so it won't matter if the kernel or grub or the BIOS sees the other drive first.

Last edited by thetrivialstuff (2009-11-02 05:45:03)

Offline

#7 2009-11-02 11:02:55

csergec
Member
Registered: 2009-09-29
Posts: 62

Re: root partition not found if usbkey not plugged [SOLVED]

Hi thetrivialstuff

The kernel loads:

Freeing unused kernel memory 296K freed
Loading Initramfs
running hook[udev]
loading udev done
running hook [keymap]
loading keymap done
running hook [filesystems]
loading root filesystems module
attempting to to create root device '/dev/sda5'
ERROR: failed to parse block device name '/dev/sda5'
unknown
ERROR: rootfs cannot be detected. Try using the rootfstype= kernel parameter
Waiting for devices to settle...done

At the ramfs prompt, I cannot type anything: the keyboard has not been loaded

After having booted the system with the usbkey, i did a :
ls -l /dev/disk/by-path --
/dev/sdc [the usbkey] is first listed
then i get all the partitions of /dev/sda [where root belongs]
then /dev/sdb and its partitions
By the way I have on both disks several partitions.
The last one listed is the dvdrom at /dev/sr0

It is what I get....

Thank you for help or ideas...


EDIT:
Thats all : I found the problem.

In the BIOS we can select the hard drives order.
The first hard drive was the one where /boot lies on
The second one was the one where /root is. Grub is install on this hard drive.
The third one was the USB key
I switched the order of the 2 hard drives, pulled out the USB key [ I mean it did not appear anymore in the BIOS]
On reboot I got the grub 15 error. I re-installed grub by chrooting with the Arch Install CD.
I rebooted the pc , everything went ok!!!

I now understand why i had to hook the usbkey to make it boot before: in the BIOS there is the option to boot the usb devices first and it was enabled.
I suppose I did not get the ArchLinux Installation Menu from the usbkey because it was in the third position.
Then despite that grub was on the second hard drive, I could boot the system.



Serge

Last edited by csergec (2009-11-02 14:30:36)

Offline

Board footer

Powered by FluxBB