Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-08-2009, 02:21 PM
|
#1
|
Member
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 637
Rep:
|
Ubuntu Custom kernel - kp: cannot open root device "sda1"
I am trying to compile a custom kernel for Ubuntu and I am getting a kernel panic:
VFS: Cannot open root device "sda1" or unkown-block(0,0)
This same kernel boots on Gentoo so i know I have the right device drivers and filesystem drivers.
Any idea why this is going to a kernel panic?
|
|
|
01-08-2009, 02:38 PM
|
#2
|
Senior Member
Registered: Oct 2003
Posts: 3,009
|
Are you using and initrd and if so, how was it generated? Usually, you get that type of error message when you don't have the drivers for your root partition to be recognized or you have a misconfigured grub which also results in your root partition not being found. You may want to post the grub entry you are using for the custom kernel as it appears in both gentoo and ubuntu.
|
|
|
01-08-2009, 03:45 PM
|
#3
|
Member
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 637
Original Poster
Rep:
|
Quote:
Originally Posted by kilgoretrout
Are you using and initrd and if so, how was it generated? Usually, you get that type of error message when you don't have the drivers for your root partition to be recognized or you have a misconfigured grub which also results in your root partition not being found. You may want to post the grub entry you are using for the custom kernel as it appears in both gentoo and ubuntu.
|
I'm not using an initrd with this kernel.
I compiled another kernel on Gentoo and moved to Ubuntu and this time it errors here:
VFS: Cannot open root device "sda1" or unkown-block(2,0)
instead of:
VFS: Cannot open root device "sda1" or unkown-block(0,0)
I went in to grub and set it up manually on both systems and it's working fine on Gentoo.
Last edited by Thaidog; 01-08-2009 at 04:07 PM.
|
|
|
01-08-2009, 04:45 PM
|
#4
|
Member
Registered: Nov 2007
Location: Seattle, WA
Distribution: LFS
Posts: 36
Rep:
|
I recently had this same issue.
When the kernel boots, it uses udev to assign device nodes to physical devices. What you need to do is create a udev rule that will make sure that the kernel assigns the root of your Ubuntu filesystem (your root device) to a consistent name that you choose (/dev/hda1 might be an example in the case of an IDE/ATA hard drive).
Then, when you bootstrap your kernel, pass in the root=/dev/hda1 option (or whatever other device node that you choose) to the kernel so that it knows where to find your root device. From there, the kernel will execute /sbin/init to load your boot scripts and continue booting.
It is likely that Ubuntu already has said rule, and all that you need to do is determine which name udev is giving your hard drive.
One other thought---
I think that you are missing a driver in your kernel (or at least it is compiled in as a module, in which case having an initrd would solve the problem this `other' issue).
What I did was issue a `make ARCH=i386 defaultconfig' to configure the kernel. Look at the `README' file in the .../linux directory in order to figure out what the exact name of defaultconfig is (such as defconfig).
I think that this will fix this problem, in which case the only thing left for you to do is to pass in root=<device node> as per udev's rules.
|
|
|
01-08-2009, 05:29 PM
|
#5
|
Member
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 637
Original Poster
Rep:
|
Quote:
Originally Posted by rm_dash_rf_star
I recently had this same issue.
When the kernel boots, it uses udev to assign device nodes to physical devices. What you need to do is create a udev rule that will make sure that the kernel assigns the root of your Ubuntu filesystem (your root device) to a consistent name that you choose (/dev/hda1 might be an example in the case of an IDE/ATA hard drive).
Then, when you bootstrap your kernel, pass in the root=/dev/hda1 option (or whatever other device node that you choose) to the kernel so that it knows where to find your root device. From there, the kernel will execute /sbin/init to load your boot scripts and continue booting.
It is likely that Ubuntu already has said rule, and all that you need to do is determine which name udev is giving your hard drive.
One other thought---
I think that you are missing a driver in your kernel (or at least it is compiled in as a module, in which case having an initrd would solve the problem this `other' issue).
What I did was issue a `make ARCH=i386 defaultconfig' to configure the kernel. Look at the `README' file in the .../linux directory in order to figure out what the exact name of defaultconfig is (such as defconfig).
I think that this will fix this problem, in which case the only thing left for you to do is to pass in root=<device node> as per udev's rules.
|
This makes since but I have tried using the UUID parameter already defined by Ubuntu as a UUID and I get the same thing.
It looks like this:
kernel=/boot/kernel-custom root=UUID=43h4l5lh235lh34h345j3534'53j45
or
kernel=/boot/kernel-custom root=/dev/sda1
either fails with the same message.
I know the driver is not missing bc I have booted the same system on Gentoo and it boots fine.
|
|
|
01-08-2009, 05:34 PM
|
#6
|
Member
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 637
Original Poster
Rep:
|
It looks like the udev HD rules are in /etc/udev/rules.d/60-persistent-storage.rules
Not sure what to do with this file though...
root@linux-desktop:/etc/udev/rules.d# cat 60-persistent-storage.rules
# do not edit this file, it will be overwritten on update
# persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path}
# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>
# forward scsi device event to corresponding block device
ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"
ACTION!="add|change", GOTO="persistent_storage_end"
SUBSYSTEM!="block", GOTO="persistent_storage_end"
# skip rules for inappropriate block devices
KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*", GOTO="persistent_storage_end"
# never access non-cdrom removable ide devices, the drivers are causing event loops on open()
KERNEL=="hd*[!0-9]", ATTR{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end"
KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end"
# ignore partitions that span the entire disk
TEST=="whole_disk", GOTO="persistent_storage_end"
# /sys/class/block will export this
ENV{DEVTYPE}!="?*", ATTR{range}=="?*", ENV{DEVTYPE}="disk"
ENV{DEVTYPE}!="?*", ATTR{start}=="?*", ENV{DEVTYPE}="partition"
# for partitions import parent information
ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"
# by-id (hardware serial number)
KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="scsi"
KERNEL=="cciss?c[0-9]d[0-9]", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="cciss"
KERNEL=="sd*[!0-9]|sr*|cciss?c[0-9]d[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="sd*[0-9]|cciss*p[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
# libata compat (links like hd*)
KERNEL=="sd*[!0-9]|sr*", ENV{ID_VENDOR}=="ATA", PROGRAM="ata_id $tempnode", RESULT=="?*", ENV{ID_ATA_COMPAT}="$result", SYMLINK+="disk/by-id/ata-$env{ID_ATA_COMPAT}"
KERNEL=="sd*[0-9]", ENV{ID_ATA_COMPAT}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_ATA_COMPAT}-part%n"
KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"
KERNEL=="mmcblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n"
# by-path (shortest physical path)
ENV{DEVTYPE}=="disk", IMPORT{program}="path_id %p"
ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}"
ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
# skip unpartitioned removable media devices from drivers which do not send "change" events
ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end"
# skip optical drives without media
ENV{DEVTYPE}=="disk", KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT}!="?*", GOTO="persistent_storage_end"
# import filesystem metadata
IMPORT{program}="vol_id --export $tempnode"
# by-label/by-uuid links (filesystem metadata)
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
LABEL="persistent_storage_end"
Last edited by Thaidog; 01-08-2009 at 05:36 PM.
|
|
|
All times are GMT -5. The time now is 10:48 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|