LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 01-06-2011, 08:00 AM   #1
galumph
LQ Newbie
 
Registered: Jan 2011
Distribution: Gentoo, Slackware 13
Posts: 6

Rep: Reputation: 3
[SOLVED] Slackware 13 on USB, kernel panic


I've always wanted to install Linux on a small USB drive and have it boot on any computer anywhere. I thought I'd give it try with Slackware, I ran through the installation process a couple of times to see that I got it right, and continued on to installing on my USB drive.
I've got a 4GB sd card + reader formatted like so:
sdb1: 256M -- swap
sdb2: 3.8G -- ext4
I installed a barebones Slackware 13.1 system to sdb2 (of course), downloaded and compiled grub using the LFS instructions (Never used LILO, and I don't intend on doing so now.):
Code:
# ./configure --prefix=/usr           \
             --sysconfdir=/etc       \
             --disable-grub-emu-usb  \
             --disable-grub-fstest   \
             --disable-efiemu
# make && make install
# cd /
# grub-install /dev/sdb
# grub-mkconfig -o /boot/grub/grub.cfg
I figured this would work just as running off of a hard drive, I but I guess I was wrong. On reboot, I get a nice grub boot screen, select the first option, and wham! Kernel panic.
Code:
VFS: Cannot open root device "sdb2" or unknown-block (0,0)
Please append a correct "root= " boot option; here are the available partitions:
0800	117220824 sda driver: sd
	0801	40131		sda1
	0802	530145		sda2
	0803	116647965	sda3
0b00	1048575 sr0 driver: sr
Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block (0,0)
PID: 1, comm: swapper Not tainted 2.6.33.4 #1
grub *does* recognize my flash drive.
Here's what my /boot/grub/grub.cfg looks like: http://pastebin.com/g3SqDcPs
Any ideas? Because I'm out of my own, I've been messing around with it all afternoon with no avail. Maybe I need an initrd?


(NOTE: I'm looking to create a persistent filesystem, not a live one. Otherwise I'd just use the Slackware cd and UNetbootin)

Last edited by galumph; 01-06-2011 at 12:26 PM.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 01-06-2011, 08:39 AM   #2
adamk75
Senior Member
 
Registered: May 2006
Posts: 3,091

Rep: Reputation: 396Reputation: 396Reputation: 396Reputation: 396
You need to use the huge kernel or use an initrd.

Adam
 
Old 01-06-2011, 09:02 AM   #3
galumph
LQ Newbie
 
Registered: Jan 2011
Distribution: Gentoo, Slackware 13
Posts: 6

Original Poster
Rep: Reputation: 3
I made an initrd using 'mkinitrd -c -k 2.6.33.4 -m ext4' and added 'initrd /boot/initrd.gz' to each menuentry in grub's configuration file. Rebooted, and now I've got a new error:
Code:
/boot/initrd.gz: loading kernel modules from initrd image
mount: can't find /mnt in /etc/fstab
ERROR: no /sbin/init found on rootdev (or not mounted). Trouble ahead.
You can try to fix it (etc...)
I'd say I built it wrong. At least the kernel isn't "panicking" anymore :-P.

e, Forgot to mention that fstab is empty aside from the proc entry.

Last edited by galumph; 01-06-2011 at 09:04 AM.
 
Old 01-06-2011, 09:55 AM   #4
adamk75
Senior Member
 
Registered: May 2006
Posts: 3,091

Rep: Reputation: 396Reputation: 396Reputation: 396Reputation: 396
Ummm... Is it possible to even get a linux installation to boot if /etc/fstab doesn't have an entry for / ?

Adam
 
Old 01-06-2011, 10:12 AM   #5
galumph
LQ Newbie
 
Registered: Jan 2011
Distribution: Gentoo, Slackware 13
Posts: 6

Original Poster
Rep: Reputation: 3
I actually tried that once, and well, nope. Anyway, what entries should fstab have, can I just copy the fstab I have on sdb2 over to the initrd tree?
 
Old 01-06-2011, 11:33 AM   #6
galumph
LQ Newbie
 
Registered: Jan 2011
Distribution: Gentoo, Slackware 13
Posts: 6

Original Poster
Rep: Reputation: 3
Some guy on #slackware said to take a look at '/usr/share/mkinitrd/mkinitrd_command_generator.sh'. I gave it a go, and I gave me this 'mkinitrd -c -k 2.6.33.4 -f ext4 -r /dev/sdb2 -m jbd2:mbcahe:ext4 -o /boot/initrd.gz' which generated a damn fine initrd. I don't get any more crap about /mnt not being in fstab. Now I've got a new set of errors, apparently, /dev/sdb1 and 2 don't exist. I'll try and find a way to "create" them, anyone know how that's done (pretty sure udev takes care of it)?

(NOTE: /dev is populated with devices, including sda1-3.)

e, Google says I need ehci_hcd and uhci_hcd, how do I add them to the initrd?
ee, Nevermind that, all I had to was add them to '-m jbd2:mbcahe:ext4'. I still get nothing though, dmesg says the drive is recognized, but it doesn't show up under dev.
eee, Got it working. Only me and my Google-fu. I found I needed to run the following:
Code:
# make the initrd with the usb modules
mkinitrd -c -k 2.6.33.4 -f ext4 -r /dev/sdb2 -m jbd2:mbcahe:ext4:usbcore:ehci-hcd:uhci:usb-storage -o /boot/initrd.gz
# this makes sure we wait 10 seconds for sdb2
echo "10" > /boot/initrd-tree/wait-for-root
# rebuild the ramdisk
mkinitrd
Now to clean this sucker up, install X, openbox, and some tools.

Last edited by galumph; 01-06-2011 at 12:13 PM.
 
3 members found this post helpful.
Old 11-17-2011, 10:11 PM   #7
nsp
Member
 
Registered: Jul 2006
Location: China
Distribution: Slackware
Posts: 66

Rep: Reputation: 15
Thanks

Quote:
Originally Posted by galumph View Post
Some guy on #slackware said to take a look at '/usr/share/mkinitrd/mkinitrd_command_generator.sh'. I gave it a go, and I gave me this 'mkinitrd -c -k 2.6.33.4 -f ext4 -r /dev/sdb2 -m jbd2:mbcahe:ext4 -o /boot/initrd.gz' which generated a damn fine initrd. I don't get any more crap about /mnt not being in fstab. Now I've got a new set of errors, apparently, /dev/sdb1 and 2 don't exist. I'll try and find a way to "create" them, anyone know how that's done (pretty sure udev takes care of it)?

(NOTE: /dev is populated with devices, including sda1-3.)

e, Google says I need ehci_hcd and uhci_hcd, how do I add them to the initrd?
ee, Nevermind that, all I had to was add them to '-m jbd2:mbcahe:ext4'. I still get nothing though, dmesg says the drive is recognized, but it doesn't show up under dev.
eee, Got it working. Only me and my Google-fu. I found I needed to run the following:
Code:
# make the initrd with the usb modules
mkinitrd -c -k 2.6.33.4 -f ext4 -r /dev/sdb2 -m jbd2:mbcahe:ext4:usbcore:ehci-hcd:uhci:usb-storage -o /boot/initrd.gz
# this makes sure we wait 10 seconds for sdb2
echo "10" > /boot/initrd-tree/wait-for-root
# rebuild the ramdisk
mkinitrd
Now to clean this sucker up, install X, openbox, and some tools.
I met almost the same problem. After trying several stupid tries, Google directed me here. Then I followed your steps and problem solved. Thank you!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel panic on boot with new SATA drive Slackware 12 kernel: 2.6.21.5 theapodan Linux - Hardware 3 05-18-2009 03:02 PM
Attempting to boot Slackware from USB flash drive, getting kernel panic error hairykoala Slackware 11 02-25-2009 07:46 PM
Slackware 12 on USB hard drive Kernel Panic mpyusko Slackware - Installation 6 12-15-2007 11:40 AM


All times are GMT -5. The time now is 06:24 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration