# kernel panic when booting from pcmcia card[solved]

## Adel Ahmed

I have installed grub and gentoo to a pcmcia card, grub loads just fine and the kernel is loaded, however I get the kernel panic:

VFS: Cannot open root device "sdb1" or unknown-block(1,0)

the panic message includes the partitions found on my harddisk(sda) but not on my pcmcia card(sdb), this lead me to the conclusion that there is something missing in my kernel config

heres my kernel config file:

http://pastebin.com/vrzKEY5z

thanks

problem solved by removing the hard drive's drivers from the kernel(modularized)Last edited by Adel Ahmed on Wed Jun 12, 2013 9:19 am; edited 1 time in total

----------

## roarinelk

enable CONFIG_PATA_PCMCIA, make it built-in, and add "rootwait" to the kernel commandline

(the card may be detected _after_ the kernel tries to mount the root device, this command

makes it wait forever for the root device to appear before attempting to mount it).

----------

## NeddySeagoon

blakdeath,

You also need PCMCIA support built into your kernel.

unknown-block(1,0) is the first RAM disk. So your error reads as if you have told the kernel to use an initrd but not provided one.

Please post your grub.conf

----------

## roarinelk

 *NeddySeagoon wrote:*   

> You also need PCMCIA support built into your kernel.
> 
> 

 

His .config shows pcmcia/cardbus enabled but is missing the IDE driver required for CF cards.

----------

## Adel Ahmed

Even after enabling the CONFIG_PATA_PCMCIA in the kernel did nothing i'm afraid  :Sad: , the rootwait parameter didnt help either.

here's my grub.conf:

default 0

timeout 30

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

title Gentoo Linux

root (hd1,1)

kernel /boot/kernel3 root=/dev/sdb1

title gentoo linux with root wait

root(hd1,1)

kernel /boot/kernel3 root=/dev/sdb1 rootwait=10

thanks for the help  :Very Happy: 

----------

## roarinelk

post a full dmesg please

----------

## Adel Ahmed

when I chroot, dmesg just prints out my PC's dmesg, how do I get it to print out my chroot environment's dmesg?

----------

## roarinelk

try netconsole if you have another networked machine:

http://www.mjmwired.net/kernel/Documentation/networking/netconsole.txt

----------

## Adel Ahmed

I only have acecess to wireless networks and I havent configured wireless networking on that machine yet, is tehre another way to do that(pherhaps via /var/log?)

thanks

----------

## NeddySeagoon

blakdeath,

There is only one dmesg, its the same inside and outside the chroot.

You can save dmesg to a file and put it on a usb stick to move it to another machine to post.

----------

## Adel Ahmed

but I can't even boot into the system

I can only access the system via chroot

does that mean I wont be able to get the dmesg log?

----------

## NeddySeagoon

blakdeath,

No.  Boot the system however you like, the dmesg is the same inside and outside the chroot.

It may change when you change kernels hardware or whatever.

While you are posting files, post your grub.conf too please.

----------

## Adel Ahmed

here's my grub.conf:

default 0

timeout 30

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

title Gentoo Linux

root (hd1,1)

kernel /boot/kernel3 root=/dev/sdb1

title gentoo linux with root wait

root(hd1,1)

kernel /boot/kernel3 root=/dev/sdb1 rootwait=10

----------

## NeddySeagoon

blakdeath,

Thats OK.  Don't forget your dmesg.

What is the date and time in the kernel called /boot/kernel3 ?

ls -l /boot shows it.

----------

## Adel Ahmed

ah here's my ls -l :

lrwxrwxrwx 1 root root       1 Jun  3 09:20 boot -> .

drwxr-xr-x 2 root root    4096 Jun  4 09:14 grub

-rw-r--r-- 1 root root 4117984 Jun  3 11:41 kernel2

-rw-r--r-- 1 root root 4126784 Jun  4 06:07 kernel3

here's my dmesg:

http://pastebin.com/jKr2T0nc

my pccard is sdb 

thanks

----------

## roarinelk

oh it's a USB CF Card reader!  you need to make CONFIG_USB_STORAGE=y  (built-in).

----------

## Adel Ahmed

I already have that option built in  :Sad: 

----------

## roarinelk

