* [gentoo-user] Booting Gentoo from USB stick
@ 2010-09-10 5:09 Jake Moe
2010-09-10 7:27 ` Maciej Grela
2010-09-10 10:51 ` Al
0 siblings, 2 replies; 28+ messages in thread
From: Jake Moe @ 2010-09-10 5:09 UTC (permalink / raw
To: gentoo-user
Hello all,
I've been thinking about creating a Gentoo USB stick for install and
rescue purposes (and, of course, just to see if I could). I've mostly
followed the Gentoo handbook (I used a single 4GB partition for the
whole system, and no swap). I've used genkernel for the kernel (so I
can have a multi-system capable kernel). I've gotten GRUB installed and
working. My problem comes in after what I believe is the init process:
Gentoo Linux; http://www.gentoo.org
Copyright 1999-2009 Gentoo Foundation; Distributed under the GPLv2
Press I to enter interactive boot mode
* Mounting proc at /proc
... [ ok ]
* Mounting sysfs at /sys
... [ ok ]
* Mounting /dev
... [ ok ]
* Starting udevd
... [ ok ]
* Populating /dev with existing devices through uevents
... [ ok ]
* Waiting for uevents to be processed
... [ ok ]
* Mounting devpts at /dev/pts
... [ ok ]
* Checking root filesystem ...
fsck.ext2: No such file or directory while trying to open /dev/sda1
/dev/sda1:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
* Filesystem couldn't be fixed
:( [ !! ]
Give root password for maintenance
(or type Control-D to continue):
If I give the root password, I can find no /dev/sda1. However, mount
shows /dev/sda1 on /, and there *is* a /sys/block/sda folders, with a
sda1 folder in that as well. It's almost like it had /dev/sda1, but
then lost it somehow.
Does anyone have any idea what's going on here? Any help would be
appreciated.
Jake Moe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-10 5:09 [gentoo-user] Booting Gentoo from USB stick Jake Moe
@ 2010-09-10 7:27 ` Maciej Grela
2010-09-10 8:43 ` Jake Moe
2010-09-10 10:51 ` Al
1 sibling, 1 reply; 28+ messages in thread
From: Maciej Grela @ 2010-09-10 7:27 UTC (permalink / raw
To: gentoo-user
2010/9/10 Jake Moe <jakesaddress@gmail.com>:
> Hello all,
>
> I've been thinking about creating a Gentoo USB stick for install and rescue
> purposes (and, of course, just to see if I could). I've mostly followed the
> Gentoo handbook (I used a single 4GB partition for the whole system, and no
> swap). I've used genkernel for the kernel (so I can have a multi-system
> capable kernel). I've gotten GRUB installed and working. My problem comes
> in after what I believe is the init process:
>
>
> Gentoo Linux; http://www.gentoo.org
> Copyright 1999-2009 Gentoo Foundation; Distributed under the GPLv2
>
> Press I to enter interactive boot mode
>
> * Mounting proc at /proc ... [
> ok ]
> * Mounting sysfs at /sys ... [
> ok ]
> * Mounting /dev ... [
> ok ]
> * Starting udevd ... [
> ok ]
> * Populating /dev with existing devices through uevents ... [
> ok ]
> * Waiting for uevents to be processed ... [
> ok ]
> * Mounting devpts at /dev/pts ... [
> ok ]
> * Checking root filesystem ...
> fsck.ext2: No such file or directory while trying to open /dev/sda1
> /dev/sda1:
> The superblock could not be read or does not describe a correct ext2
> filesystem. If the device is valid and it really contains an ext2
> filesystem (and not swap or ufs or something else), then the superblock
> is corrupt, and you might try running e2fsck with an alternate superblock:
> e2fsck -b 8193 <device>
>
> * Filesystem couldn't be fixed :( [
> !! ]
> Give root password for maintenance
> (or type Control-D to continue):
>
>
> If I give the root password, I can find no /dev/sda1. However, mount shows
> /dev/sda1 on /, and there *is* a /sys/block/sda folders, with a sda1 folder
> in that as well. It's almost like it had /dev/sda1, but then lost it
> somehow.
>
> Does anyone have any idea what's going on here? Any help would be
> appreciated.
>
Have you seen http://www.sysresccd.org/Main_Page ? It's based on
Gentoo, you could check what they did to boot from a usb stick.
Br,
Maciej Grela
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-10 7:27 ` Maciej Grela
@ 2010-09-10 8:43 ` Jake Moe
2010-09-10 9:05 ` J. Roeleveld
0 siblings, 1 reply; 28+ messages in thread
From: Jake Moe @ 2010-09-10 8:43 UTC (permalink / raw
To: gentoo-user
On 10/09/2010 5:27 PM, Maciej Grela wrote:
> 2010/9/10 Jake Moe<jakesaddress@gmail.com>:
>> Hello all,
>>
>> I've been thinking about creating a Gentoo USB stick for install and rescue
>> purposes (and, of course, just to see if I could). I've mostly followed the
>> Gentoo handbook (I used a single 4GB partition for the whole system, and no
>> swap). I've used genkernel for the kernel (so I can have a multi-system
>> capable kernel). I've gotten GRUB installed and working. My problem comes
>> in after what I believe is the init process:
>>
>>
>> Gentoo Linux; http://www.gentoo.org
>> Copyright 1999-2009 Gentoo Foundation; Distributed under the GPLv2
>>
>> Press I to enter interactive boot mode
>>
>> * Mounting proc at /proc ... [
>> ok ]
>> * Mounting sysfs at /sys ... [
>> ok ]
>> * Mounting /dev ... [
>> ok ]
>> * Starting udevd ... [
>> ok ]
>> * Populating /dev with existing devices through uevents ... [
>> ok ]
>> * Waiting for uevents to be processed ... [
>> ok ]
>> * Mounting devpts at /dev/pts ... [
>> ok ]
>> * Checking root filesystem ...
>> fsck.ext2: No such file or directory while trying to open /dev/sda1
>> /dev/sda1:
>> The superblock could not be read or does not describe a correct ext2
>> filesystem. If the device is valid and it really contains an ext2
>> filesystem (and not swap or ufs or something else), then the superblock
>> is corrupt, and you might try running e2fsck with an alternate superblock:
>> e2fsck -b 8193<device>
>>
>> * Filesystem couldn't be fixed :( [
>> !! ]
>> Give root password for maintenance
>> (or type Control-D to continue):
>>
>>
>> If I give the root password, I can find no /dev/sda1. However, mount shows
>> /dev/sda1 on /, and there *is* a /sys/block/sda folders, with a sda1 folder
>> in that as well. It's almost like it had /dev/sda1, but then lost it
>> somehow.
>>
>> Does anyone have any idea what's going on here? Any help would be
>> appreciated.
>>
> Have you seen http://www.sysresccd.org/Main_Page ? It's based on
> Gentoo, you could check what they did to boot from a usb stick.
>
> Br,
> Maciej Grela
>
Excellent, thanks for that, I hadn't found it in my previous searches.
I'll have a look there.
Jake Moe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-10 8:43 ` Jake Moe
@ 2010-09-10 9:05 ` J. Roeleveld
2010-09-10 11:29 ` David Relson
0 siblings, 1 reply; 28+ messages in thread
From: J. Roeleveld @ 2010-09-10 9:05 UTC (permalink / raw
To: gentoo-user
On Friday 10 September 2010 10:43:30 Jake Moe wrote:
> On 10/09/2010 5:27 PM, Maciej Grela wrote:
> > 2010/9/10 Jake Moe<jakesaddress@gmail.com>:
> >> Hello all,
> >>
> >> I've been thinking about creating a Gentoo USB stick for install and
> >> rescue purposes (and, of course, just to see if I could). I've mostly
> >> followed the Gentoo handbook (I used a single 4GB partition for the
> >> whole system, and no swap). I've used genkernel for the kernel (so I
> >> can have a multi-system capable kernel). I've gotten GRUB installed
> >> and working. My problem comes in after what I believe is the init
> >> process:
> >>
> >>
> >> Gentoo Linux; http://www.gentoo.org
> >>
> >> Copyright 1999-2009 Gentoo Foundation; Distributed under the GPLv2
> >>
> >> Press I to enter interactive boot mode
> >>
> >> * Mounting proc at /proc ...
> >> [
> >>
> >> ok ]
> >>
> >> * Mounting sysfs at /sys ...
> >> [
> >>
> >> ok ]
> >>
> >> * Mounting /dev ...
> >> [
> >>
> >> ok ]
> >>
> >> * Starting udevd ...
> >> [
> >>
> >> ok ]
> >>
> >> * Populating /dev with existing devices through uevents ...
> >> [
> >>
> >> ok ]
> >>
> >> * Waiting for uevents to be processed ...
> >> [
> >>
> >> ok ]
> >>
> >> * Mounting devpts at /dev/pts ...
> >> [
> >>
> >> ok ]
> >>
> >> * Checking root filesystem ...
> >>
> >> fsck.ext2: No such file or directory while trying to open /dev/sda1
> >> /dev/sda1:
> >> The superblock could not be read or does not describe a correct ext2
> >> filesystem. If the device is valid and it really contains an ext2
> >> filesystem (and not swap or ufs or something else), then the superblock
> >>
> >> is corrupt, and you might try running e2fsck with an alternate
superblock:
> >> e2fsck -b 8193<device>
> >>
> >> * Filesystem couldn't be fixed :(
> >> [
> >>
> >> !! ]
> >> Give root password for maintenance
> >> (or type Control-D to continue):
> >>
> >>
> >> If I give the root password, I can find no /dev/sda1. However, mount
> >> shows /dev/sda1 on /, and there *is* a /sys/block/sda folders, with a
> >> sda1 folder in that as well. It's almost like it had /dev/sda1, but
> >> then lost it somehow.
> >>
> >> Does anyone have any idea what's going on here? Any help would be
> >> appreciated.
> >
> > Have you seen http://www.sysresccd.org/Main_Page ? It's based on
> > Gentoo, you could check what they did to boot from a usb stick.
> >
> > Br,
> > Maciej Grela
>
> Excellent, thanks for that, I hadn't found it in my previous searches.
> I'll have a look there.
>
> Jake Moe
Had a similar issue a while ago when I was playing around with this myself.
Take a look at the linux boot parameters.
The 'theoretical' part is: You need to let the kernel initialize the USB-stick
before trying to access it. (This can take some time)
There is a delay-option, just can't remember the proper name off-hand.
--
Joost
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-10 5:09 [gentoo-user] Booting Gentoo from USB stick Jake Moe
2010-09-10 7:27 ` Maciej Grela
@ 2010-09-10 10:51 ` Al
1 sibling, 0 replies; 28+ messages in thread
From: Al @ 2010-09-10 10:51 UTC (permalink / raw
To: gentoo-user
>
> If I give the root password, I can find no /dev/sda1. However, mount shows
> /dev/sda1 on /, and there *is* a /sys/block/sda folders, with a sda1 folder
> in that as well. It's almost like it had /dev/sda1, but then lost it
> somehow.
>
> Does anyone have any idea what's going on here? Any help would be
> appreciated.
This may be a problem with the order of disks. If there is a harddisk
and a USB, which one is recognized as sda1? I guess that can even
depend on the BIOS settings.
Then there are differences between different versions of Grub (but you
already manged the Grub setup).
I came to the following solution for me to make things more easy:
I put Grub always on the harddisk. I have a little linux partion only
for the purpose to configure Grub. So it's unambiguously that the
harddisk is the first disk and that Grub is on the first disk.
Now I can freely experiment on all other partitions and disks. I never
install a bootloader on those other partitions.
Sure that doesn't work for a rescue system when the harddisk is
broken. In that case I would use any live CD.
Al
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-10 9:05 ` J. Roeleveld
@ 2010-09-10 11:29 ` David Relson
2010-09-14 18:28 ` YoYo Siska
0 siblings, 1 reply; 28+ messages in thread
From: David Relson @ 2010-09-10 11:29 UTC (permalink / raw
To: gentoo-user
On Fri, 10 Sep 2010 11:05:12 +0200
J. Roeleveld wrote:
> On Friday 10 September 2010 10:43:30 Jake Moe wrote:
> > On 10/09/2010 5:27 PM, Maciej Grela wrote:
> > > 2010/9/10 Jake Moe<jakesaddress@gmail.com>:
> > >> Hello all,
> > >>
> > >> I've been thinking about creating a Gentoo USB stick for install
> > >> and rescue purposes (and, of course, just to see if I could).
> > >> I've mostly followed the Gentoo handbook (I used a single 4GB
> > >> partition for the whole system, and no swap). I've used
> > >> genkernel for the kernel (so I can have a multi-system capable
> > >> kernel). I've gotten GRUB installed and working. My problem
> > >> comes in after what I believe is the init process:
> > >>
> > >>
> > >> Gentoo Linux; http://www.gentoo.org
> > >>
> > >> Copyright 1999-2009 Gentoo Foundation; Distributed under the
> > >> GPLv2
> > >>
> > >> Press I to enter interactive boot mode
> > >>
> > >> * Mounting proc
> > >> at /proc ... [
> > >>
> > >> ok ]
> > >>
> > >> * Mounting sysfs
> > >> at /sys ... [
> > >>
> > >> ok ]
> > >>
> > >> *
> > >> Mounting /dev ... [
> > >>
> > >> ok ]
> > >>
> > >> * Starting
> > >> udevd ... [
> > >>
> > >> ok ]
> > >>
> > >> * Populating /dev with existing devices through
> > >> uevents ... [
> > >>
> > >> ok ]
> > >>
> > >> * Waiting for uevents to be
> > >> processed ... [
> > >>
> > >> ok ]
> > >>
> > >> * Mounting devpts
> > >> at /dev/pts ... [
> > >>
> > >> ok ]
> > >>
> > >> * Checking root filesystem ...
> > >>
> > >> fsck.ext2: No such file or directory while trying to
> > >> open /dev/sda1 /dev/sda1:
> > >> The superblock could not be read or does not describe a correct
> > >> ext2 filesystem. If the device is valid and it really contains
> > >> an ext2 filesystem (and not swap or ufs or something else), then
> > >> the superblock
> > >>
> > >> is corrupt, and you might try running e2fsck with an alternate
> superblock:
> > >> e2fsck -b 8193<device>
> > >>
> > >> * Filesystem couldn't be
> > >> fixed :( [
> > >>
> > >> !! ]
> > >> Give root password for maintenance
> > >> (or type Control-D to continue):
> > >>
> > >>
> > >> If I give the root password, I can find no /dev/sda1. However,
> > >> mount shows /dev/sda1 on /, and there *is* a /sys/block/sda
> > >> folders, with a sda1 folder in that as well. It's almost like
> > >> it had /dev/sda1, but then lost it somehow.
> > >>
> > >> Does anyone have any idea what's going on here? Any help would
> > >> be appreciated.
> > >
> > > Have you seen http://www.sysresccd.org/Main_Page ? It's based on
> > > Gentoo, you could check what they did to boot from a usb stick.
> > >
> > > Br,
> > > Maciej Grela
> >
> > Excellent, thanks for that, I hadn't found it in my previous
> > searches. I'll have a look there.
> >
> > Jake Moe
>
> Had a similar issue a while ago when I was playing around with this
> myself.
>
> Take a look at the linux boot parameters.
>
> The 'theoretical' part is: You need to let the kernel initialize the
> USB-stick before trying to access it. (This can take some time)
>
> There is a delay-option, just can't remember the proper name off-hand.
>
> --
> Joost
I've got USB booting working in a syslinux environment. A delay of 12
seconds is working for me. The syslinux.cfg stanza I use is:
LABEL usb
KERNEL linux
APPEND rootdelay=12 root=/dev/sda2
HTH,
David
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-10 11:29 ` David Relson
@ 2010-09-14 18:28 ` YoYo Siska
2010-09-14 22:34 ` Jake Moe
0 siblings, 1 reply; 28+ messages in thread
From: YoYo Siska @ 2010-09-14 18:28 UTC (permalink / raw
To: gentoo-user
On Fri, Sep 10, 2010 at 07:29:01AM -0400, David Relson wrote:
> On Fri, 10 Sep 2010 11:05:12 +0200
> J. Roeleveld wrote:
>
> > On Friday 10 September 2010 10:43:30 Jake Moe wrote:
> > > On 10/09/2010 5:27 PM, Maciej Grela wrote:
> > > > 2010/9/10 Jake Moe<jakesaddress@gmail.com>:
> > > >> Hello all,
> > > >>
> > > >> I've been thinking about creating a Gentoo USB stick for install
> > > >> and rescue purposes (and, of course, just to see if I could).
> > > >> I've mostly followed the Gentoo handbook (I used a single 4GB
> > > >> partition for the whole system, and no swap). I've used
> > > >> genkernel for the kernel (so I can have a multi-system capable
> > > >> kernel). I've gotten GRUB installed and working. My problem
> > > >> comes in after what I believe is the init process:
> > > >>
> > > >>
> > > >> Gentoo Linux; http://www.gentoo.org
> > > >>
> > > >> Copyright 1999-2009 Gentoo Foundation; Distributed under the
> > > >> GPLv2
> > > >>
> > > >> Press I to enter interactive boot mode
> > > >>
> > > >> * Mounting proc
> > > >> at /proc ... [
> > > >>
> > > >> ok ]
> > > >>
> > > >> * Mounting sysfs
> > > >> at /sys ... [
> > > >>
> > > >> ok ]
> > > >>
> > > >> *
> > > >> Mounting /dev ... [
> > > >>
> > > >> ok ]
> > > >>
> > > >> * Starting
> > > >> udevd ... [
> > > >>
> > > >> ok ]
> > > >>
> > > >> * Populating /dev with existing devices through
> > > >> uevents ... [
> > > >>
> > > >> ok ]
> > > >>
> > > >> * Waiting for uevents to be
> > > >> processed ... [
> > > >>
> > > >> ok ]
> > > >>
> > > >> * Mounting devpts
> > > >> at /dev/pts ... [
> > > >>
> > > >> ok ]
> > > >>
> > > >> * Checking root filesystem ...
> > > >>
> > > >> fsck.ext2: No such file or directory while trying to
> > > >> open /dev/sda1 /dev/sda1:
> > > >> The superblock could not be read or does not describe a correct
> > > >> ext2 filesystem. If the device is valid and it really contains
> > > >> an ext2 filesystem (and not swap or ufs or something else), then
> > > >> the superblock
> > > >>
> > > >> is corrupt, and you might try running e2fsck with an alternate
> > superblock:
> > > >> e2fsck -b 8193<device>
> > > >>
> > > >> * Filesystem couldn't be
> > > >> fixed :( [
> > > >>
> > > >> !! ]
> > > >> Give root password for maintenance
> > > >> (or type Control-D to continue):
> > > >>
> > > >>
> > > >> If I give the root password, I can find no /dev/sda1. However,
> > > >> mount shows /dev/sda1 on /, and there *is* a /sys/block/sda
> > > >> folders, with a sda1 folder in that as well. It's almost like
> > > >> it had /dev/sda1, but then lost it somehow.
> > > >>
> > > >> Does anyone have any idea what's going on here? Any help would
> > > >> be appreciated.
> > > >
> > > > Have you seen http://www.sysresccd.org/Main_Page ? It's based on
> > > > Gentoo, you could check what they did to boot from a usb stick.
> > > >
> > > > Br,
> > > > Maciej Grela
> > >
> > > Excellent, thanks for that, I hadn't found it in my previous
> > > searches. I'll have a look there.
> > >
> > > Jake Moe
> >
> > Had a similar issue a while ago when I was playing around with this
> > myself.
> >
> > Take a look at the linux boot parameters.
> >
> > The 'theoretical' part is: You need to let the kernel initialize the
> > USB-stick before trying to access it. (This can take some time)
> >
> > There is a delay-option, just can't remember the proper name off-hand.
> >
> > --
> > Joost
>
> I've got USB booting working in a syslinux environment. A delay of 12
> seconds is working for me. The syslinux.cfg stanza I use is:
>
> LABEL usb
> KERNEL linux
> APPEND rootdelay=12 root=/dev/sda2
The usual way for linux on removable usb sticks / disks is to use LABEL
or UUID to identify the disks and not the device names, because they
will be different in different computers ;) The downside is that you
need an initrd to mount the root partition... I think that the usual
initrd generated by genkernel works...
If you created the rootfs with:
mkfs.ext2 -j -LUSBGentoo /dev/sdXY
then you can change the kernel parameter to
root=LABEL=USBGentoo
and your fstab to:
LABEL=USBGentoo / ext3 ...
You can also use the uuid of the filesystem, find it out with
dumpe2fs -h /dev/sdb2 | grep UUID
and then use UUID=XXX instead of LABEL=XXX
I never really played around with grub and USB booting, so I use
syslinux. I create a small FAT partition with syslinux, kernel and
initrd image (it gets also pretty handy when you sometimes need to copy
something from a windows machine ;) and a second "regular" ext3
partition for the rootfs.
Basically you would do:
- partition the stick, mark the FAT partition as bootable/active
- format the partitions:
- mkfs.vfat -nUSBData /dev/sdX1
- mkfs.ext2 -j -LUSBGentoo /dev/sdX2
- install syslinux (on the FAT partition):
- syslinux /dev/sdX1
- mount /dev/sdX2, install gentoo in the usual way
- compile the kernel and initrd, make sure required USB stuff is in the kernel
(theoretically it could be as modules in initrd... but in-kernel is safer :)
if you are in a hurry, or don't know how to create them, get them from
a gentoo livecd ;) don't forget to also copy the modules
(/lib/modules-XXX/...) from the livecd to the rootfs.
- put the kernel and initrd on the FAT partition (I name them vmlinuz.img
and initrd.img)
- edit syslinux.cfg (on the FAT partition), see
http://syslinux.zytor.com/wiki/index.php/SYSLINUX#How_do_I_Configure_SYSLINUX.3F
a very simple one from my USB disk:
DEFAULT linux
LABEL linux
SAY Now booting USBGentoo
KERNEL vmlinuz.img
APPEND root=LABEL=USBGentoo initrd=initrd.img
you might also add rootdelay=10 to the options if the usb stick/disk isn't
detected quick enough
umount, reboot, set the computer to boot from usb, enjoy... ;)
Xorg without a config seems to work pretty well on most computers these
days, IIRC the alsa modules for soundcards are also autoloaded, so you
don't need any fancy hw detection to have a desktop running from USB
stick ;)
yoyo
BTW there is also a "manual" way to boot even without an initrd: use
LABEL=XXX in your fstab, on the kernel command line use root=/dev/sda2
(or whatever you think will be more probable on you machines ;)
then try to boot it, if it is wrong, you can enter the corrent
"root=/dev/sdX2" param in the syslinux prompt (you can either look up the
correct device in the boot messages, or just try sda, sdb, sdc, ... ;)
You could also create menu options for the usual cases... (sda...sdf
shoud be more than enough... ;)
You can however accidentally mount a rootfs from one of the disks on the
computer and thus booting the system on the computer, just with your
kernel...
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-14 18:28 ` YoYo Siska
@ 2010-09-14 22:34 ` Jake Moe
2010-09-15 10:10 ` YoYo Siska
0 siblings, 1 reply; 28+ messages in thread
From: Jake Moe @ 2010-09-14 22:34 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 7586 bytes --]
On 15/09/10 04:28, YoYo Siska wrote:
> On Fri, Sep 10, 2010 at 07:29:01AM -0400, David Relson wrote:
>> On Fri, 10 Sep 2010 11:05:12 +0200
>> J. Roeleveld wrote:
>>
>>> On Friday 10 September 2010 10:43:30 Jake Moe wrote:
>>>> On 10/09/2010 5:27 PM, Maciej Grela wrote:
>>>>> 2010/9/10 Jake Moe<jakesaddress@gmail.com>:
>>>>>> Hello all,
>>>>>>
>>>>>> I've been thinking about creating a Gentoo USB stick for install
>>>>>> and rescue purposes (and, of course, just to see if I could).
>>>>>> I've mostly followed the Gentoo handbook (I used a single 4GB
>>>>>> partition for the whole system, and no swap). I've used
>>>>>> genkernel for the kernel (so I can have a multi-system capable
>>>>>> kernel). I've gotten GRUB installed and working. My problem
>>>>>> comes in after what I believe is the init process:
>>>>>>
>>>>>>
>>>>>> Gentoo Linux; http://www.gentoo.org
>>>>>>
>>>>>> Copyright 1999-2009 Gentoo Foundation; Distributed under the
>>>>>> GPLv2
>>>>>>
>>>>>> Press I to enter interactive boot mode
>>>>>>
>>>>>> * Mounting proc
>>>>>> at /proc ... [
>>>>>>
>>>>>> ok ]
>>>>>>
>>>>>> * Mounting sysfs
>>>>>> at /sys ... [
>>>>>>
>>>>>> ok ]
>>>>>>
>>>>>> *
>>>>>> Mounting /dev ... [
>>>>>>
>>>>>> ok ]
>>>>>>
>>>>>> * Starting
>>>>>> udevd ... [
>>>>>>
>>>>>> ok ]
>>>>>>
>>>>>> * Populating /dev with existing devices through
>>>>>> uevents ... [
>>>>>>
>>>>>> ok ]
>>>>>>
>>>>>> * Waiting for uevents to be
>>>>>> processed ... [
>>>>>>
>>>>>> ok ]
>>>>>>
>>>>>> * Mounting devpts
>>>>>> at /dev/pts ... [
>>>>>>
>>>>>> ok ]
>>>>>>
>>>>>> * Checking root filesystem ...
>>>>>>
>>>>>> fsck.ext2: No such file or directory while trying to
>>>>>> open /dev/sda1 /dev/sda1:
>>>>>> The superblock could not be read or does not describe a correct
>>>>>> ext2 filesystem. If the device is valid and it really contains
>>>>>> an ext2 filesystem (and not swap or ufs or something else), then
>>>>>> the superblock
>>>>>>
>>>>>> is corrupt, and you might try running e2fsck with an alternate
>>> superblock:
>>>>>> e2fsck -b 8193<device>
>>>>>>
>>>>>> * Filesystem couldn't be
>>>>>> fixed :( [
>>>>>>
>>>>>> !! ]
>>>>>> Give root password for maintenance
>>>>>> (or type Control-D to continue):
>>>>>>
>>>>>>
>>>>>> If I give the root password, I can find no /dev/sda1. However,
>>>>>> mount shows /dev/sda1 on /, and there *is* a /sys/block/sda
>>>>>> folders, with a sda1 folder in that as well. It's almost like
>>>>>> it had /dev/sda1, but then lost it somehow.
>>>>>>
>>>>>> Does anyone have any idea what's going on here? Any help would
>>>>>> be appreciated.
>>>>> Have you seen http://www.sysresccd.org/Main_Page ? It's based on
>>>>> Gentoo, you could check what they did to boot from a usb stick.
>>>>>
>>>>> Br,
>>>>> Maciej Grela
>>>> Excellent, thanks for that, I hadn't found it in my previous
>>>> searches. I'll have a look there.
>>>>
>>>> Jake Moe
>>> Had a similar issue a while ago when I was playing around with this
>>> myself.
>>>
>>> Take a look at the linux boot parameters.
>>>
>>> The 'theoretical' part is: You need to let the kernel initialize the
>>> USB-stick before trying to access it. (This can take some time)
>>>
>>> There is a delay-option, just can't remember the proper name off-hand.
>>>
>>> --
>>> Joost
>> I've got USB booting working in a syslinux environment. A delay of 12
>> seconds is working for me. The syslinux.cfg stanza I use is:
>>
>> LABEL usb
>> KERNEL linux
>> APPEND rootdelay=12 root=/dev/sda2
> The usual way for linux on removable usb sticks / disks is to use LABEL
> or UUID to identify the disks and not the device names, because they
> will be different in different computers ;) The downside is that you
> need an initrd to mount the root partition... I think that the usual
> initrd generated by genkernel works...
>
> If you created the rootfs with:
> mkfs.ext2 -j -LUSBGentoo /dev/sdXY
>
> then you can change the kernel parameter to
> root=LABEL=USBGentoo
>
> and your fstab to:
> LABEL=USBGentoo / ext3 ...
>
> You can also use the uuid of the filesystem, find it out with
> dumpe2fs -h /dev/sdb2 | grep UUID
> and then use UUID=XXX instead of LABEL=XXX
>
> I never really played around with grub and USB booting, so I use
> syslinux. I create a small FAT partition with syslinux, kernel and
> initrd image (it gets also pretty handy when you sometimes need to copy
> something from a windows machine ;) and a second "regular" ext3
> partition for the rootfs.
>
> Basically you would do:
> - partition the stick, mark the FAT partition as bootable/active
> - format the partitions:
> - mkfs.vfat -nUSBData /dev/sdX1
> - mkfs.ext2 -j -LUSBGentoo /dev/sdX2
> - install syslinux (on the FAT partition):
> - syslinux /dev/sdX1
> - mount /dev/sdX2, install gentoo in the usual way
> - compile the kernel and initrd, make sure required USB stuff is in the kernel
> (theoretically it could be as modules in initrd... but in-kernel is safer :)
> if you are in a hurry, or don't know how to create them, get them from
> a gentoo livecd ;) don't forget to also copy the modules
> (/lib/modules-XXX/...) from the livecd to the rootfs.
> - put the kernel and initrd on the FAT partition (I name them vmlinuz.img
> and initrd.img)
> - edit syslinux.cfg (on the FAT partition), see
> http://syslinux.zytor.com/wiki/index.php/SYSLINUX#How_do_I_Configure_SYSLINUX.3F
> a very simple one from my USB disk:
>
> DEFAULT linux
> LABEL linux
> SAY Now booting USBGentoo
> KERNEL vmlinuz.img
> APPEND root=LABEL=USBGentoo initrd=initrd.img
>
> you might also add rootdelay=10 to the options if the usb stick/disk isn't
> detected quick enough
>
> umount, reboot, set the computer to boot from usb, enjoy... ;)
> Xorg without a config seems to work pretty well on most computers these
> days, IIRC the alsa modules for soundcards are also autoloaded, so you
> don't need any fancy hw detection to have a desktop running from USB
> stick ;)
>
>
> yoyo
>
>
>
> BTW there is also a "manual" way to boot even without an initrd: use
> LABEL=XXX in your fstab, on the kernel command line use root=/dev/sda2
> (or whatever you think will be more probable on you machines ;)
> then try to boot it, if it is wrong, you can enter the corrent
> "root=/dev/sdX2" param in the syslinux prompt (you can either look up the
> correct device in the boot messages, or just try sda, sdb, sdc, ... ;)
> You could also create menu options for the usual cases... (sda...sdf
> shoud be more than enough... ;)
> You can however accidentally mount a rootfs from one of the disks on the
> computer and thus booting the system on the computer, just with your
> kernel...
>
>
>
>
Thanks for that. I originally tried with "LABEL=UsbRoot" in both GRUB
and fstab, but it couldn't find it, so I put it in a system that I'd
pulled the hard drive from, so I could test if it'd work with /dev/sda
instead. Neither method works; it just doesn't seem to see the USB
storage in /dev. When I try by label, I get what's in the attached error.
I've had a quick look at SYSLINUX (and it's counterpart, EXTLINUX), and
it appears to really be nothing more than another bootloader like LILO
or GRUB. Is that the case? If so, I might try and overwrite GRUB with
EXTLINUX and see if that works; it appears that it should be that easy.
Most of the USB booting doco I can find seems to want SYSLINUX anyway;
maybe I'll give it a try. I had thought that a USB storage device is
storage like anything else, so a "standard" install should work. Maybe
it doesn't...
Jake Moe
[-- Attachment #2: booterr.txt --]
[-- Type: text/plain, Size: 1334 bytes --]
>> Activiating mdev
>> Determining root device...
/init: line 477: blkid: not found\
!! Could not find the root block device in LABEL=UsbRoot.
Please specify another value or: press Enter for hte same, type "shell" for a
shell, or "q" to skip...
root block device(LABEL=UsbRoot) :: /dev/sda1
>> Mounting root...
>> Booting (initramfs)..
INIT: version 2.87 booting
Gentoo Linux; http://www.gentoo.org/
Copyright 1999-2009 Gentoo Foundation; Distributed under teh GPLv2
Press I to enter interactive boot mode
* Mounting proc at /proc ... [ ok ]
* Mounting sysfs at /sys ... [ ok ]
* Mounting /dev ... [ ok ]
* Starting udevd ... [ ok ]
* Populating /dev with existing devices through uevents ... [ ok ]
* Waiting for uevents to be processed ... [ ok ]
* Mounting devpts at /dev/pts ... [ ok ]
* Checking root filesystem ...
fsck.ext2: Unable to resolve 'LABEL=UsbRoot'
* Filesystem couldn't be fixed :( [ !! ]
Give root password for maintenance
(or type Control-D to continue):
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-14 22:34 ` Jake Moe
@ 2010-09-15 10:10 ` YoYo Siska
2010-09-15 22:03 ` Jake Moe
0 siblings, 1 reply; 28+ messages in thread
From: YoYo Siska @ 2010-09-15 10:10 UTC (permalink / raw
To: gentoo-user
On Wed, Sep 15, 2010 at 08:34:33AM +1000, Jake Moe wrote:
> On 15/09/10 04:28, YoYo Siska wrote:
> >On Fri, Sep 10, 2010 at 07:29:01AM -0400, David Relson wrote:
> >>On Fri, 10 Sep 2010 11:05:12 +0200
> >>J. Roeleveld wrote:
> >>
> >>>On Friday 10 September 2010 10:43:30 Jake Moe wrote:
> >>>> On 10/09/2010 5:27 PM, Maciej Grela wrote:
> >>>>>2010/9/10 Jake Moe<jakesaddress@gmail.com>:
> >>>>>> Hello all,
> >>>>>>
> >>>>>>I've been thinking about creating a Gentoo USB stick for install
> >>>>>>and rescue purposes (and, of course, just to see if I could).
> >>>>>>I've mostly followed the Gentoo handbook (I used a single 4GB
> >>>>>>partition for the whole system, and no swap). I've used
> >>>>>>genkernel for the kernel (so I can have a multi-system capable
> >>>>>>kernel). I've gotten GRUB installed and working. My problem
> >>>>>>comes in after what I believe is the init process:
> >>>>>> * Checking root filesystem ...
> >>>>>>
> >>>>>>fsck.ext2: No such file or directory while trying to
> >>>>>>open /dev/sda1 /dev/sda1:
> >>>>>>The superblock could not be read or does not describe a correct
> >>>>>>ext2 filesystem. If the device is valid and it really contains
> >>>>>>an ext2 filesystem (and not swap or ufs or something else), then
> >>>>>>the superblock
> >>>>>>
> >>>>>>is corrupt, and you might try running e2fsck with an alternate
> >>>superblock:
> >>>>>> e2fsck -b 8193<device>
> >>>>>>
> >>>>>> * Filesystem couldn't be
> >>>>>>fixed :( [
> >>>>>>
> >>>>>>!! ]
> >>>>>>Give root password for maintenance
> >>>>>>(or type Control-D to continue):
> >>>>>>
> >>>>>>
> >>>>>>If I give the root password, I can find no /dev/sda1. However,
> >>>>>>mount shows /dev/sda1 on /, and there *is* a /sys/block/sda
> >>>>>>folders, with a sda1 folder in that as well. It's almost like
> >>>>>>it had /dev/sda1, but then lost it somehow.
> >>>>>>
> >>>>>>Does anyone have any idea what's going on here? Any help would
> >>>>>>be appreciated.
> >>>>>Have you seen http://www.sysresccd.org/Main_Page ? It's based on
> >>>>>Gentoo, you could check what they did to boot from a usb stick.
> >>>>>
> >>>>>Br,
> >>>>>Maciej Grela
> >>>>Excellent, thanks for that, I hadn't found it in my previous
> >>>>searches. I'll have a look there.
> >>>>
> >>>>Jake Moe
> >>>Had a similar issue a while ago when I was playing around with this
> >>>myself.
> >>>
> >>>Take a look at the linux boot parameters.
> >>>
> >>>The 'theoretical' part is: You need to let the kernel initialize the
> >>>USB-stick before trying to access it. (This can take some time)
> >>>
> >>>There is a delay-option, just can't remember the proper name off-hand.
> >>>
> >>>--
> >>>Joost
> >>I've got USB booting working in a syslinux environment. A delay of 12
> >>seconds is working for me. The syslinux.cfg stanza I use is:
> >>
> >>LABEL usb
> >>KERNEL linux
> >>APPEND rootdelay=12 root=/dev/sda2
> >The usual way for linux on removable usb sticks / disks is to use LABEL
> >or UUID to identify the disks and not the device names, because they
> >will be different in different computers ;) The downside is that you
> >need an initrd to mount the root partition... I think that the usual
> >initrd generated by genkernel works...
> >
> >If you created the rootfs with:
> >mkfs.ext2 -j -LUSBGentoo /dev/sdXY
> >
> >then you can change the kernel parameter to
> >root=LABEL=USBGentoo
> >
> >and your fstab to:
> >LABEL=USBGentoo / ext3 ...
> >
> >You can also use the uuid of the filesystem, find it out with
> >dumpe2fs -h /dev/sdb2 | grep UUID
> >and then use UUID=XXX instead of LABEL=XXX
> >
> >I never really played around with grub and USB booting, so I use
> >syslinux. I create a small FAT partition with syslinux, kernel and
> >initrd image (it gets also pretty handy when you sometimes need to copy
> >something from a windows machine ;) and a second "regular" ext3
> >partition for the rootfs.
> >
> >Basically you would do:
> >- partition the stick, mark the FAT partition as bootable/active
> >- format the partitions:
> > - mkfs.vfat -nUSBData /dev/sdX1
> > - mkfs.ext2 -j -LUSBGentoo /dev/sdX2
> >- install syslinux (on the FAT partition):
> > - syslinux /dev/sdX1
> >- mount /dev/sdX2, install gentoo in the usual way
> >- compile the kernel and initrd, make sure required USB stuff is in the kernel
> > (theoretically it could be as modules in initrd... but in-kernel is safer :)
> > if you are in a hurry, or don't know how to create them, get them from
> > a gentoo livecd ;) don't forget to also copy the modules
> > (/lib/modules-XXX/...) from the livecd to the rootfs.
> >- put the kernel and initrd on the FAT partition (I name them vmlinuz.img
> > and initrd.img)
> >- edit syslinux.cfg (on the FAT partition), see
> > http://syslinux.zytor.com/wiki/index.php/SYSLINUX#How_do_I_Configure_SYSLINUX.3F
> > a very simple one from my USB disk:
> >
> >DEFAULT linux
> >LABEL linux
> >SAY Now booting USBGentoo
> >KERNEL vmlinuz.img
> >APPEND root=LABEL=USBGentoo initrd=initrd.img
> >
> >you might also add rootdelay=10 to the options if the usb stick/disk isn't
> >detected quick enough
> >
> >umount, reboot, set the computer to boot from usb, enjoy... ;)
> >Xorg without a config seems to work pretty well on most computers these
> >days, IIRC the alsa modules for soundcards are also autoloaded, so you
> >don't need any fancy hw detection to have a desktop running from USB
> >stick ;)
> >
> >
> >yoyo
> >
> >
> >
> >BTW there is also a "manual" way to boot even without an initrd: use
> >LABEL=XXX in your fstab, on the kernel command line use root=/dev/sda2
> >(or whatever you think will be more probable on you machines ;)
> >then try to boot it, if it is wrong, you can enter the corrent
> >"root=/dev/sdX2" param in the syslinux prompt (you can either look up the
> >correct device in the boot messages, or just try sda, sdb, sdc, ... ;)
> >You could also create menu options for the usual cases... (sda...sdf
> >shoud be more than enough... ;)
> >You can however accidentally mount a rootfs from one of the disks on the
> >computer and thus booting the system on the computer, just with your
> >kernel...
> >
> >
> >
> >
> Thanks for that. I originally tried with "LABEL=UsbRoot" in both
> GRUB and fstab, but it couldn't find it, so I put it in a system
> that I'd pulled the hard drive from, so I could test if it'd work
> with /dev/sda instead. Neither method works; it just doesn't seem
> to see the USB storage in /dev. When I try by label, I get what's
> in the attached error.
>
> I've had a quick look at SYSLINUX (and it's counterpart, EXTLINUX),
> and it appears to really be nothing more than another bootloader
> like LILO or GRUB. Is that the case? If so, I might try and
> overwrite GRUB with EXTLINUX and see if that works; it appears that
> it should be that easy. Most of the USB booting doco I can find
> seems to want SYSLINUX anyway; maybe I'll give it a try. I had
> thought that a USB storage device is storage like anything else, so
> a "standard" install should work. Maybe it doesn't...
Yes, syslinux is just another "bootloader" ;) It his however
specifically created for removable disks. I don't know how exactly grub
works and how it handles "removable" disk (ie when the disk appears at
different places) when finding devices for its root partition and the
root option for kernel...
>
> Jake Moe
> >> Activiating mdev
> >> Determining root device...
> /init: line 477: blkid: not found\
seems like your initrd is missing the blkid program (used to determine
the labels and uuids of disks...)
Looking at the genkernel help it seems to ethis option:
--disklabel Include disk label and uuid support in your
ramdisk
> !! Could not find the root block device in LABEL=UsbRoot.
> Please specify another value or: press Enter for hte same, type "shell" for a
> shell, or "q" to skip...
> root block device(LABEL=UsbRoot) :: /dev/sda1
> >> Mounting root...
> >> Booting (initramfs)..
> INIT: version 2.87 booting
>
> Gentoo Linux; http://www.gentoo.org/
> Copyright 1999-2009 Gentoo Foundation; Distributed under teh GPLv2
>
> Press I to enter interactive boot mode
>
> * Mounting proc at /proc ... [ ok ]
> * Mounting sysfs at /sys ... [ ok ]
> * Mounting /dev ... [ ok ]
> * Starting udevd ... [ ok ]
> * Populating /dev with existing devices through uevents ... [ ok ]
> * Waiting for uevents to be processed ... [ ok ]
> * Mounting devpts at /dev/pts ... [ ok ]
> * Checking root filesystem ...
> fsck.ext2: Unable to resolve 'LABEL=UsbRoot'
This means fsck was unable to find the filesystem with that label.
You can use dumpe2fs /dev/yourpartition to check if the filesystem
really has the cooret label (look for "Filesystem volume name" at the
top)
> * Filesystem couldn't be fixed :( [ !! ]
> Give root password for maintenance
> (or type Control-D to continue):
yoyo
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-15 10:10 ` YoYo Siska
@ 2010-09-15 22:03 ` Jake Moe
2010-09-15 22:18 ` Al
2010-09-15 22:26 ` Dale
0 siblings, 2 replies; 28+ messages in thread
From: Jake Moe @ 2010-09-15 22:03 UTC (permalink / raw
To: gentoo-user
On 15/09/10 20:10, YoYo Siska wrote:
> On Wed, Sep 15, 2010 at 08:34:33AM +1000, Jake Moe wrote:
>> On 15/09/10 04:28, YoYo Siska wrote:
>>> On Fri, Sep 10, 2010 at 07:29:01AM -0400, David Relson wrote:
>>>> On Fri, 10 Sep 2010 11:05:12 +0200
>>>> J. Roeleveld wrote:
>>>>
>>>>> On Friday 10 September 2010 10:43:30 Jake Moe wrote:
>>>>>> On 10/09/2010 5:27 PM, Maciej Grela wrote:
>>>>>>> 2010/9/10 Jake Moe<jakesaddress@gmail.com>:
>>>>>>>> Hello all,
>>>>>>>>
>>>>>>>> I've been thinking about creating a Gentoo USB stick for install
>>>>>>>> and rescue purposes (and, of course, just to see if I could).
>>>>>>>> I've mostly followed the Gentoo handbook (I used a single 4GB
>>>>>>>> partition for the whole system, and no swap). I've used
>>>>>>>> genkernel for the kernel (so I can have a multi-system capable
>>>>>>>> kernel). I've gotten GRUB installed and working. My problem
>>>>>>>> comes in after what I believe is the init process:
>>>>>>>> * Checking root filesystem ...
>>>>>>>>
>>>>>>>> fsck.ext2: No such file or directory while trying to
>>>>>>>> open /dev/sda1 /dev/sda1:
>>>>>>>> The superblock could not be read or does not describe a correct
>>>>>>>> ext2 filesystem. If the device is valid and it really contains
>>>>>>>> an ext2 filesystem (and not swap or ufs or something else), then
>>>>>>>> the superblock
>>>>>>>>
>>>>>>>> is corrupt, and you might try running e2fsck with an alternate
>>>>> superblock:
>>>>>>>> e2fsck -b 8193<device>
>>>>>>>>
>>>>>>>> * Filesystem couldn't be
>>>>>>>> fixed :( [
>>>>>>>>
>>>>>>>> !! ]
>>>>>>>> Give root password for maintenance
>>>>>>>> (or type Control-D to continue):
>>>>>>>>
>>>>>>>>
>>>>>>>> If I give the root password, I can find no /dev/sda1. However,
>>>>>>>> mount shows /dev/sda1 on /, and there *is* a /sys/block/sda
>>>>>>>> folders, with a sda1 folder in that as well. It's almost like
>>>>>>>> it had /dev/sda1, but then lost it somehow.
>>>>>>>>
>>>>>>>> Does anyone have any idea what's going on here? Any help would
>>>>>>>> be appreciated.
>>>>>>> Have you seen http://www.sysresccd.org/Main_Page ? It's based on
>>>>>>> Gentoo, you could check what they did to boot from a usb stick.
>>>>>>>
>>>>>>> Br,
>>>>>>> Maciej Grela
>>>>>> Excellent, thanks for that, I hadn't found it in my previous
>>>>>> searches. I'll have a look there.
>>>>>>
>>>>>> Jake Moe
>>>>> Had a similar issue a while ago when I was playing around with this
>>>>> myself.
>>>>>
>>>>> Take a look at the linux boot parameters.
>>>>>
>>>>> The 'theoretical' part is: You need to let the kernel initialize the
>>>>> USB-stick before trying to access it. (This can take some time)
>>>>>
>>>>> There is a delay-option, just can't remember the proper name off-hand.
>>>>>
>>>>> --
>>>>> Joost
>>>> I've got USB booting working in a syslinux environment. A delay of 12
>>>> seconds is working for me. The syslinux.cfg stanza I use is:
>>>>
>>>> LABEL usb
>>>> KERNEL linux
>>>> APPEND rootdelay=12 root=/dev/sda2
>>> The usual way for linux on removable usb sticks / disks is to use LABEL
>>> or UUID to identify the disks and not the device names, because they
>>> will be different in different computers ;) The downside is that you
>>> need an initrd to mount the root partition... I think that the usual
>>> initrd generated by genkernel works...
>>>
>>> If you created the rootfs with:
>>> mkfs.ext2 -j -LUSBGentoo /dev/sdXY
>>>
>>> then you can change the kernel parameter to
>>> root=LABEL=USBGentoo
>>>
>>> and your fstab to:
>>> LABEL=USBGentoo / ext3 ...
>>>
>>> You can also use the uuid of the filesystem, find it out with
>>> dumpe2fs -h /dev/sdb2 | grep UUID
>>> and then use UUID=XXX instead of LABEL=XXX
>>>
>>> I never really played around with grub and USB booting, so I use
>>> syslinux. I create a small FAT partition with syslinux, kernel and
>>> initrd image (it gets also pretty handy when you sometimes need to copy
>>> something from a windows machine ;) and a second "regular" ext3
>>> partition for the rootfs.
>>>
>>> Basically you would do:
>>> - partition the stick, mark the FAT partition as bootable/active
>>> - format the partitions:
>>> - mkfs.vfat -nUSBData /dev/sdX1
>>> - mkfs.ext2 -j -LUSBGentoo /dev/sdX2
>>> - install syslinux (on the FAT partition):
>>> - syslinux /dev/sdX1
>>> - mount /dev/sdX2, install gentoo in the usual way
>>> - compile the kernel and initrd, make sure required USB stuff is in the kernel
>>> (theoretically it could be as modules in initrd... but in-kernel is safer :)
>>> if you are in a hurry, or don't know how to create them, get them from
>>> a gentoo livecd ;) don't forget to also copy the modules
>>> (/lib/modules-XXX/...) from the livecd to the rootfs.
>>> - put the kernel and initrd on the FAT partition (I name them vmlinuz.img
>>> and initrd.img)
>>> - edit syslinux.cfg (on the FAT partition), see
>>> http://syslinux.zytor.com/wiki/index.php/SYSLINUX#How_do_I_Configure_SYSLINUX.3F
>>> a very simple one from my USB disk:
>>>
>>> DEFAULT linux
>>> LABEL linux
>>> SAY Now booting USBGentoo
>>> KERNEL vmlinuz.img
>>> APPEND root=LABEL=USBGentoo initrd=initrd.img
>>>
>>> you might also add rootdelay=10 to the options if the usb stick/disk isn't
>>> detected quick enough
>>>
>>> umount, reboot, set the computer to boot from usb, enjoy... ;)
>>> Xorg without a config seems to work pretty well on most computers these
>>> days, IIRC the alsa modules for soundcards are also autoloaded, so you
>>> don't need any fancy hw detection to have a desktop running from USB
>>> stick ;)
>>>
>>>
>>> yoyo
>>>
>>>
>>>
>>> BTW there is also a "manual" way to boot even without an initrd: use
>>> LABEL=XXX in your fstab, on the kernel command line use root=/dev/sda2
>>> (or whatever you think will be more probable on you machines ;)
>>> then try to boot it, if it is wrong, you can enter the corrent
>>> "root=/dev/sdX2" param in the syslinux prompt (you can either look up the
>>> correct device in the boot messages, or just try sda, sdb, sdc, ... ;)
>>> You could also create menu options for the usual cases... (sda...sdf
>>> shoud be more than enough... ;)
>>> You can however accidentally mount a rootfs from one of the disks on the
>>> computer and thus booting the system on the computer, just with your
>>> kernel...
>>>
>>>
>>>
>>>
>> Thanks for that. I originally tried with "LABEL=UsbRoot" in both
>> GRUB and fstab, but it couldn't find it, so I put it in a system
>> that I'd pulled the hard drive from, so I could test if it'd work
>> with /dev/sda instead. Neither method works; it just doesn't seem
>> to see the USB storage in /dev. When I try by label, I get what's
>> in the attached error.
>>
>> I've had a quick look at SYSLINUX (and it's counterpart, EXTLINUX),
>> and it appears to really be nothing more than another bootloader
>> like LILO or GRUB. Is that the case? If so, I might try and
>> overwrite GRUB with EXTLINUX and see if that works; it appears that
>> it should be that easy. Most of the USB booting doco I can find
>> seems to want SYSLINUX anyway; maybe I'll give it a try. I had
>> thought that a USB storage device is storage like anything else, so
>> a "standard" install should work. Maybe it doesn't...
> Yes, syslinux is just another "bootloader" ;) It his however
> specifically created for removable disks. I don't know how exactly grub
> works and how it handles "removable" disk (ie when the disk appears at
> different places) when finding devices for its root partition and the
> root option for kernel...
>
>> Jake Moe
>>>> Activiating mdev
>>>> Determining root device...
>> /init: line 477: blkid: not found\
> seems like your initrd is missing the blkid program (used to determine
> the labels and uuids of disks...)
> Looking at the genkernel help it seems to ethis option:
> --disklabel Include disk label and uuid support in your
> ramdisk
>
>> !! Could not find the root block device in LABEL=UsbRoot.
>> Please specify another value or: press Enter for hte same, type "shell" for a
>> shell, or "q" to skip...
>> root block device(LABEL=UsbRoot) :: /dev/sda1
>>>> Mounting root...
>>>> Booting (initramfs)..
>> INIT: version 2.87 booting
>>
>> Gentoo Linux; http://www.gentoo.org/
>> Copyright 1999-2009 Gentoo Foundation; Distributed under teh GPLv2
>>
>> Press I to enter interactive boot mode
>>
>> * Mounting proc at /proc ... [ ok ]
>> * Mounting sysfs at /sys ... [ ok ]
>> * Mounting /dev ... [ ok ]
>> * Starting udevd ... [ ok ]
>> * Populating /dev with existing devices through uevents ... [ ok ]
>> * Waiting for uevents to be processed ... [ ok ]
>> * Mounting devpts at /dev/pts ... [ ok ]
>> * Checking root filesystem ...
>> fsck.ext2: Unable to resolve 'LABEL=UsbRoot'
> This means fsck was unable to find the filesystem with that label.
> You can use dumpe2fs /dev/yourpartition to check if the filesystem
> really has the cooret label (look for "Filesystem volume name" at the
> top)
>
>> * Filesystem couldn't be fixed :( [ !! ]
>> Give root password for maintenance
>> (or type Control-D to continue):
> yoyo
>
Thanks for that, I'll rebuild the genkernel with blkid support.
As to the second suggestion, there is *no* /dev/sda1 (the partition in
question). It just doesn't exist for some reason. However, fstab shows
that it's mounted, and /sys/block has entries for the disk, so I'm not
sure why it's dropped out. I'm guessing it has something to do with
udevd, or uevents? Because shortly before that, I tell it to find the
root partition at /dev/sda1, and it starts to boot, but then it loses it.
Jake Moe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-15 22:03 ` Jake Moe
@ 2010-09-15 22:18 ` Al
2010-09-15 22:43 ` Jake Moe
2010-09-15 22:26 ` Dale
1 sibling, 1 reply; 28+ messages in thread
From: Al @ 2010-09-15 22:18 UTC (permalink / raw
To: gentoo-user
>
> As to the second suggestion, there is *no* /dev/sda1 (the partition in
> question). It just doesn't exist for some reason. However, fstab shows
> that it's mounted, and /sys/block has entries for the disk, so I'm not
> sure why it's dropped out. I'm guessing it has something to do with
> udevd, or uevents? Because shortly before that, I tell it to find the
> root partition at /dev/sda1, and it starts to boot, but then it loses it.
>
What is that in concrete, it starts? What do you see, hear, smell?
Al
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-15 22:03 ` Jake Moe
2010-09-15 22:18 ` Al
@ 2010-09-15 22:26 ` Dale
2010-09-15 22:34 ` Jake Moe
1 sibling, 1 reply; 28+ messages in thread
From: Dale @ 2010-09-15 22:26 UTC (permalink / raw
To: gentoo-user
Jake Moe wrote:
> Thanks for that, I'll rebuild the genkernel with blkid support.
>
> As to the second suggestion, there is *no* /dev/sda1 (the partition in
> question). It just doesn't exist for some reason. However, fstab shows
> that it's mounted, and /sys/block has entries for the disk, so I'm not
> sure why it's dropped out. I'm guessing it has something to do with
> udevd, or uevents? Because shortly before that, I tell it to find the
> root partition at /dev/sda1, and it starts to boot, but then it loses it.
>
> Jake Moe
>
>
The file fstab doesn't show what is mounted. Either use the command
"mount" with no options or cat /etc/mtab to see what is actually mounted.
Dale
:-) :-)
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-15 22:26 ` Dale
@ 2010-09-15 22:34 ` Jake Moe
2010-09-16 6:22 ` J. Roeleveld
0 siblings, 1 reply; 28+ messages in thread
From: Jake Moe @ 2010-09-15 22:34 UTC (permalink / raw
To: gentoo-user
On 16/09/10 08:26, Dale wrote:
> Jake Moe wrote:
>> Thanks for that, I'll rebuild the genkernel with blkid support.
>>
>> As to the second suggestion, there is *no* /dev/sda1 (the partition in
>> question). It just doesn't exist for some reason. However, fstab shows
>> that it's mounted, and /sys/block has entries for the disk, so I'm not
>> sure why it's dropped out. I'm guessing it has something to do with
>> udevd, or uevents? Because shortly before that, I tell it to find the
>> root partition at /dev/sda1, and it starts to boot, but then it loses
>> it.
>>
>> Jake Moe
>>
>>
>
> The file fstab doesn't show what is mounted. Either use the command
> "mount" with no options or cat /etc/mtab to see what is actually mounted.
>
> Dale
>
> :-) :-)
>
Gah, it's too early. That's what I meant to say (and previously said in
my original post): when I run "mount", it shows /dev/sda1 is mounted on /.
Jake Moe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-15 22:18 ` Al
@ 2010-09-15 22:43 ` Jake Moe
2010-09-15 23:04 ` Al
0 siblings, 1 reply; 28+ messages in thread
From: Jake Moe @ 2010-09-15 22:43 UTC (permalink / raw
To: gentoo-user
On 16/09/10 08:18, Al wrote:
>> As to the second suggestion, there is *no* /dev/sda1 (the partition in
>> question). It just doesn't exist for some reason. However, fstab shows
>> that it's mounted, and /sys/block has entries for the disk, so I'm not
>> sure why it's dropped out. I'm guessing it has something to do with
>> udevd, or uevents? Because shortly before that, I tell it to find the
>> root partition at /dev/sda1, and it starts to boot, but then it loses it.
>>
> What is that in concrete, it starts? What do you see, hear, smell?
>
> Al
>
I'm not sure what you're asking. Can you elaborate as to what you're
asking?
As I'm in an office, there is no concrete nearby for anything to be in.
I see my monitor, I hear my mp3's playing, and I smell my peppermint
tea. But I'm pretty sure that's not what you're asking me. :-P
If you're asking what, specifically, I mean by "it starts", my previous
posts show how far into the boot process it gets. If I specify by
/dev/sda1, eventually it gets to checking that partition for errors, but
fails to find the partition. If I specify by LABEL, then it tells me it
can't find the label a bit earlier in the boot process, and asks where
it can find the root partition. When I tell it /dev/sda1, it continues
to boot, only to stop again at fsck'ing the partition. If I put in the
root password for maintenance and have a look, there is no /dev/sda or
/dev/sda1 in /dev (nor /dev/hd?, nor /dev/sr?). But a "mount" command
shows /dev/sda1 mounted at /. And /sys/block has sda and under that,
sda1. So it's like it sees it, but then it doesn't.
Following the sugegstion from YoYo Siska, I've had a look at the various
options I can pass to genkernel (I had followed the handbook previously,
and hadn't realized there were options I could pass), and am currently
rebuilding it with the following command: "genkernel --install --slowusb
--disklabel all". YoYo pointed out that there was a --disklabel option
to pass that'd add disk label support to the kernel, and I noticed the
--slowusb option that, from my research, sounds like it may have
something to do with my problem. Will let you know after I try that
what the results are.
Jake Moe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-15 22:43 ` Jake Moe
@ 2010-09-15 23:04 ` Al
2010-09-16 0:21 ` Jake Moe
0 siblings, 1 reply; 28+ messages in thread
From: Al @ 2010-09-15 23:04 UTC (permalink / raw
To: gentoo-user
> As I'm in an office, there is no concrete nearby for anything to be in.
Lol. Well, there are some other meanings in the latin word concretus.
The didn't even have that bleak modern material. We have a different
name for it in german and use concretus more in the original sense.
>
> If you're asking what, specifically, I mean by "it starts", my previous
> posts show how far into the boot process it gets. If I specify by
> /dev/sda1, eventually it gets to checking that partition for errors, but
> fails to find the partition. If I specify by LABEL, then it tells me it
I am still asking myself, if it is the USB stick at all that you see
starting. Couldn't it be a kernel from the inbuild hard disk? ... wich
you would *hear* in that case ... maybe even smell or feel ...
Hence I ask you if there linux kernel on the first or second partition
of your disk.
Al
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-15 23:04 ` Al
@ 2010-09-16 0:21 ` Jake Moe
2010-09-16 11:08 ` Al
0 siblings, 1 reply; 28+ messages in thread
From: Jake Moe @ 2010-09-16 0:21 UTC (permalink / raw
To: gentoo-user
On 16/09/10 09:04, Al wrote:
>> As I'm in an office, there is no concrete nearby for anything to be in.
> Lol. Well, there are some other meanings in the latin word concretus.
> The didn't even have that bleak modern material. We have a different
> name for it in german and use concretus more in the original sense.
>
>> If you're asking what, specifically, I mean by "it starts", my previous
>> posts show how far into the boot process it gets. If I specify by
>> /dev/sda1, eventually it gets to checking that partition for errors, but
>> fails to find the partition. If I specify by LABEL, then it tells me it
> I am still asking myself, if it is the USB stick at all that you see
> starting. Couldn't it be a kernel from the inbuild hard disk? ... wich
> you would *hear* in that case ... maybe even smell or feel ...
>
> Hence I ask you if there linux kernel on the first or second partition
> of your disk.
>
> Al
>
Ah, I see. For this test, I have a second PC that I've unplugged the
hard drive from. And it's hard drive currently has a work Windows image
on it, anyway, so it's definitely not booting from that. :-)
I also have finished my new kernel. It now recognizes the root device
by label, but still hangs on the fsck. Any more bright ideas? Surely
someone has done this already; I can't be the first to try it. Hasn't
someone else put a Gentoo install on a USB stick?
If I'm correct in my assumptions, it sounds as though GRUB and the
kernel are seeing it right, but something in the Gentoo init scripts is
breaking it. Can anyone even comment if that assumption is correct?
I'm not entirely clear on genkernel and the initramfs it provides, and
at what step each of these takes effect.
Jake Moe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-15 22:34 ` Jake Moe
@ 2010-09-16 6:22 ` J. Roeleveld
2010-09-16 10:01 ` Jake Moe
0 siblings, 1 reply; 28+ messages in thread
From: J. Roeleveld @ 2010-09-16 6:22 UTC (permalink / raw
To: gentoo-user
On Thursday 16 September 2010 00:34:39 Jake Moe wrote:
> On 16/09/10 08:26, Dale wrote:
> > Jake Moe wrote:
> >> Thanks for that, I'll rebuild the genkernel with blkid support.
> >>
> >> As to the second suggestion, there is *no* /dev/sda1 (the partition in
> >> question). It just doesn't exist for some reason. However, fstab shows
> >> that it's mounted, and /sys/block has entries for the disk, so I'm not
> >> sure why it's dropped out. I'm guessing it has something to do with
> >> udevd, or uevents? Because shortly before that, I tell it to find the
> >> root partition at /dev/sda1, and it starts to boot, but then it loses
> >> it.
> >>
> >> Jake Moe
> >
> > The file fstab doesn't show what is mounted. Either use the command
> > "mount" with no options or cat /etc/mtab to see what is actually mounted.
> >
> > Dale
> >
> > :-) :-)
>
> Gah, it's too early. That's what I meant to say (and previously said in
> my original post): when I run "mount", it shows /dev/sda1 is mounted on /.
>
> Jake Moe
I wonder if it looses the "/dev" tree when it mounts the root-partition read
only prior to running the fsck.
That could explain why it's not there.
Try building a dummy /dev-tree on your root partition with the correct device-
nodes hardcoded for /dev/sdxxxxxx and see how far you get then?
--
Joost
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-16 6:22 ` J. Roeleveld
@ 2010-09-16 10:01 ` Jake Moe
2010-09-16 11:30 ` J. Roeleveld
0 siblings, 1 reply; 28+ messages in thread
From: Jake Moe @ 2010-09-16 10:01 UTC (permalink / raw
To: gentoo-user
On 09/16/10 16:22, J. Roeleveld wrote:
> On Thursday 16 September 2010 00:34:39 Jake Moe wrote:
>> On 16/09/10 08:26, Dale wrote:
>>> Jake Moe wrote:
>>>> Thanks for that, I'll rebuild the genkernel with blkid support.
>>>>
>>>> As to the second suggestion, there is *no* /dev/sda1 (the partition in
>>>> question). It just doesn't exist for some reason. However, fstab shows
>>>> that it's mounted, and /sys/block has entries for the disk, so I'm not
>>>> sure why it's dropped out. I'm guessing it has something to do with
>>>> udevd, or uevents? Because shortly before that, I tell it to find the
>>>> root partition at /dev/sda1, and it starts to boot, but then it loses
>>>> it.
>>>>
>>>> Jake Moe
>>> The file fstab doesn't show what is mounted. Either use the command
>>> "mount" with no options or cat /etc/mtab to see what is actually mounted.
>>>
>>> Dale
>>>
>>> :-) :-)
>> Gah, it's too early. That's what I meant to say (and previously said in
>> my original post): when I run "mount", it shows /dev/sda1 is mounted on /.
>>
>> Jake Moe
> I wonder if it looses the "/dev" tree when it mounts the root-partition read
> only prior to running the fsck.
> That could explain why it's not there.
>
> Try building a dummy /dev-tree on your root partition with the correct device-
> nodes hardcoded for /dev/sdxxxxxx and see how far you get then?
>
> --
> Joost
>
Erm, you've gone a bit beyond my knowledge there. Are you saying I
should go into the maintenance console, create a dummy /devdir, and try
to mknod the hard drive? I assume I'd use something like 'mknod
/dev/sda c 8 0'? If not, what do you mean, cause you've lost me.
Jake Moe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-16 0:21 ` Jake Moe
@ 2010-09-16 11:08 ` Al
0 siblings, 0 replies; 28+ messages in thread
From: Al @ 2010-09-16 11:08 UTC (permalink / raw
To: gentoo-user
> Ah, I see. For this test, I have a second PC that I've unplugged the
> hard drive from. And it's hard drive currently has a work Windows image
> on it, anyway, so it's definitely not booting from that. :-)
>
I assume you have already tested it with a different USB stick and on
the other machine, so that you can exclude hardware issues?
Al
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-16 10:01 ` Jake Moe
@ 2010-09-16 11:30 ` J. Roeleveld
2010-09-21 5:35 ` Jake Moe
0 siblings, 1 reply; 28+ messages in thread
From: J. Roeleveld @ 2010-09-16 11:30 UTC (permalink / raw
To: gentoo-user
On Thursday 16 September 2010 12:01:43 Jake Moe wrote:
> On 09/16/10 16:22, J. Roeleveld wrote:
> > On Thursday 16 September 2010 00:34:39 Jake Moe wrote:
> >> On 16/09/10 08:26, Dale wrote:
> >>> Jake Moe wrote:
> >>>> Thanks for that, I'll rebuild the genkernel with blkid support.
> >>>>
> >>>> As to the second suggestion, there is *no* /dev/sda1 (the partition in
> >>>> question). It just doesn't exist for some reason. However, fstab
> >>>> shows that it's mounted, and /sys/block has entries for the disk, so
> >>>> I'm not sure why it's dropped out. I'm guessing it has something to
> >>>> do with udevd, or uevents? Because shortly before that, I tell it to
> >>>> find the root partition at /dev/sda1, and it starts to boot, but then
> >>>> it loses it.
> >>>>
> >>>> Jake Moe
> >>>
> >>> The file fstab doesn't show what is mounted. Either use the command
> >>> "mount" with no options or cat /etc/mtab to see what is actually
> >>> mounted.
> >>>
> >>> Dale
> >>>
> >>> :-) :-)
> >>
> >> Gah, it's too early. That's what I meant to say (and previously said in
> >> my original post): when I run "mount", it shows /dev/sda1 is mounted on
> >> /.
> >>
> >> Jake Moe
> >
> > I wonder if it looses the "/dev" tree when it mounts the root-partition
> > read only prior to running the fsck.
> > That could explain why it's not there.
> >
> > Try building a dummy /dev-tree on your root partition with the correct
> > device- nodes hardcoded for /dev/sdxxxxxx and see how far you get then?
> >
> > --
> > Joost
>
> Erm, you've gone a bit beyond my knowledge there. Are you saying I
> should go into the maintenance console, create a dummy /devdir, and try
> to mknod the hard drive? I assume I'd use something like 'mknod
> /dev/sda c 8 0'? If not, what do you mean, cause you've lost me.
>
> Jake Moe
Ok, what I mean is that I think the following might happen:
1) root-dir from ramdisk is mounted under /
2) dev-tree is mounted under /dev
3) /dev/sda1 is mounted under /
4) at this point, /dev might no longer be accessible.
Now, if you make sure that on the USB-root (/dev/sda1) the folder /dev is
actually populated, then it might continue through the boot-process.
Or, as you mentioned, issue "mknod ......." commands while in that
maintenance console, then it might be able to find the /dev/sda, /dev/sda1,...
devices and continue.
Please bear in mind, I have not actually used nor needed a ramdisk to boot
from ever since I started using Gentoo.
Not even when I played with booting from USB-sticks myself.
I simply build the kernel with all the necessary drivers compiled-in and used
that to boot from.
This might also be an idea for you?
--
Joost
Eg. if you do the mknod-commands to build the /dev/sda, /dev/sda1,.... device
nodes, then it should be able to continue.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-16 11:30 ` J. Roeleveld
@ 2010-09-21 5:35 ` Jake Moe
2010-09-21 7:26 ` J. Roeleveld
0 siblings, 1 reply; 28+ messages in thread
From: Jake Moe @ 2010-09-21 5:35 UTC (permalink / raw
To: gentoo-user
On 16/09/10 21:30, J. Roeleveld wrote:
> On Thursday 16 September 2010 12:01:43 Jake Moe wrote:
>> On 09/16/10 16:22, J. Roeleveld wrote:
>>> On Thursday 16 September 2010 00:34:39 Jake Moe wrote:
>>>> On 16/09/10 08:26, Dale wrote:
>>>>> Jake Moe wrote:
>>>>>> Thanks for that, I'll rebuild the genkernel with blkid support.
>>>>>>
>>>>>> As to the second suggestion, there is *no* /dev/sda1 (the partition in
>>>>>> question). It just doesn't exist for some reason. However, fstab
>>>>>> shows that it's mounted, and /sys/block has entries for the disk, so
>>>>>> I'm not sure why it's dropped out. I'm guessing it has something to
>>>>>> do with udevd, or uevents? Because shortly before that, I tell it to
>>>>>> find the root partition at /dev/sda1, and it starts to boot, but then
>>>>>> it loses it.
>>>>>>
>>>>>> Jake Moe
>>>>> The file fstab doesn't show what is mounted. Either use the command
>>>>> "mount" with no options or cat /etc/mtab to see what is actually
>>>>> mounted.
>>>>>
>>>>> Dale
>>>>>
>>>>> :-) :-)
>>>> Gah, it's too early. That's what I meant to say (and previously said in
>>>> my original post): when I run "mount", it shows /dev/sda1 is mounted on
>>>> /.
>>>>
>>>> Jake Moe
>>> I wonder if it looses the "/dev" tree when it mounts the root-partition
>>> read only prior to running the fsck.
>>> That could explain why it's not there.
>>>
>>> Try building a dummy /dev-tree on your root partition with the correct
>>> device- nodes hardcoded for /dev/sdxxxxxx and see how far you get then?
>>>
>>> --
>>> Joost
>> Erm, you've gone a bit beyond my knowledge there. Are you saying I
>> should go into the maintenance console, create a dummy /devdir, and try
>> to mknod the hard drive? I assume I'd use something like 'mknod
>> /dev/sda c 8 0'? If not, what do you mean, cause you've lost me.
>>
>> Jake Moe
> Ok, what I mean is that I think the following might happen:
>
> 1) root-dir from ramdisk is mounted under /
> 2) dev-tree is mounted under /dev
> 3) /dev/sda1 is mounted under /
> 4) at this point, /dev might no longer be accessible.
>
> Now, if you make sure that on the USB-root (/dev/sda1) the folder /dev is
> actually populated, then it might continue through the boot-process.
>
> Or, as you mentioned, issue "mknod ......." commands while in that
> maintenance console, then it might be able to find the /dev/sda, /dev/sda1,...
> devices and continue.
>
> Please bear in mind, I have not actually used nor needed a ramdisk to boot
> from ever since I started using Gentoo.
> Not even when I played with booting from USB-sticks myself.
> I simply build the kernel with all the necessary drivers compiled-in and used
> that to boot from.
>
> This might also be an idea for you?
>
> --
> Joost
>
> Eg. if you do the mknod-commands to build the /dev/sda, /dev/sda1,.... device
> nodes, then it should be able to continue.
>
Well, I've finally gotten this to work with a manually config'ed
kernel. Before, I was only getting kernel panics. Now, after your
comment "all compiled-in", I took the old config I tried, did a sed to
change all "=m" to "=y", and recompiled, and it worked. So obviously,
there was some option that I wasn't building into the kernel (only as a
module) that was needed to start from USB.
I had previously started from a working config I had previously used for
the same model PC that I was doing my testing on, and just changed the
USB drivers from modules to built-in, but apparently that's not enough.
Any ideas what else is needed for a USB-stick boot that's not needed in
a SATA boot? I'd like to a) find out what I missed, and b) be able to
cull the kernel back down again, so I can build up lots of SATA,
graphics and audio modules to make this able to boot (and work properly)
on other systems.
Jake Moe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-21 5:35 ` Jake Moe
@ 2010-09-21 7:26 ` J. Roeleveld
2010-09-22 4:36 ` Jake Moe
0 siblings, 1 reply; 28+ messages in thread
From: J. Roeleveld @ 2010-09-21 7:26 UTC (permalink / raw
To: gentoo-user
On Tuesday 21 September 2010 07:35:13 Jake Moe wrote:
> On 16/09/10 21:30, J. Roeleveld wrote:
<snipped old stuff>
> > Please bear in mind, I have not actually used nor needed a ramdisk to
> > boot from ever since I started using Gentoo.
> > Not even when I played with booting from USB-sticks myself.
> > I simply build the kernel with all the necessary drivers compiled-in and
> > used that to boot from.
> >
> > This might also be an idea for you?
> >
> > --
> > Joost
> >
> > Eg. if you do the mknod-commands to build the /dev/sda, /dev/sda1,....
> > device nodes, then it should be able to continue.
>
> Well, I've finally gotten this to work with a manually config'ed
> kernel. Before, I was only getting kernel panics. Now, after your
> comment "all compiled-in", I took the old config I tried, did a sed to
> change all "=m" to "=y", and recompiled, and it worked. So obviously,
> there was some option that I wasn't building into the kernel (only as a
> module) that was needed to start from USB.
That's generally a good way to start, stick everything in the kernel :)
> I had previously started from a working config I had previously used for
> the same model PC that I was doing my testing on, and just changed the
> USB drivers from modules to built-in, but apparently that's not enough.
> Any ideas what else is needed for a USB-stick boot that's not needed in
> a SATA boot? I'd like to a) find out what I missed, and b) be able to
> cull the kernel back down again, so I can build up lots of SATA,
> graphics and audio modules to make this able to boot (and work properly)
> on other systems.
Ok, doing this from memory here.
To be able to boot from USB, you need (additionally to what you normally
have):
1) USB Host drivers (OHCI,UHCI,EHCI,...)
2) USB Mass Storage
3) file system on the USB-stick
4) SCSI-disk (USB Mass storage depends on this)
If others can also have a quick look on this list to check that I didn't miss
anything?
--
Joost
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-21 7:26 ` J. Roeleveld
@ 2010-09-22 4:36 ` Jake Moe
2010-09-22 7:02 ` Al
2010-09-22 7:16 ` J. Roeleveld
0 siblings, 2 replies; 28+ messages in thread
From: Jake Moe @ 2010-09-22 4:36 UTC (permalink / raw
To: gentoo-user
On 21/09/10 17:26, J. Roeleveld wrote:
> On Tuesday 21 September 2010 07:35:13 Jake Moe wrote:
>> On 16/09/10 21:30, J. Roeleveld wrote:
> <snipped old stuff>
>
>>> Please bear in mind, I have not actually used nor needed a ramdisk to
>>> boot from ever since I started using Gentoo.
>>> Not even when I played with booting from USB-sticks myself.
>>> I simply build the kernel with all the necessary drivers compiled-in and
>>> used that to boot from.
>>>
>>> This might also be an idea for you?
>>>
>>> --
>>> Joost
>>>
>>> Eg. if you do the mknod-commands to build the /dev/sda, /dev/sda1,....
>>> device nodes, then it should be able to continue.
>> Well, I've finally gotten this to work with a manually config'ed
>> kernel. Before, I was only getting kernel panics. Now, after your
>> comment "all compiled-in", I took the old config I tried, did a sed to
>> change all "=m" to "=y", and recompiled, and it worked. So obviously,
>> there was some option that I wasn't building into the kernel (only as a
>> module) that was needed to start from USB.
> That's generally a good way to start, stick everything in the kernel :)
>
>> I had previously started from a working config I had previously used for
>> the same model PC that I was doing my testing on, and just changed the
>> USB drivers from modules to built-in, but apparently that's not enough.
>> Any ideas what else is needed for a USB-stick boot that's not needed in
>> a SATA boot? I'd like to a) find out what I missed, and b) be able to
>> cull the kernel back down again, so I can build up lots of SATA,
>> graphics and audio modules to make this able to boot (and work properly)
>> on other systems.
> Ok, doing this from memory here.
> To be able to boot from USB, you need (additionally to what you normally
> have):
> 1) USB Host drivers (OHCI,UHCI,EHCI,...)
> 2) USB Mass Storage
> 3) file system on the USB-stick
> 4) SCSI-disk (USB Mass storage depends on this)
>
> If others can also have a quick look on this list to check that I didn't miss
> anything?
>
> --
> Joost
>
Well, now that I've managed to get it booting, the only problem is that
I can't seem to get the disk label working right. In GRUB's menu.lst,
if I use root=LABEL=UsbRoot, it doesn't work (kernel panic, label not
found, but sda1 is listed as available), but if I use root=/dev/sda1, it
works. However, later in the boot process, it mounts / using
LABEL=UsbRoot in fstab just fine. Is that a problem with GRUB? Or the
kernel? Or am I doing something else wrong?
And for future reference, while looking into various things for this, I
found these in the Gentoo Wiki:
USB Portable Install - http://en.gentoo-wiki.com/wiki/USB_Portable_Install
Portable USB Gentoo - http://en.gentoo-wiki.com/wiki/Portable_USB_Gentoo
Unfortunately, both use genkernel instead of manually configured
kernels, so that part doesn't help, but one mentions the option
"scandelay=2" to add to the kernel boot line in GRUB to introduce the
delay genkernel needed to see the USB device; would have been good to
know that last week when I was trying genkernel. :-P
Jake Moe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-22 4:36 ` Jake Moe
@ 2010-09-22 7:02 ` Al
2010-09-22 8:57 ` Jake Moe
2010-09-22 7:16 ` J. Roeleveld
1 sibling, 1 reply; 28+ messages in thread
From: Al @ 2010-09-22 7:02 UTC (permalink / raw
To: gentoo-user
>
> And for future reference, while looking into various things for this, I
> found these in the Gentoo Wiki:
> USB Portable Install - http://en.gentoo-wiki.com/wiki/USB_Portable_Install
> Portable USB Gentoo - http://en.gentoo-wiki.com/wiki/Portable_USB_Gentoo
>
> Unfortunately, both use genkernel instead of manually configured
Fortunately you have improved that, now that you know how how it all works. :-)
Al
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-22 4:36 ` Jake Moe
2010-09-22 7:02 ` Al
@ 2010-09-22 7:16 ` J. Roeleveld
2010-09-22 9:13 ` Jake Moe
1 sibling, 1 reply; 28+ messages in thread
From: J. Roeleveld @ 2010-09-22 7:16 UTC (permalink / raw
To: gentoo-user
On Wednesday 22 September 2010 06:36:50 Jake Moe wrote:
<snipped>
> Well, now that I've managed to get it booting, the only problem is that
> I can't seem to get the disk label working right. In GRUB's menu.lst,
> if I use root=LABEL=UsbRoot, it doesn't work (kernel panic, label not
> found, but sda1 is listed as available), but if I use root=/dev/sda1, it
> works. However, later in the boot process, it mounts / using
> LABEL=UsbRoot in fstab just fine. Is that a problem with GRUB? Or the
> kernel? Or am I doing something else wrong?
I think someone mentioned earlier in this thread that "label" support for boot
requires an initrd (ramdisk) to work. This could be what you're running into?
> And for future reference, while looking into various things for this, I
> found these in the Gentoo Wiki:
> USB Portable Install - http://en.gentoo-wiki.com/wiki/USB_Portable_Install
> Portable USB Gentoo - http://en.gentoo-wiki.com/wiki/Portable_USB_Gentoo
>
> Unfortunately, both use genkernel instead of manually configured
> kernels, so that part doesn't help, but one mentions the option
> "scandelay=2" to add to the kernel boot line in GRUB to introduce the
> delay genkernel needed to see the USB device; would have been good to
> know that last week when I was trying genkernel. :-P
That is something I noticed for a few Howto's, genkernel is used quite often,
but I actually haven't seen the need for it myself yet.
But I am glad to hear you managed to get it working.
Did you try trimming down your kernel a bit more to see what the minimum
required is? :)
--
Joost
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-22 7:02 ` Al
@ 2010-09-22 8:57 ` Jake Moe
0 siblings, 0 replies; 28+ messages in thread
From: Jake Moe @ 2010-09-22 8:57 UTC (permalink / raw
To: gentoo-user
On 09/22/10 17:02, Al wrote:
>> And for future reference, while looking into various things for this, I
>> found these in the Gentoo Wiki:
>> USB Portable Install - http://en.gentoo-wiki.com/wiki/USB_Portable_Install
>> Portable USB Gentoo - http://en.gentoo-wiki.com/wiki/Portable_USB_Gentoo
>>
>> Unfortunately, both use genkernel instead of manually configured
> Fortunately you have improved that, now that you know how how it all works. :-)
>
> Al
>
Well, I've written a few Gentoo Wikis before (very basic things), but as
those two articles each say they're up for merging with each other. I'm
not sure how to do that, and I'm not sure what the proper way of editing
a wiki that someone else wrote in the first place.
Plus, I'm not done yet. I'm still running into problems. :-P
Jake Moe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-22 7:16 ` J. Roeleveld
@ 2010-09-22 9:13 ` Jake Moe
2010-09-22 11:23 ` J. Roeleveld
0 siblings, 1 reply; 28+ messages in thread
From: Jake Moe @ 2010-09-22 9:13 UTC (permalink / raw
To: gentoo-user
On 09/22/10 17:16, J. Roeleveld wrote:
> On Wednesday 22 September 2010 06:36:50 Jake Moe wrote:
>
> <snipped>
>
>> Well, now that I've managed to get it booting, the only problem is that
>> I can't seem to get the disk label working right. In GRUB's menu.lst,
>> if I use root=LABEL=UsbRoot, it doesn't work (kernel panic, label not
>> found, but sda1 is listed as available), but if I use root=/dev/sda1, it
>> works. However, later in the boot process, it mounts / using
>> LABEL=UsbRoot in fstab just fine. Is that a problem with GRUB? Or the
>> kernel? Or am I doing something else wrong?
> I think someone mentioned earlier in this thread that "label" support for boot
> requires an initrd (ramdisk) to work. This could be what you're running into?
Quite possibly. I seem to be reading the same thing, but I thought I
had heard from the list previously that it was possible.
Actually, I've just found the e-mail I was thinking of before: Alan
McKinnon's reply on 08/31/10 02:32 with the subject "Re: [gentoo-user]
Re: Old IDE drives and the "newer" PATA kernel drivers" in which he said
that he's always used labels and never needed an initramfs to make it
work. So I might have to fiddle with it some more and see if I can't
get it working.
>> And for future reference, while looking into various things for this, I
>> found these in the Gentoo Wiki:
>> USB Portable Install - http://en.gentoo-wiki.com/wiki/USB_Portable_Install
>> Portable USB Gentoo - http://en.gentoo-wiki.com/wiki/Portable_USB_Gentoo
>>
>> Unfortunately, both use genkernel instead of manually configured
>> kernels, so that part doesn't help, but one mentions the option
>> "scandelay=2" to add to the kernel boot line in GRUB to introduce the
>> delay genkernel needed to see the USB device; would have been good to
>> know that last week when I was trying genkernel. :-P
> That is something I noticed for a few Howto's, genkernel is used quite often,
> but I actually haven't seen the need for it myself yet.
>
> But I am glad to hear you managed to get it working.
> Did you try trimming down your kernel a bit more to see what the minimum
> required is? :)
>
> --
> Joost
>
No, I'm still trying to get a basic system up and running. After I
booted into it, I tried to install v86d so I could try to get a
framebuffer working and have more lines on my screen while I try to trim
things down. However, I quickly ran into an "out of space" issue, which
I found out was because of inodes, not size. So I had to copy the
contents off, re-make the partition with more inodes, and then copy the
data back on. Since then, I haven't had a chance to boot it and see how
it's going. Hope to tomorrow.
Jake Moe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [gentoo-user] Booting Gentoo from USB stick
2010-09-22 9:13 ` Jake Moe
@ 2010-09-22 11:23 ` J. Roeleveld
0 siblings, 0 replies; 28+ messages in thread
From: J. Roeleveld @ 2010-09-22 11:23 UTC (permalink / raw
To: gentoo-user
On Wednesday 22 September 2010 11:13:01 Jake Moe wrote:
> On 09/22/10 17:16, J. Roeleveld wrote:
> > On Wednesday 22 September 2010 06:36:50 Jake Moe wrote:
> >
> > <snipped>
> >
> >> Well, now that I've managed to get it booting, the only problem is that
> >> I can't seem to get the disk label working right. In GRUB's menu.lst,
> >> if I use root=LABEL=UsbRoot, it doesn't work (kernel panic, label not
> >> found, but sda1 is listed as available), but if I use root=/dev/sda1, it
> >> works. However, later in the boot process, it mounts / using
> >> LABEL=UsbRoot in fstab just fine. Is that a problem with GRUB? Or the
> >> kernel? Or am I doing something else wrong?
> >
> > I think someone mentioned earlier in this thread that "label" support for
> > boot requires an initrd (ramdisk) to work. This could be what you're
> > running into?
>
> Quite possibly. I seem to be reading the same thing, but I thought I
> had heard from the list previously that it was possible.
>
> Actually, I've just found the e-mail I was thinking of before: Alan
> McKinnon's reply on 08/31/10 02:32 with the subject "Re: [gentoo-user]
> Re: Old IDE drives and the "newer" PATA kernel drivers" in which he said
> that he's always used labels and never needed an initramfs to make it
> work. So I might have to fiddle with it some more and see if I can't
> get it working.
I haven't used labels for that, so I don't know what is needed for that.
Maybe a kernel-config setting?
> >> And for future reference, while looking into various things for this, I
> >> found these in the Gentoo Wiki:
> >> USB Portable Install -
> >> http://en.gentoo-wiki.com/wiki/USB_Portable_Install Portable USB Gentoo
> >> - http://en.gentoo-wiki.com/wiki/Portable_USB_Gentoo
> >>
> >> Unfortunately, both use genkernel instead of manually configured
> >> kernels, so that part doesn't help, but one mentions the option
> >> "scandelay=2" to add to the kernel boot line in GRUB to introduce the
> >> delay genkernel needed to see the USB device; would have been good to
> >> know that last week when I was trying genkernel. :-P
> >
> > That is something I noticed for a few Howto's, genkernel is used quite
> > often, but I actually haven't seen the need for it myself yet.
> >
> > But I am glad to hear you managed to get it working.
> > Did you try trimming down your kernel a bit more to see what the minimum
> > required is? :)
> >
> > --
> > Joost
>
> No, I'm still trying to get a basic system up and running. After I
> booted into it, I tried to install v86d so I could try to get a
> framebuffer working and have more lines on my screen while I try to trim
> things down. However, I quickly ran into an "out of space" issue, which
> I found out was because of inodes, not size. So I had to copy the
> contents off, re-make the partition with more inodes, and then copy the
> data back on. Since then, I haven't had a chance to boot it and see how
> it's going. Hope to tomorrow.
Ouch :(
I'm usually a bit astumped when I get "out-of-space" issues and "df" still
shows plenty of free disk space.
Looking forward to your update :)
--
Joost
PS. Am thinking of playing around with that myself again sometime :)
^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~2010-09-22 11:24 UTC | newest]
Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-10 5:09 [gentoo-user] Booting Gentoo from USB stick Jake Moe
2010-09-10 7:27 ` Maciej Grela
2010-09-10 8:43 ` Jake Moe
2010-09-10 9:05 ` J. Roeleveld
2010-09-10 11:29 ` David Relson
2010-09-14 18:28 ` YoYo Siska
2010-09-14 22:34 ` Jake Moe
2010-09-15 10:10 ` YoYo Siska
2010-09-15 22:03 ` Jake Moe
2010-09-15 22:18 ` Al
2010-09-15 22:43 ` Jake Moe
2010-09-15 23:04 ` Al
2010-09-16 0:21 ` Jake Moe
2010-09-16 11:08 ` Al
2010-09-15 22:26 ` Dale
2010-09-15 22:34 ` Jake Moe
2010-09-16 6:22 ` J. Roeleveld
2010-09-16 10:01 ` Jake Moe
2010-09-16 11:30 ` J. Roeleveld
2010-09-21 5:35 ` Jake Moe
2010-09-21 7:26 ` J. Roeleveld
2010-09-22 4:36 ` Jake Moe
2010-09-22 7:02 ` Al
2010-09-22 8:57 ` Jake Moe
2010-09-22 7:16 ` J. Roeleveld
2010-09-22 9:13 ` Jake Moe
2010-09-22 11:23 ` J. Roeleveld
2010-09-10 10:51 ` Al
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox