LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 09-27-2012, 11:34 PM   #1
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 229

Rep: Reputation: 37
linux-on-a-stick


Installed slackware on a usb-stick - no problems whatsoever.
I want to carry that li'l sucker around as my personal linux-on-a-stick - no matter which machine I put it into and boot from it.

My problem is booting - and I'm using 'grub legacy' (and please, grub2 is an OS looking for a bootloader - I don't want it!)

What happens is that I get the (in)famous:
Code:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
My layout of the stick is as follows:
part #1: ext2, 64M (my 'grub'-partition)
part #2: swap, 2 gigs
part #3: jfs, 30 gigs, slackware in all its glory

I probably should explain my 'grub-partition', it is something I always use (as I generally have at least 3 different distros on each harddrive/computer).
Then, whenever I install a new distro, I let its bootloader reside on the partition of its root fs - be it grub or grub2. Then my menu.lst just contains 'root (hd0,X)' and 'chainloader +1' ... ez ...

I always use ext2 for my first partition - it is never mounted unless I change anything in there. In this example, the stick comes out as sdc - all depends how many hard-disks in the computer; on my laptop it would be sdb.
Code:
mkfs ext2 /dev/sdc1
mount /dev/sdc1 /mnt/pen
mkdir /mnt/pen/grub
cp /usr/lib/grub/i386-pc/* /mnt/pen/grub
grub
grub>root (hd2,0)
grub>setup (hd2)
grub>quit
Then I make my menu.lst-file
Code:
vi /mnt/pen/grub/menu.lst
- and it looks like this:
Code:
default 0
timeout 3
title slackware-14
  root (hd0,2)
  kernel /boot/vmlinuz ro root=UUID=abc.... rootdelay=30
The way I understand it - when you boot from any disk, that disk will be device (hd0) - then the kernel gets loaded and your bootdisk might be demoted to eg. the 3rd disk - all depends on the bios.

After installing slackware, I also change the /etc/fstab to use UUID for the swap and rootfs so I should not be dependent upon which sdX my stick will end up as.

So yes, the kernel boots and everything looks good until it attempts to mount the root filesystem ...

And yes, I _have_ googled and got some few thousand hits ...

Anyone here that can solve my li'l problem?
Thank yall in advance!

Last edited by perbh; 09-27-2012 at 11:38 PM.
 
Old 09-28-2012, 02:06 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,438
Blog Entries: 11

Rep: Reputation: 182Reputation: 182
Does grub-legacy have the jfs filesystem support build in? Do you need to load a module for jfs?

Are you booting your stick on bare hardware or inside a VM?
 
Old 09-28-2012, 03:20 AM   #3
gargamel
Senior Member
 
Registered: May 2003
Distribution: Slackware, SLAX, OpenSuSE
Posts: 1,595

Rep: Reputation: 142Reputation: 142
My guess would be, too, that you might need to load a module for jfs. One option here would be to set up an "initial RAM disk", an initrd that loads the required modules for your combination of kernel and file system.

gargamel
 
Old 09-28-2012, 07:09 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,752

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
"The way I understand it - when you boot from any disk, that disk will be device (hd0)" This not correct. The order of the disks depends on how the BIOS sees them. In your case, the computer does not see sdc3 -it is trying to boot unknown-block(0,0), which is hd0,0 or sda1.
Note that once the kernel is booted *it* may see the disks in a different order than the BIOS sees them.
 
Old 09-28-2012, 07:23 AM   #5
dlachausse
LQ Newbie
 
Registered: May 2012
Distribution: Slackware
Posts: 28

Rep: Reputation: Disabled
This doesn't help perbh, but I have a merchandise request...Pat is there any way that you could add pre-loaded Slackware USB sticks (with the Slackware logo on them of course) to the store? I know I'd definitely save up my pennies and buy one (or two)!
 
Old 09-28-2012, 12:22 PM   #6
dwblas
Member
 
Registered: Jun 2011
Posts: 52

Rep: Reputation: Disabled
Quote:
Originally Posted by dlachausse View Post
This doesn't help perbh, but I have a merchandise request...Pat is there any way that you could add pre-loaded Slackware USB sticks (with the Slackware logo on them of course) to the store? I know I'd definitely save up my pennies and buy one (or two)!
You still have to have everything you want in the kernel, but I'd also consider that, although it's easy enough to create one of your own and who knows if there is enough interest to buy usb thumb drives in bulk.
 
Old 09-28-2012, 01:42 PM   #7
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 229

Original Poster
Rep: Reputation: 37
I'm _not_ using a 'vm' - it is mainly as a 'demo' (whereever I can boast of linux) or as a tool to sort out family pc's (sadly, most of'em are still using 'that other' OS).
And yes, jfs support _is_ in the hugesmp kernel - funny thing is - when it boots from the stick, if I use /dev/sdX3 in the kernel line - it all works beautifully.
It is almost like legacy grub does not support 'root=UUID=....' or 'root=LABEL=...' in the kernel invocation line (I'm checking out the manual now)
I get around it all by using a sufficiently long timeout so i can push 'e' and edit the kernel line to be /dev/sdX3 (where the stick might be sdb, sdc or sdf or whatever). However, that is not very satisfactory - it almost feels like cheating because I first have to boot and I know it will fail - just to see what device name it has - and then change it on the next boot ...
 
Old 09-28-2012, 03:07 PM   #8
dlachausse
LQ Newbie
 
Registered: May 2012
Distribution: Slackware
Posts: 28

Rep: Reputation: Disabled
Quote:
Originally Posted by dwblas View Post
You still have to have everything you want in the kernel, but I'd also consider that, although it's easy enough to create one of your own and who knows if there is enough interest to buy usb thumb drives in bulk.
Really it doesn't even have to be preloaded with anything...like you say it's easy enough to do it myself. You're right though, there probably isn't enough interest in ordering them in bulk. Plus there's the whole obsolescence issue, where thumb drives seem to double in capacity every year for the same price.
 
Old 09-29-2012, 07:49 PM   #9
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 229

Original Poster
Rep: Reputation: 37
Plueeze - is there nobody that knows how to have a persistent linux on a usb-stick???
Maybe the subject-line is not sufficiently 'catching'?
 
Old 09-29-2012, 09:11 PM   #10
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 201Reputation: 201Reputation: 201
Have you looked at how the usb installer works? It's documented in the Slackware tree.
 
Old 09-29-2012, 09:12 PM   #11
comet.berkeley
Member
 
Registered: Dec 2009
Location: California
Distribution: Slackware current
Posts: 149

Rep: Reputation: Disabled
Quote:
Originally Posted by perbh View Post
Plueeze - is there nobody that knows how to have a persistent linux on a usb-stick???
Maybe the subject-line is not sufficiently 'catching'?
I've never had to use Grub yet.

I use lilo.

Here is an example of triple booting Slackware, Mythbuntu and NetBSD from different partitions on the same drive:

http://www.linuxquestions.org/questi...f-grub-937568/

You have already created a jfs partition with linux Slackware and lilo on it.

Edit the etc/lilo.conf on the usb and treat the usb like a hard disk.

On my system there is one hard drive, /dev/sda
so my usb sticks show up as /dev/sdb

The third regular partition of a usb stick would be /dev/sdb3.

Or for a newer way, use "UUID=..."
 
Old 09-29-2012, 10:40 PM   #12
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 229

Original Poster
Rep: Reputation: 37
- sorry - double-posted

Last edited by perbh; 09-29-2012 at 10:51 PM.
 
Old 09-29-2012, 10:50 PM   #13
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 229

Original Poster
Rep: Reputation: 37
@damgar:
Oooops - never thought of that - will do ...

@comet.berkely:
I have no problems multibooting - I do it all the time (see my initial posting).
Funny thing is - my usb-stick will boot perfectly if I use the device name, ie:
Code:
kernel /boot/vmlinuz ro root=/dev/sdb3
Obviously, this will _not_ work if I try it in a machine with more than one disk - eg. both my desktops have two sata-disks, so the stick comes up as /dev/sdc - and therein is my big problem. I want a stick that will boot into slackware on _any_ machine. For some strange reason, my grub will _not_ honor 'root=UUID=...' or even 'root=LABEL=...'

As I initially said - my first (small) partition is (what I call) a 'grub'-partition - it only contains the grub-files and grub itself is installed on the MBR. In this case I have used archlinux's grub (because it is patched to support ext4) - and I have no success using root=UUID=...
Maybe I should try slackware's grub?
 
Old 09-29-2012, 11:29 PM   #14
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,252

Rep: Reputation: 630Reputation: 630Reputation: 630Reputation: 630Reputation: 630Reputation: 630
I'm not 100% positive here so keep that in mind. I don't believe root=UUID= is actually a valid kernel parameter (root= is, obviously, but not UUID=); instead, the init script in a mkinitrd-generated initrd determines the actual device (using findfs) when root=UUID= is passed. If you don't use an initrd, then it uses the system init binary and root=UUID= is not valid. I'm not sure how devices are populated before the root system is mounted, so I don't know if (udev-generated?) /dev/disk/by-uuid/* is available during early boot...if so then you could specify root=/dev/disk/by-uuid/UUID_HERE but if not then I don't know how you would get this to work without an initrd. Of course, you could just use an initrd with the generic kernel and the root=UUID= syntax would work without further effort.

Again, I'm not 100% positive, but I believe that is the situation as it stands.
 
1 members found this post helpful.
Old 09-29-2012, 11:48 PM   #15
perbh
Member
 
Registered: May 2008
Location: Republic of Texas
Posts: 229

Original Poster
Rep: Reputation: 37
@T3slider:
Thank you!! That makes perfect sense (at least to me).
And yes - obviously there will not be any problems using a 'token' initrd. It really ought to be a 'token' one since I don't know the innards of any machine I might want to boot it on.

I will try out all of your suggestions and let yall know if/how it works.
 
  


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
LXer: Installing "Sugar on a stick" (Strawberry Release) On A USB Stick LXer Syndicated Linux News 0 08-04-2009 03:50 PM
LXer: Linux on a stick LXer Syndicated Linux News 0 06-19-2009 12:21 AM
Which linux on usb stick Corrado Linux - General 3 04-11-2007 12:10 AM
mount/umount usb stick - PQI Intelligent Stick 2.0 sandbag Linux - Software 5 05-06-2005 11:12 AM
Mixing 512MB Ram 2700 stick with a 256MB 3200 stick? Will it screw things up? Fear58 Linux - Hardware 2 07-15-2004 01:20 PM


All times are GMT -5. The time now is 09:47 AM.

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