plug the card reader in, boot the kernel you want to use, but set the rootfs to the

harddisk instead of the cf card. then send the dmesg.  also be aware that any

usb sticks you plug in might change the drive devnode of the cardreader.

the dmesg you posted only shows that you plugged the cardreader over an hour after boot.

that doesn't help finding the problem in the slightest.

----------

## Adel Ahmed

sorry about that

here's the new dmesg:

http://pastebin.com/hmHr6Zjf

----------

## NeddySeagoon

blakdeath,

Some BIOSes report the boot drive as (hd0,0) regardless of which drive it actually is this makes installing grub correctly a problem because the drive swap BIOS names between the grub install and being used to boot.

Lets do some checking ...

Go to boot from your USB stick.  When the grub menu appears, press e for edit. 

Grub will show you 

```
title Gentoo Linux

root (hd1,1)

kernel /boot/kernel3 root=/dev/sdb1 
```

Choose the root (hd1,1) line and make it read 

```
root (hd
```

press the tab key.  Grub will list all the drives known to the BIOS by their BIOS names.

Probably just 0 and 1 for you.

Choose 1, and make the line read 

```
root (hd1,
```

now press tab.  Grub will list all the partitions on the selected drive, or fill in the only one.

From the number of partitions on the drive, can you tell which drive you are looking at ?

If all looks well, change the drive letter in root=/dev/sdb1 to sda1 and allow the boot to contine

None of this harms your on disk grub.conf.

----------

## Adel Ahmed

well I followed those instructions and grub showed me that teh card is (0,0)

I adjusted teh grub accordingly (kernel, & root=) and adjusted the fstab as well (/dev/sda1 on /)

this is my current kernel panic:

http://www.4shared.com/photo/bF3jS40u/CAM00111.html

and If I use rootwait=10 I get:

http://www.4shared.com/photo/zp8W2PEN/CAM00112.html

thanks, I appreciate your help

----------

## roarinelk

hmm, while the kernel output is scrolling down, did you ever see the

cardreader being detected?  Right now only the sata disk is known to the kernel.

rootwait doesn't take any parameters btw, just "linux.git root=/dev/sdb1 rootwait"

----------

## Adel Ahmed

yeah I noticed it wasn't detected, only my hard disk was detected and sda1(an ntfs partition) is attempted, there is no sdb at all

----------

## Adel Ahmed

I just used one of machine's initrd, and the system successfully boots, this is a temporary solution, I'd like to boot without an initrd, this indicates that something might be missing in the kernel though

here's my dmesg when using an initrd

http://pastebin.com/yJN8JYuC

----------

## roarinelk

Interestingly, it IS detected:

```
[    6.461146] scsi 4:0:0:0: Direct-Access     Lexar    ExpressCard      1100 PQ: 0 ANSI: 0 CCS

[    6.462595] sd 4:0:0:0: Attached scsi generic sg2 type 0

[    6.462884] sd 4:0:0:0: [sdb] 7864320 512-byte logical blocks: (4.02 GB/3.75 GiB)

[    6.463630] sd 4:0:0:0: [sdb] Write Protect is off

[    6.463633] sd 4:0:0:0: [sdb] Mode Sense: 43 00 00 00

[    6.464379] sd 4:0:0:0: [sdb] No Caching mode page present

[    6.464381] sd 4:0:0:0: [sdb] Assuming drive cache: write through

[    6.467877] sd 4:0:0:0: [sdb] No Caching mode page present

[    6.467880] sd 4:0:0:0: [sdb] Assuming drive cache: write through

[    6.468386]  sdb: sdb1
```

do you use a filesystem on the card which is not built-in?

EDIT scratch that, I see it's ext4 which is built-int

please show the contents of the initrd, and lsmod output when you have booted from the card!

----------

## Adel Ahmed

"please show the contents of the initrd"

how do I do that? something tells me I misunderstood that statement

----------

## roarinelk

you said you are using an initrd.  show the list of files in it please.

----------

## Adel Ahmed

I hope this is what you wanted:

http://pastebin.com/vVXesD3C

its the result of ls -AR for the mounted initrd

----------

## Adel Ahmed

as a workaround, I have modularized the hard disk drivers, this way only the pc card is seen during boot

the problem is solved 

thanks everyone

----------

