public inbox for gentoo-amd64@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-amd64] boot Gentoo from USB key
@ 2008-04-30  6:43 Raffaele BELARDI
  2008-04-30  6:49 ` Kyle Liddell
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Raffaele BELARDI @ 2008-04-30  6:43 UTC (permalink / raw
  To: gentoo-amd64

In the process of building an amd64 diskless box, I am trying to make a
bootable USB key with no success up to now.

The first problem I encountered was related to ext2/vfat. I initially
tried to format the key as ext2, but grub refuses to install on it. Even
though I copied the /boot/grub/* directory into the key, and I see it is
there, grub does not see it. The problem does not happen with vfat.

So I worked around that and created two partitions in the key, a small
vfat for the /boot and a 2Gb ext2 for the /. I copied the stage3 into
the / with no problem. In the /boot I put the kernel image which I am
already using on the same box, for now with discs still connected. All
the modules are compiled in.

When I boot from the key, grub enters the shell (although I did create
the grub.conf and menu.1st, so I don't understand why it doesn't show
the menu). I manually specify the kernel file location and root
parameter:

> kernel /linux-2.6.24-gentoo-r4 root=/dev/sdg1
> boot

The kernel starts to load, but panics because it is unable to find the
root partition. When it stops it shows the available partitions, these
include all the hard disk partitions but no USB key partition. In fact,
if I omit the 'root' parameter from the grub shell the boot works fine
but it uses the hard disk root partition instead of the USB one.

>From the log on the screen the USB controller seems correctly detected,
so I don't understand why it is not finding the root. While writing this
one idea comes to my mind, maybe it is failing because I attach the key
to a SDC/MMC/USB card reader? This evening I'll try to plug it into a
different USB slot.

Any other ideas welcome.

raffaele

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30  6:43 [gentoo-amd64] boot Gentoo from USB key Raffaele BELARDI
@ 2008-04-30  6:49 ` Kyle Liddell
  2008-04-30  6:56 ` Branko Badrljica
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 23+ messages in thread
From: Kyle Liddell @ 2008-04-30  6:49 UTC (permalink / raw
  To: gentoo-amd64

On Wed, Apr 30, 2008 at 08:43:53AM +0200, Raffaele BELARDI wrote:
> In the process of building an amd64 diskless box, I am trying to make a
> bootable USB key with no success up to now.
> 
> The kernel starts to load, but panics because it is unable to find the
> root partition. When it stops it shows the available partitions, these
> include all the hard disk partitions but no USB key partition. In fact,
> if I omit the 'root' parameter from the grub shell the boot works fine
> but it uses the hard disk root partition instead of the USB one.
> 
> >From the log on the screen the USB controller seems correctly detected,
> so I don't understand why it is not finding the root. While writing this
> one idea comes to my mind, maybe it is failing because I attach the key
> to a SDC/MMC/USB card reader? This evening I'll try to plug it into a
> different USB slot.
> 

Try adding the rootdelay=N kernel option.  When I was running a laptop from a USB device, rootdelay=12 was the minimum that would always work.  It takes a while to detect all the available USB devices, and rootdelay makes the kernel wait N seconds before trying to mount the given root device.
(Also, be sure you have usb_storage, etc compiled in.)

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30  6:43 [gentoo-amd64] boot Gentoo from USB key Raffaele BELARDI
  2008-04-30  6:49 ` Kyle Liddell
@ 2008-04-30  6:56 ` Branko Badrljica
  2008-04-30  7:44   ` Raffaele BELARDI
  2008-04-30 10:47 ` [gentoo-amd64] " Duncan
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Branko Badrljica @ 2008-04-30  6:56 UTC (permalink / raw
  To: gentoo-amd64

I had the same two problems.

WRT to grub, I don't remember anymore exactly what I have done, but I 
think I have
copied sectors 1-62 from one conventional grub-bootable HDD to USB,

Or maybe used some old HDD and formated it, parittioned it like the USB 
disk, copied /boot partition on it and set up grub on it, then copied 
sectors 1-62 back to USB disk.
Sector 0 is for MBR codeand last few tens of bytes contain headers for 
first 4 partitions, so it shouldn't be touched and first partition 
begins with sector 63.

Something like that.


WRT to boot panics, kernel can't find USB key at boot since USB 
initialisation code needs more time for key to stabilise. Use kernel 
parameter rootdelay=10 for 10 second wait period for USB

Hope this helps.


BTW: You will in all likelyhood be dissapointed with USB key 
performance. Its R/W throughput is comparable to HDD only on paper. In 
reality it seems that USB can't cope efficiently with small sector-sized 
writes but also scattered reads seem to be far from optimal.Either that 
or USB driver really sucks on Linux.

It is very useable as fallback though. Like having one USB key soldered 
directly on the MoBO and using it for boot if/when your HDD croaks or if 
something eats your main boot option...


Regards,


Branko




Raffaele BELARDI wrote:
> In the process of building an amd64 diskless box, I am trying to make a
> bootable USB key with no success up to now.
>
> The first problem I encountered was related to ext2/vfat. I initially
> tried to format the key as ext2, but grub refuses to install on it. Even
> though I copied the /boot/grub/* directory into the key, and I see it is
> there, grub does not see it. The problem does not happen with vfat.
>
> So I worked around that and created two partitions in the key, a small
> vfat for the /boot and a 2Gb ext2 for the /. I copied the stage3 into
> the / with no problem. In the /boot I put the kernel image which I am
> already using on the same box, for now with discs still connected. All
> the modules are compiled in.
>
> When I boot from the key, grub enters the shell (although I did create
> the grub.conf and menu.1st, so I don't understand why it doesn't show
> the menu). I manually specify the kernel file location and root
> parameter:
>
>   
>> kernel /linux-2.6.24-gentoo-r4 root=/dev/sdg1
>> boot
>>     
>
> The kernel starts to load, but panics because it is unable to find the
> root partition. When it stops it shows the available partitions, these
> include all the hard disk partitions but no USB key partition. In fact,
> if I omit the 'root' parameter from the grub shell the boot works fine
> but it uses the hard disk root partition instead of the USB one.
>
> >From the log on the screen the USB controller seems correctly detected,
> so I don't understand why it is not finding the root. While writing this
> one idea comes to my mind, maybe it is failing because I attach the key
> to a SDC/MMC/USB card reader? This evening I'll try to plug it into a
> different USB slot.
>
> Any other ideas welcome.
>
> raffaele
>
>   

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30  6:56 ` Branko Badrljica
@ 2008-04-30  7:44   ` Raffaele BELARDI
  2008-05-05  8:40     ` Raffaele BELARDI
  0 siblings, 1 reply; 23+ messages in thread
From: Raffaele BELARDI @ 2008-04-30  7:44 UTC (permalink / raw
  To: gentoo-amd64

Thanks to you and Kyle for the hint on rootdelay, I will give it a try.

Regarding the performance, it should not be a real issue in my case. I
will only use the key to boot the kernel and send a Wake-on-Lan packet
to a file server, then I'll mount the discs over NFS.

bye,

raf

On Wed, 2008-04-30 at 08:56 +0200, Branko Badrljica wrote:
> I had the same two problems.
> 
> WRT to grub, I don't remember anymore exactly what I have done, but I 
> think I have
> copied sectors 1-62 from one conventional grub-bootable HDD to USB,
> 
> Or maybe used some old HDD and formated it, parittioned it like the USB 
> disk, copied /boot partition on it and set up grub on it, then copied 
> sectors 1-62 back to USB disk.
> Sector 0 is for MBR codeand last few tens of bytes contain headers for 
> first 4 partitions, so it shouldn't be touched and first partition 
> begins with sector 63.
> 
> Something like that.
> 
> 
> WRT to boot panics, kernel can't find USB key at boot since USB 
> initialisation code needs more time for key to stabilise. Use kernel 
> parameter rootdelay=10 for 10 second wait period for USB
> 
> Hope this helps.
> 
> 
> BTW: You will in all likelyhood be dissapointed with USB key 
> performance. Its R/W throughput is comparable to HDD only on paper. In 
> reality it seems that USB can't cope efficiently with small sector-sized 
> writes but also scattered reads seem to be far from optimal.Either that 
> or USB driver really sucks on Linux.
> 
> It is very useable as fallback though. Like having one USB key soldered 
> directly on the MoBO and using it for boot if/when your HDD croaks or if 
> something eats your main boot option...
> 
> 
> Regards,
> 
> 
> Branko
> 
> 
> 
> 
> Raffaele BELARDI wrote:
> > In the process of building an amd64 diskless box, I am trying to make a
> > bootable USB key with no success up to now.
> >
> > The first problem I encountered was related to ext2/vfat. I initially
> > tried to format the key as ext2, but grub refuses to install on it. Even
> > though I copied the /boot/grub/* directory into the key, and I see it is
> > there, grub does not see it. The problem does not happen with vfat.
> >
> > So I worked around that and created two partitions in the key, a small
> > vfat for the /boot and a 2Gb ext2 for the /. I copied the stage3 into
> > the / with no problem. In the /boot I put the kernel image which I am
> > already using on the same box, for now with discs still connected. All
> > the modules are compiled in.
> >
> > When I boot from the key, grub enters the shell (although I did create
> > the grub.conf and menu.1st, so I don't understand why it doesn't show
> > the menu). I manually specify the kernel file location and root
> > parameter:
> >
> >   
> >> kernel /linux-2.6.24-gentoo-r4 root=/dev/sdg1
> >> boot
> >>     
> >
> > The kernel starts to load, but panics because it is unable to find the
> > root partition. When it stops it shows the available partitions, these
> > include all the hard disk partitions but no USB key partition. In fact,
> > if I omit the 'root' parameter from the grub shell the boot works fine
> > but it uses the hard disk root partition instead of the USB one.
> >
> > >From the log on the screen the USB controller seems correctly detected,
> > so I don't understand why it is not finding the root. While writing this
> > one idea comes to my mind, maybe it is failing because I attach the key
> > to a SDC/MMC/USB card reader? This evening I'll try to plug it into a
> > different USB slot.
> >
> > Any other ideas welcome.
> >
> > raffaele
> >
> >   
> 

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* [gentoo-amd64]  Re: boot Gentoo from USB key
  2008-04-30  6:43 [gentoo-amd64] boot Gentoo from USB key Raffaele BELARDI
  2008-04-30  6:49 ` Kyle Liddell
  2008-04-30  6:56 ` Branko Badrljica
@ 2008-04-30 10:47 ` Duncan
  2008-04-30 12:35 ` [gentoo-amd64] " Jason
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 23+ messages in thread
From: Duncan @ 2008-04-30 10:47 UTC (permalink / raw
  To: gentoo-amd64

Raffaele BELARDI <raffaele.belardi@st.com> posted
1209537833.6170.62.camel@ws2912.agr.st.com, excerpted below, on  Wed, 30
Apr 2008 08:43:53 +0200:

> The kernel starts to load, but panics because it is unable to find the
> root partition. When it stops it shows the available partitions, these
> include all the hard disk partitions but no USB key partition. In fact,
> if I omit the 'root' parameter from the grub shell the boot works fine
> but it uses the hard disk root partition instead of the USB one.

In addition to what the others have suggested...

Some machines apparently have (had?) trouble with parts of USB built-in.  
If they are, the USB detects the root hubs but nothing else.  I had this 
problem at one point altho I wasn't trying to /boot/ from USB at that 
point.  The solution when not booting from USB is to build it as modules, 
not built-in, but of course that complicates things somewhat if you are 
booting from USB.  In that case, you'd have to build USB as modules, and 
then ensure those modules are on your initrd/initramfs (which I've never 
had to use so have never worried about learning the technicalities of, so 
I'll be of little help in that regard).

As indicated by the "(had?)" above, it's possible the issues have been 
fixed now and USB builds in just fine.  However, I still build these as 
modules due to that experience.  The specific modules involved... let me 
double-check...  usbcore and the appropriate minidriver(s), uhci/ohci/
ehci_hcd.  Of course, with them as modules, you'll likely have to build 
other stuff (like usbhid, the usb keyboard/mouse input module) as modules 
as well.

I should try again one of these days and see... as it'd be nice to have 
it built-in since I'm using a USB mouse and keyboard now, and they 
naturally fail if I boot to a backup root without modules for the kernel 
I'm running.  It wasn't a big deal when I was running ps2 based mouse/
keyboard and USB was just "auxiliary" stuff anyway.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30  6:43 [gentoo-amd64] boot Gentoo from USB key Raffaele BELARDI
                   ` (2 preceding siblings ...)
  2008-04-30 10:47 ` [gentoo-amd64] " Duncan
@ 2008-04-30 12:35 ` Jason
  2008-04-30 14:29   ` Branko Badrljica
  2008-04-30 17:39 ` Hernan Lopez
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Jason @ 2008-04-30 12:35 UTC (permalink / raw
  To: gentoo-amd64

Raffaele BELARDI wrote:
...
> The kernel starts to load, but panics because it is unable to find the
> root partition. When it stops it shows the available partitions, these
> include all the hard disk partitions but no USB key partition. In fact,
> if I omit the 'root' parameter from the grub shell the boot works fine
> but it uses the hard disk root partition instead of the USB one.

You may want to look at specifying root by it's UUID.  This will prevent 
issues like the USB drive being /dev/sdg on one machine, /dev/sdb on 
another, and on reboot it all changing because the drives were detected 
in a different order.

>>From the log on the screen the USB controller seems correctly detected,
> so I don't understand why it is not finding the root. While writing this
> one idea comes to my mind, maybe it is failing because I attach the key
> to a SDC/MMC/USB card reader? This evening I'll try to plug it into a
> different USB slot.

In the past, instead of 'rootdelay=', I add a wait to the init script, eg:

while [ ! -e /dev/disk/by-uuid/1234-abcd-45gf-0659 ]
do
	sleep 0.1
done


hth,

Jason.
-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30 12:35 ` [gentoo-amd64] " Jason
@ 2008-04-30 14:29   ` Branko Badrljica
  2008-04-30 14:47     ` Jason
  0 siblings, 1 reply; 23+ messages in thread
From: Branko Badrljica @ 2008-04-30 14:29 UTC (permalink / raw
  To: gentoo-amd64

Jason wrote:
>
> You may want to look at specifying root by it's UUID.  This will 
> prevent issues like the USB drive being /dev/sdg on one machine, 
> /dev/sdb on another, and on reboot it all changing because the drives 
> were detected in a different order.
>

I have tried that and booting by UUID never worked for me except once in 
past on some particular kernel. I can put an UUID in /etc/fstab, but not 
as kernel boot parameter.
I did some googling about that and found soemthing about that UUID as 
kernel parameter was a hack which was thrown out and that they don't 
intend to support it in the future.
It's aong the lines of "if you don't like anything about booting 
procedure, boot from initramfs, do what you have to do and then do 
pivot_root "...


> In the past, instead of 'rootdelay=', I add a wait to the init script, 
> eg:
>
> while [ ! -e /dev/disk/by-uuid/1234-abcd-45gf-0659 ]
> do
>     sleep 0.1
> done
And how do you do that when you are trying to get to root partition 
after kernel initialisation ? At that moment you can't run a script, 
since you don't have an access to any partition.
You could use initrd/initramfs, but seems like a lot of complications 
for little gain...

Branko
-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30 14:29   ` Branko Badrljica
@ 2008-04-30 14:47     ` Jason
  2008-04-30 15:05       ` Branko Badrljica
  0 siblings, 1 reply; 23+ messages in thread
From: Jason @ 2008-04-30 14:47 UTC (permalink / raw
  To: gentoo-amd64

Branko Badrljica wrote:
> Jason wrote:
>> You may want to look at specifying root by it's UUID.  This will 
>> prevent issues like the USB drive being /dev/sdg on one machine, 
>> /dev/sdb on another, and on reboot it all changing because the drives 
>> were detected in a different order.
> 
> I have tried that and booting by UUID never worked for me except once in 
> past on some particular kernel. I can put an UUID in /etc/fstab, but not 
> as kernel boot parameter.
> I did some googling about that and found soemthing about that UUID as 
> kernel parameter was a hack which was thrown out and that they don't 
> intend to support it in the future.
> It's aong the lines of "if you don't like anything about booting 
> procedure, boot from initramfs, do what you have to do and then do 
> pivot_root "...

Exactly.  The kernel command line should be simple.  Complicated or 
unusual tasks, like booting from USB, should be handled by initrd.

>> In the past, instead of 'rootdelay=', I add a wait to the init script, 
>> eg:
>>
>> while [ ! -e /dev/disk/by-uuid/1234-abcd-45gf-0659 ]
>> do
>>     sleep 0.1
>> done
> And how do you do that when you are trying to get to root partition 
> after kernel initialisation ? At that moment you can't run a script, 
> since you don't have an access to any partition.

initrd is exactly how you do it.  In the case of booting off of USB, 
there are too many variables (drive detection order, different hardware, 
etc) to handle on the kernel command line. An initrd gives you the 
flexibility to solve these problems.

> You could use initrd/initramfs, but seems like a lot of complications 
> for little gain...

I wouldn't call a portable, writable, boot from anywhere Linux OS on a 
thumbdrive a trivial gain.  ;-)

Jason.

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30 14:47     ` Jason
@ 2008-04-30 15:05       ` Branko Badrljica
  2008-04-30 15:40         ` Jason
  0 siblings, 1 reply; 23+ messages in thread
From: Branko Badrljica @ 2008-04-30 15:05 UTC (permalink / raw
  To: gentoo-amd64

Jason wrote:
>
> initrd is exactly how you do it.  In the case of booting off of USB, 
> there are too many variables (drive detection order, different 
> hardware, etc) to handle on the kernel command line. An initrd gives 
> you the flexibility to solve these problems.
>
>> You could use initrd/initramfs, but seems like a lot of complications 
>> for little gain...
>
> I wouldn't call a portable, writable, boot from anywhere Linux OS on a 
> thumbdrive a trivial gain.  ;-)
>
> Jason.
>


But y<ou have the headache of interface at the old and new root across 
the pivot root. What happens if you execute something that was 
dynamically linked from intramfs and it decides to load and link another 
module with dlopen() from new root ? If you have that module and it 
belongs to the same version, then probably everything is fine. Otherwise 
it might not be.

Also, opened files and extra nodes in /dev during intiramfs phase tend 
to cause a headache or two...


Branko
-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30 15:05       ` Branko Badrljica
@ 2008-04-30 15:40         ` Jason
  2008-04-30 15:55           ` Branko Badrljica
  2008-05-05  8:53           ` Raffaele BELARDI
  0 siblings, 2 replies; 23+ messages in thread
From: Jason @ 2008-04-30 15:40 UTC (permalink / raw
  To: gentoo-amd64

Branko Badrljica wrote:
> Jason wrote:
>> initrd is exactly how you do it.  In the case of booting off of USB, 
>> there are too many variables (drive detection order, different 
>> hardware, etc) to handle on the kernel command line. An initrd gives 
>> you the flexibility to solve these problems.
>>
>>> You could use initrd/initramfs, but seems like a lot of complications 
>>> for little gain...
>>
>> I wouldn't call a portable, writable, boot from anywhere Linux OS on a 
>> thumbdrive a trivial gain.  ;-)
> 
> But y<ou have the headache of interface at the old and new root across 
> the pivot root. What happens if you execute something that was 
> dynamically linked from intramfs and it decides to load and link another 
> module with dlopen() from new root ? If you have that module and it 
> belongs to the same version, then probably everything is fine. Otherwise 
> it might not be.

1.) a good initrd will use only statically linked executables.
2.) you shouldn't start any servers or background processes from initrd.
3.) initrd's are tied to kernels.  Every distro's initrd generator is 
re-run upon upgrading the kernel.  The modules versions won't be out of 
sync then.  Gentoo has genkernel for this purpose.

> Also, opened files and extra nodes in /dev during intiramfs phase tend 
> to cause a headache or two...

If your initrd follows the 3 suggestions, above, there won't be any 
processes running to hold a file or device open.  Unless you had 
something else in mind?

Jason.
-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30 15:40         ` Jason
@ 2008-04-30 15:55           ` Branko Badrljica
  2008-05-05  8:53           ` Raffaele BELARDI
  1 sibling, 0 replies; 23+ messages in thread
From: Branko Badrljica @ 2008-04-30 15:55 UTC (permalink / raw
  To: gentoo-amd64

Jason wrote:
> ons won't be out of sync then.  Gentoo has genkernel for this purpose.
>
>> Also, opened files and extra nodes in /dev during intiramfs phase 
>> tend to cause a headache or two...
>
> If your initrd follows the 3 suggestions, above, there won't be any 
> processes running to hold a file or device open.  Unless you had 
> something else in mind?
>
> Jason.



I ahve used initrd for booting from LVM2 partition in the past and have 
always had headaches with this sort of thing- and I believe exactly this 
was covered in some article on gentoo.org

Point is that you need to run some programs to do some things ( why else 
have initramfs ?) before system becomes really useable for the user and 
you can't always control all aspects of programs that you have ran. Some 
might spawn some daemon with opened files or at least devices etc etc. I 
have mounted XFS on one machine and because of  this two daemons run on 
my machine etc.

Also, if you need autodetection and device for some PnP hardware ( USB, 
1394 etc ) you need udev and hotplug system to generate enw devices in 
dev and then recreate them in /new_root/dev.
And if some daemon has continually opened something in /dev, after 
chroot/pivot_root your initrd might still occupy your memory. AFAIK 
initramfs should eb way better with this, but any user data about it is 
very scarce on the net...
-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30  6:43 [gentoo-amd64] boot Gentoo from USB key Raffaele BELARDI
                   ` (3 preceding siblings ...)
  2008-04-30 12:35 ` [gentoo-amd64] " Jason
@ 2008-04-30 17:39 ` Hernan Lopez
  2008-04-30 17:58   ` Branko Badrljica
  2008-04-30 18:03 ` Drake Donahue
  2008-05-02 11:22 ` [gentoo-amd64] " Duncan
  6 siblings, 1 reply; 23+ messages in thread
From: Hernan Lopez @ 2008-04-30 17:39 UTC (permalink / raw
  To: gentoo-amd64

Hello, I´m did install UtutoXS2007 (based on Gentoo 2007), FreeBsd, and I don´t have this problem. Generally the USB key when exec the post the same is (sd0) and boot, then of boot the usb key, (sd0) is the principal Hard Disk, NOT THE USB KEY, this pass of (sd0) to (sd1).
Partitions:

Kingston 512Mb
/boot=>ext2
/=>ext3

copy grub to /boot/grub and exec grub
> root (sd0,0) =>where is the boot partition en USB
> setup (sd1) => then that change de sdx number to sd1.
> quit
 
This mode I have not any problem.

Sorry by my english ;)

BYe.
Hernán López Pardo
http://otrodiaparaser.blogspot.com

"Yo soy argentino, por eso uso Ututo en mi PC."
www.ututo.org
---------------------------------------------------------------------
"Cara no es la ciencia; cara es la ignorancia."
BERNARDO A. HOUSSAY - (1887-1971)

"No sigas mis pasos, no seas sombra de nadie; aprende de mis pasos y sigue tu camino"
DANIEL O. FERREYRA - (1967-2???)


--- El mié 30-abr-08, Raffaele BELARDI <raffaele.belardi@st.com> escribió:

> De: Raffaele BELARDI <raffaele.belardi@st.com>
> Asunto: [gentoo-amd64] boot Gentoo from USB key
> Para: "gentoo-amd64" <gentoo-amd64@lists.gentoo.org>
> Fecha: miércoles, 30 de abril de 2008, 3:43 am
> In the process of building an amd64 diskless box, I am
> trying to make a
> bootable USB key with no success up to now.
> 
> The first problem I encountered was related to ext2/vfat. I
> initially
> tried to format the key as ext2, but grub refuses to
> install on it. Even
> though I copied the /boot/grub/* directory into the key,
> and I see it is
> there, grub does not see it. The problem does not happen
> with vfat.
> 
> So I worked around that and created two partitions in the
> key, a small
> vfat for the /boot and a 2Gb ext2 for the /. I copied the
> stage3 into
> the / with no problem. In the /boot I put the kernel image
> which I am
> already using on the same box, for now with discs still
> connected. All
> the modules are compiled in.
> 
> When I boot from the key, grub enters the shell (although I
> did create
> the grub.conf and menu.1st, so I don't understand why
> it doesn't show
> the menu). I manually specify the kernel file location and
> root
> parameter:
> 
> > kernel /linux-2.6.24-gentoo-r4 root=/dev/sdg1
> > boot
> 
> The kernel starts to load, but panics because it is unable
> to find the
> root partition. When it stops it shows the available
> partitions, these
> include all the hard disk partitions but no USB key
> partition. In fact,
> if I omit the 'root' parameter from the grub shell
> the boot works fine
> but it uses the hard disk root partition instead of the USB
> one.
> 
> >From the log on the screen the USB controller seems
> correctly detected,
> so I don't understand why it is not finding the root.
> While writing this
> one idea comes to my mind, maybe it is failing because I
> attach the key
> to a SDC/MMC/USB card reader? This evening I'll try to
> plug it into a
> different USB slot.
> 
> Any other ideas welcome.
> 
> raffaele
> 
> -- 
> gentoo-amd64@lists.gentoo.org mailing list


      Tarjeta de crédito Yahoo! de Banco Supervielle.
Solicitá tu nueva Tarjeta de crédito. De tu PC directo a tu casa. www.tuprimeratarjeta.com.ar
--
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30 17:39 ` Hernan Lopez
@ 2008-04-30 17:58   ` Branko Badrljica
  2008-05-01  7:26     ` Branko Badrljica
  0 siblings, 1 reply; 23+ messages in thread
From: Branko Badrljica @ 2008-04-30 17:58 UTC (permalink / raw
  To: gentoo-amd64

Hernan Lopez wrote:
> Hello, I´m did install UtutoXS2007 (based on Gentoo 2007), FreeBsd, and I don´t have this problem. Generally the USB key when exec the post the same is (sd0) and boot, then of boot the usb key, (sd0) is the principal Hard Disk, NOT THE USB KEY, this pass of (sd0) to (sd1).
> Partitions:
>
> Kingston 512Mb
> /boot=>ext2
> /=>ext3
>
> copy grub to /boot/grub and exec grub
>   
>> root (sd0,0) =>where is the boot partition en USB
>> setup (sd1) => then that change de sdx number to sd1.
>> quit
>>     
This is what OP has been trying to do withut success, since grub refused 
to do install to USB key since it can't find it as a disk to which you 
could install stage 1/1.5/2 and make it bootable.
And going to FreeBSD is not the solution, useable for all of us.

Also, it is not clear to me whether your is always at (sd0) even if you 
plug some SATA disks in your system and boot it and also if it goes for 
all other disks also.

Be it as it may, on linux at least for traditional /dev/sdX links it 
doesn't work, but it should work for addressing the drive through 
/dev/disk/by-uuid or /dev/disk/by-path or /dev/disk/by-id.

Regards,

Branko






>  
> This mode I have not any problem.
>
> Sorry by my english ;)
>
> BYe.
> Hernán López Pardo
> http://otrodiaparaser.blogspot.com
>
> "Yo soy argentino, por eso uso Ututo en mi PC."
> www.ututo.org
> ---------------------------------------------------------------------
> "Cara no es la ciencia; cara es la ignorancia."
> BERNARDO A. HOUSSAY - (1887-1971)
>
> "No sigas mis pasos, no seas sombra de nadie; aprende de mis pasos y sigue tu camino"
> DANIEL O. FERREYRA - (1967-2???)
>
>
> --- El mié 30-abr-08, Raffaele BELARDI <raffaele.belardi@st.com> escribió:
>
>   
>> De: Raffaele BELARDI <raffaele.belardi@st.com>
>> Asunto: [gentoo-amd64] boot Gentoo from USB key
>> Para: "gentoo-amd64" <gentoo-amd64@lists.gentoo.org>
>> Fecha: miércoles, 30 de abril de 2008, 3:43 am
>> In the process of building an amd64 diskless box, I am
>> trying to make a
>> bootable USB key with no success up to now.
>>
>> The first problem I encountered was related to ext2/vfat. I
>> initially
>> tried to format the key as ext2, but grub refuses to
>> install on it. Even
>> though I copied the /boot/grub/* directory into the key,
>> and I see it is
>> there, grub does not see it. The problem does not happen
>> with vfat.
>>
>> So I worked around that and created two partitions in the
>> key, a small
>> vfat for the /boot and a 2Gb ext2 for the /. I copied the
>> stage3 into
>> the / with no problem. In the /boot I put the kernel image
>> which I am
>> already using on the same box, for now with discs still
>> connected. All
>> the modules are compiled in.
>>
>> When I boot from the key, grub enters the shell (although I
>> did create
>> the grub.conf and menu.1st, so I don't understand why
>> it doesn't show
>> the menu). I manually specify the kernel file location and
>> root
>> parameter:
>>
>>     
>>> kernel /linux-2.6.24-gentoo-r4 root=/dev/sdg1
>>> boot
>>>       
>> The kernel starts to load, but panics because it is unable
>> to find the
>> root partition. When it stops it shows the available
>> partitions, these
>> include all the hard disk partitions but no USB key
>> partition. In fact,
>> if I omit the 'root' parameter from the grub shell
>> the boot works fine
>> but it uses the hard disk root partition instead of the USB
>> one.
>>
>> >From the log on the screen the USB controller seems
>> correctly detected,
>> so I don't understand why it is not finding the root.
>> While writing this
>> one idea comes to my mind, maybe it is failing because I
>> attach the key
>> to a SDC/MMC/USB card reader? This evening I'll try to
>> plug it into a
>> different USB slot.
>>
>> Any other ideas welcome.
>>
>> raffaele
>>
>> -- 
>> gentoo-amd64@lists.gentoo.org mailing list
>>     
>
>
>       Tarjeta de crédito Yahoo! de Banco Supervielle.
> Solicitá tu nueva Tarjeta de crédito. De tu PC directo a tu casa. www.tuprimeratarjeta.com.ar 
>   

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30  6:43 [gentoo-amd64] boot Gentoo from USB key Raffaele BELARDI
                   ` (4 preceding siblings ...)
  2008-04-30 17:39 ` Hernan Lopez
@ 2008-04-30 18:03 ` Drake Donahue
  2008-04-30 18:21   ` Drake Donahue
  2008-05-02 11:22 ` [gentoo-amd64] " Duncan
  6 siblings, 1 reply; 23+ messages in thread
From: Drake Donahue @ 2008-04-30 18:03 UTC (permalink / raw
  To: gentoo-amd64


----- Original Message ----- 
From: "Raffaele BELARDI" <raffaele.belardi@st.com>
To: "gentoo-amd64" <gentoo-amd64@lists.gentoo.org>
Sent: Wednesday, April 30, 2008 2:43 AM
Subject: [gentoo-amd64] boot Gentoo from USB key


> In the process of building an amd64 diskless box, I am trying to make a
> bootable USB key with no success up to now.
>
> The first problem I encountered was related to ext2/vfat. I initially
> tried to format the key as ext2, but grub refuses to install on it. Even
> though I copied the /boot/grub/* directory into the key, and I see it is
> there, grub does not see it. The problem does not happen with vfat.
>
> So I worked around that and created two partitions in the key, a small
> vfat for the /boot and a 2Gb ext2 for the /. I copied the stage3 into
> the / with no problem. In the /boot I put the kernel image which I am
> already using on the same box, for now with discs still connected. All
> the modules are compiled in.
>
> When I boot from the key, grub enters the shell (although I did create
> the grub.conf and menu.1st, so I don't understand why it doesn't show
> the menu). I manually specify the kernel file location and root
> parameter:
>
>> kernel /linux-2.6.24-gentoo-r4 root=/dev/sdg1
>> boot
>
> The kernel starts to load, but panics because it is unable to find the
> root partition. When it stops it shows the available partitions, these
> include all the hard disk partitions but no USB key partition. In fact,
> if I omit the 'root' parameter from the grub shell the boot works fine
> but it uses the hard disk root partition instead of the USB one.
>
>>From the log on the screen the USB controller seems correctly detected,
> so I don't understand why it is not finding the root. While writing this
> one idea comes to my mind, maybe it is failing because I attach the key
> to a SDC/MMC/USB card reader? This evening I'll try to plug it into a
> different USB slot.
>
> Any other ideas welcome.
>
> raffaele
>
> -- 
> gentoo-amd64@lists.gentoo.org mailing list
>
Other ideas and SWAGS:

This link may be useful:
http://www.bootdisk.com/pendrive.htm

Perhaps the pen drive manufacturer did you favors and added some control 
software?
I had a similar problem with fdisk results that I attributed to the helpful 
manufacturer putting some extra software on the drive to add features for 
the windows user (the bootable flag would have disappeared upon reboot, the 
pen drive would not appear in BIOS). I may have been right. I used the HP 
utilities referenced in the link to rewrite the recalcitrant pen drive into 
a psuedo floppy drive with linux on board (HP provides a linux based windows 
computer troubleshooting tool!). After verifying that I could boot the pen 
drive as though it were a huge floppy, I rebooted to my hard drive and used 
fdisk to delete existing partitions on the pen drive, created a bootable 
partition, wrote the new partition table, exited fdisk, and formatted it 
ext2. On reboot it showed as a bootable hard drive in BIOS. Encouraged, I 
rebooted to the hard drive. Mounted the pen drive and copied /boot from the 
hard drive to it. Create dummy directory on the pendrive:
>mkdir  {pendrive path}/pendrive
Keeping the problem simple, the machine had one sata hard drive, one ide 
dvd, and the one pen drive.
The major problems at this point were identifying which (hd?) to use in 
editing the grub.conf and in running grub itself.
>umount {pendrive}
>grub
>root (hd0,1)
>root (hd1,1)
>find /pendrive
>quit
As the pen drive first (0) partition was the only ext2 partition on the 
machine, only one of the two commands would expose an ext2 filesystem; in my 
case (hd1,1). Find should provide the same information.
If the pen drive is the selected boot drive for my motherboard it will be 
(hd0) for bios and grub.
So the pen drive grub.conf edits to:
timeout 5
default 0
fallback 1
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title USB Flash boot
root (hd0,0)
kernel (hd0,0)/boot/bzImage root=/dev/sdb1

title  Gentoo Linux on hard drive, first partition (hd1,0)
root (hd1,0)
kernel (hd1,0)/boot/bzImage root=/dev/sda1

So far my hard drive always /dev/sda pendrive /dev/sdb. As a slob, I put 
everything on one partition so all catastrophes can be catastrophic.

Still need to install grub so proper stage 1 and 1.5 and dynamic links can 
be written:

>grub
>root (hd1,0) #should confirm unique ext2 file system in my case
>setup (hd1)
>quit

Proceeding in similar fashion should allow you to select the kernel on the 
pen drive from grub and watch it load to the point where it can't find the 
system because no system is on the pen drive.

Copying the system files may not quite work. Got some copy errors while 
doing the libraries. Playing with 512 mb pen drive so no room to copy /sys. 
Can verify that I completed kernel load and got into init.before lack of 
needed files started an endless reboot cycle with boot sbin bin etc 
libraries directories present.

. 

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30 18:03 ` Drake Donahue
@ 2008-04-30 18:21   ` Drake Donahue
  0 siblings, 0 replies; 23+ messages in thread
From: Drake Donahue @ 2008-04-30 18:21 UTC (permalink / raw
  To: gentoo-amd64


----- Original Message ----- 
From: "Drake Donahue" <donahue95@comcast.net>
To: <gentoo-amd64@lists.gentoo.org>
Sent: Wednesday, April 30, 2008 2:03 PM
Subject: Re: [gentoo-amd64] boot Gentoo from USB key


>
> ----- Original Message ----- 
> From: "Raffaele BELARDI" <raffaele.belardi@st.com>
> To: "gentoo-amd64" <gentoo-amd64@lists.gentoo.org>
> Sent: Wednesday, April 30, 2008 2:43 AM
> Subject: [gentoo-amd64] boot Gentoo from USB key
>
>
>> In the process of building an amd64 diskless box, I am trying to make a
>> bootable USB key with no success up to now.
>>
>> The first problem I encountered was related to ext2/vfat. I initially
>> tried to format the key as ext2, but grub refuses to install on it. Even
>> though I copied the /boot/grub/* directory into the key, and I see it is
>> there, grub does not see it. The problem does not happen with vfat.
>>
>> So I worked around that and created two partitions in the key, a small
>> vfat for the /boot and a 2Gb ext2 for the /. I copied the stage3 into
>> the / with no problem. In the /boot I put the kernel image which I am
>> already using on the same box, for now with discs still connected. All
>> the modules are compiled in.
>>
>> When I boot from the key, grub enters the shell (although I did create
>> the grub.conf and menu.1st, so I don't understand why it doesn't show
>> the menu). I manually specify the kernel file location and root
>> parameter:
>>
>>> kernel /linux-2.6.24-gentoo-r4 root=/dev/sdg1
>>> boot
>>
>> The kernel starts to load, but panics because it is unable to find the
>> root partition. When it stops it shows the available partitions, these
>> include all the hard disk partitions but no USB key partition. In fact,
>> if I omit the 'root' parameter from the grub shell the boot works fine
>> but it uses the hard disk root partition instead of the USB one.
>>
>>>From the log on the screen the USB controller seems correctly detected,
>> so I don't understand why it is not finding the root. While writing this
>> one idea comes to my mind, maybe it is failing because I attach the key
>> to a SDC/MMC/USB card reader? This evening I'll try to plug it into a
>> different USB slot.
>>
>> Any other ideas welcome.
>>
>> raffaele
>>
>> -- 
>> gentoo-amd64@lists.gentoo.org mailing list
>>
> Other ideas and SWAGS:
>
> This link may be useful:
> http://www.bootdisk.com/pendrive.htm
>
> Perhaps the pen drive manufacturer did you favors and added some control 
> software?
> I had a similar problem with fdisk results that I attributed to the 
> helpful manufacturer putting some extra software on the drive to add 
> features for the windows user (the bootable flag would have disappeared 
> upon reboot, the pen drive would not appear in BIOS). I may have been 
> right. I used the HP utilities referenced in the link to rewrite the 
> recalcitrant pen drive into a psuedo floppy drive with linux on board (HP 
> provides a linux based windows computer troubleshooting tool!).

Instead of HP utilities, maybe, quoting:
 Solution:
<snip>When you boot into a command shell, as root, simply pick the drive you 
want to fill [with zeros], sdg presumed, and use the command:

Code:
dd if=/dev/zero of=/dev/sdg bs=1MWARNING! This will destroy ALL data on the 
hard (pen) drive, all boot sector info and all data on all partitions. It 
will not however render the disk useless, you simply have a clean disk that 
only needs to have partitions created and a new boot sector installed, which 
will happen when you install any OS including Linux or Windows. This is a 
good way to clean up any bad partitions, viruses, botched installs or data 
that you don't want to be seen (OK, it is theoretically possible to 
forensically retrieve data after using this method, but not likely and not 
doable by the average computer user) and it is simple to do with existing 
GNU/Linux!

After verifying that I could boot the pen
> drive as though it were a huge floppy, I rebooted to my hard drive and 
> used fdisk to delete existing partitions on the pen drive, created a 
> bootable partition, wrote the new partition table, exited fdisk, and 
> formatted it ext2. On reboot it showed as a bootable hard drive in BIOS. 
> Encouraged, I rebooted to the hard drive. Mounted the pen drive and copied 
> /boot from the hard drive to it. Create dummy directory on the pendrive:
>>mkdir  {pendrive path}/pendrive
> Keeping the problem simple, the machine had one sata hard drive, one ide 
> dvd, and the one pen drive.
> The major problems at this point were identifying which (hd?) to use in 
> editing the grub.conf and in running grub itself.
>>umount {pendrive}
>>grub
>>root (hd0,1)
>>root (hd1,1)
>>find /pendrive
>>quit
> As the pen drive first (0) partition was the only ext2 partition on the 
> machine, only one of the two commands would expose an ext2 filesystem; in 
> my case (hd1,1). Find should provide the same information.
> If the pen drive is the selected boot drive for my motherboard it will be 
> (hd0) for bios and grub.
> So the pen drive grub.conf edits to:
> timeout 5
> default 0
> fallback 1
> splashimage=(hd0,0)/boot/grub/splash.xpm.gz
>
> title USB Flash boot
> root (hd0,0)
> kernel (hd0,0)/boot/bzImage root=/dev/sdb1
>
> title  Gentoo Linux on hard drive, first partition (hd1,0)
> root (hd1,0)
> kernel (hd1,0)/boot/bzImage root=/dev/sda1
>
> So far my hard drive always /dev/sda pendrive /dev/sdb. As a slob, I put 
> everything on one partition so all catastrophes can be catastrophic.
>
> Still need to install grub so proper stage 1 and 1.5 and dynamic links can 
> be written:
>
>>grub
>>root (hd1,0) #should confirm unique ext2 file system in my case
>>setup (hd1)
>>quit
>
> Proceeding in similar fashion should allow you to select the kernel on the 
> pen drive from grub and watch it load to the point where it can't find the 
> system because no system is on the pen drive.
>
> Copying the system files may not quite work. Got some copy errors while 
> doing the libraries. Playing with 512 mb pen drive so no room to copy 
> /sys. Can verify that I completed kernel load and got into init.before 
> lack of needed files started an endless reboot cycle with boot sbin bin 
> etc libraries directories present.
>
> .
> -- 
> gentoo-amd64@lists.gentoo.org mailing list
> 

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30 17:58   ` Branko Badrljica
@ 2008-05-01  7:26     ` Branko Badrljica
  0 siblings, 0 replies; 23+ messages in thread
From: Branko Badrljica @ 2008-05-01  7:26 UTC (permalink / raw
  To: gentoo-amd64

Branko Badrljica wrote:
>
> Be it as it may, on linux at least for traditional /dev/sdX links it 
> doesn't work, but it should work for addressing the drive through 
> /dev/disk/by-uuid or /dev/disk/by-path or /dev/disk/by-id.
>

Self-correction is in order here; I forgot that I have tried that and it 
didn't work for me - I couldn't adress the boot disk as 
by-uuid/by-path/by-id parameter, only as a conventional /dev/sdX|hdX etc 
device.


Branko





-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* [gentoo-amd64]  Re: boot Gentoo from USB key
  2008-04-30  6:43 [gentoo-amd64] boot Gentoo from USB key Raffaele BELARDI
                   ` (5 preceding siblings ...)
  2008-04-30 18:03 ` Drake Donahue
@ 2008-05-02 11:22 ` Duncan
  2008-05-02 15:33   ` Drake Donahue
  6 siblings, 1 reply; 23+ messages in thread
From: Duncan @ 2008-05-02 11:22 UTC (permalink / raw
  To: gentoo-amd64

Raffaele BELARDI <raffaele.belardi@st.com> posted
1209537833.6170.62.camel@ws2912.agr.st.com, excerpted below, on  Wed, 30
Apr 2008 08:43:53 +0200:

> In the process of building an amd64 diskless box, I am trying to make a
> bootable USB key with no success up to now.
> 
> The first problem I encountered was related to ext2/vfat. I initially
> tried to format the key as ext2, but grub refuses to install on it. Even
> though I copied the /boot/grub/* directory into the key, and I see it is
> there, grub does not see it. The problem does not happen with vfat.

I think I might have come across the problem you experienced here.  I'd 
put the chances at pretty good the below covers the problem here, but I 
believe the "invisible USBkey @ boot" issue is different, so you'll 
likely have to address it separately (but luckily there are plenty of 
posts with suggestions).

If I'm correct you're running into the ext3 large inode issue.  Briefly, 
old versions used 128 byte inodes, while newer versions use 256 byte 
inodes by default, in ordered to be ready for the improvements coming in 
ext4.  The problem is that legacy grub doesn't support the larger inodes, 
and isn't being developed any longer so that isn't going to change, while 
new grub isn't even scheduled for format compatibility stability until 
late this year!

One solution is a command line option to mke2fs as detailed in the 
article below.  Or...

There's a Gentoo patched grub-0.97-r5 that'll handle the new inodes hard 
masked for testing, but I don't believe it's even ~arch yet (I'm on the 
no-multilib profile here, where grub is masked and grub-static is used, 
so wouldn't see it go to ~arch and thus can't say for sure).

Here's the article I just found detailing the issue in general.  It's 
well worth reading but a word of warning.  LinuxPlanet tends to be a bit 
ad-heavy... and weirdly formatted if you are using an ad-blocker (unless 
you use a custom filter to cut out the weirdness, as I do with privoxy).  
Still, for those using both grub and an ext3 /boot, it's DEFINITELY worth 
the read, as it may prevent (or in your case fix) some serious issues 
later (now, for you).

http://www.linuxplanet.com/linuxplanet/tutorials/6480/1/

Meanwhile, here's the developer list thread (via gmane) asking for 
testing of the new version with the large-inode patch, among other fixes.

http://comments.gmane.org/gmane.linux.gentoo.devel/55463

Finally, the Gentoo-grub ext3 large inodes bug:

http://bugs.gentoo.org/show_bug.cgi?id=214563

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64]  Re: boot Gentoo from USB key
  2008-05-02 11:22 ` [gentoo-amd64] " Duncan
@ 2008-05-02 15:33   ` Drake Donahue
  2008-05-05  8:38     ` Raffaele BELARDI
  0 siblings, 1 reply; 23+ messages in thread
From: Drake Donahue @ 2008-05-02 15:33 UTC (permalink / raw
  To: gentoo-amd64


----- Original Message ----- 
From: "Duncan" <1i5t5.duncan@cox.net>
To: <gentoo-amd64@lists.gentoo.org>
Sent: Friday, May 02, 2008 7:22 AM
Subject: [gentoo-amd64] Re: boot Gentoo from USB key


> Raffaele BELARDI <raffaele.belardi@st.com> posted
> 1209537833.6170.62.camel@ws2912.agr.st.com, excerpted below, on  Wed, 30
> Apr 2008 08:43:53 +0200:
>
>> In the process of building an amd64 diskless box, I am trying to make a
>> bootable USB key with no success up to now.
>>
>> The first problem I encountered was related to ext2/vfat. I initially
>> tried to format the key as ext2, but grub refuses to install on it. Even
>> though I copied the /boot/grub/* directory into the key, and I see it is
>> there, grub does not see it. The problem does not happen with vfat

Still betting pen drive maker (or card reader maker) did some kind of 
equivalent to 'low level formatting'.
.
>
> I think I might have come across the problem you experienced here.  I'd
> put the chances at pretty good the below covers the problem here, but I
> believe the "invisible USBkey @ boot" issue is different, so you'll
> likely have to address it separately (but luckily there are plenty of
> posts with suggestions).
>
> If I'm correct you're running into the ext3 large inode issue.  Briefly,
> old versions used 128 byte inodes, while newer versions use 256 byte
> inodes by default, in ordered to be ready for the improvements coming in
> ext4.  The problem is that legacy grub doesn't support the larger inodes,
> and isn't being developed any longer so that isn't going to change, while
> new grub isn't even scheduled for format compatibility stability until
> late this year!
>
> One solution is a command line option to mke2fs as detailed in the
> article below.  Or...
>
> There's a Gentoo patched grub-0.97-r5 that'll handle the new inodes hard
> masked for testing, but I don't believe it's even ~arch yet (I'm on the
> no-multilib profile here, where grub is masked and grub-static is used,
> so wouldn't see it go to ~arch and thus can't say for sure).
>
> Here's the article I just found detailing the issue in general.  It's
> well worth reading but a word of warning.  LinuxPlanet tends to be a bit
> ad-heavy... and weirdly formatted if you are using an ad-blocker (unless
> you use a custom filter to cut out the weirdness, as I do with privoxy).
> Still, for those using both grub and an ext3 /boot, it's DEFINITELY worth
> the read, as it may prevent (or in your case fix) some serious issues
> later (now, for you).
>
> http://www.linuxplanet.com/linuxplanet/tutorials/6480/1/
>
> Meanwhile, here's the developer list thread (via gmane) asking for
> testing of the new version with the large-inode patch, among other fixes.
>
> http://comments.gmane.org/gmane.linux.gentoo.devel/55463
>
> Finally, the Gentoo-grub ext3 large inodes bug:
>
> http://bugs.gentoo.org/show_bug.cgi?id=214563
>

An interesting find. Were the inodes for ext2 also defaulted to 256 or only 
those for ext3? This question relevant as Raffaele only talked about using 
ext2 and vfat partitions on the pen drive. In a quick search I found no 
indications. If ext2 inode structure was also changed much more should be 
heard about this.

> -- 
> Duncan - List replies preferred.   No HTML msgs.
> "Every nonfree program has a lord, a master --
> and if you use the program, he is your master."  Richard Stallman
>
> -- 
> gentoo-amd64@lists.gentoo.org mailing list
> 

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64]  Re: boot Gentoo from USB key
  2008-05-02 15:33   ` Drake Donahue
@ 2008-05-05  8:38     ` Raffaele BELARDI
  2008-05-06 13:18       ` Raffaele BELARDI
  0 siblings, 1 reply; 23+ messages in thread
From: Raffaele BELARDI @ 2008-05-05  8:38 UTC (permalink / raw
  To: gentoo-amd64

On Fri, 2008-05-02 at 11:33 -0400, Drake Donahue wrote:
> >
> > If I'm correct you're running into the ext3 large inode issue.  Briefly,
> > old versions used 128 byte inodes, while newer versions use 256 byte
> > inodes by default, in ordered to be ready for the improvements coming in
> > ext4.  The problem is that legacy grub doesn't support the larger inodes,
> > and isn't being developed any longer so that isn't going to change, while
> > new grub isn't even scheduled for format compatibility stability until
> > late this year!
> >

> An interesting find. Were the inodes for ext2 also defaulted to 256 or only 
> those for ext3? This question relevant as Raffaele only talked about using 
> ext2 and vfat partitions on the pen drive. In a quick search I found no 
> indications. If ext2 inode structure was also changed much more should be 
> heard about this.
> 

I confirm that by default mkfs.ext2 created 256 byte inodes so I'm
positive about Duncan's suggestion. I'll try to re-create the partition
forcing inode size to 128. I'm using stable amd64 system, updated a
couple of weeks ago.

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30  7:44   ` Raffaele BELARDI
@ 2008-05-05  8:40     ` Raffaele BELARDI
  0 siblings, 0 replies; 23+ messages in thread
From: Raffaele BELARDI @ 2008-05-05  8:40 UTC (permalink / raw
  To: gentoo-amd64

On Wed, 2008-04-30 at 09:44 +0200, Raffaele Belardi wrote:
> Thanks to you and Kyle for the hint on rootdelay, I will give it a try.
> 
> Regarding the performance, it should not be a real issue in my case. I
> will only use the key to boot the kernel and send a Wake-on-Lan packet
> to a file server, then I'll mount the discs over NFS.
> 

rootdelay=8 fixed the problem, thanks again. I'll try to reduce the
delay, I'll not post the results because I believe that is
motherboard-dependent.

raf

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64] boot Gentoo from USB key
  2008-04-30 15:40         ` Jason
  2008-04-30 15:55           ` Branko Badrljica
@ 2008-05-05  8:53           ` Raffaele BELARDI
  1 sibling, 0 replies; 23+ messages in thread
From: Raffaele BELARDI @ 2008-05-05  8:53 UTC (permalink / raw
  To: gentoo-amd64

On Wed, 2008-04-30 at 11:40 -0400, Jason wrote:
> 1.) a good initrd will use only statically linked executables.
> 2.) you shouldn't start any servers or background processes from initrd.
> 3.) initrd's are tied to kernels.  Every distro's initrd generator is 
> re-run upon upgrading the kernel.  The modules versions won't be out of 
> sync then.  Gentoo has genkernel for this purpose.
> 

I have not even considered using an initrd due to lack of knowledge, but
if it could help improving the solution below I'd surely give it a try.

I'm trying to build a silent PC with Mythtv for the living room. This is
what I am doing:
1. boot the Mythtv system with no disk from USB (4Gb key should be
sufficient)
2. wake up a remote server with the Wake-On-Lan ethernet functionality.
This implies sending a particular ('Magic') packet over UDP to the
server's MAC address
3. mount the remote disks containing the movies through NFS

I'm still at step 1. For next step I was planning to put
in /etc/conf.d/local.start a call to e.g. ether-wake. Then after a delay
to let the server boot, I'd proceed to step3.

Would intird on the Mythtv box improve the above in some way, for
example by letting the system send the magic packet earlier in the boot
process?

thanks,

raf

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [gentoo-amd64]  Re: boot Gentoo from USB key
  2008-05-05  8:38     ` Raffaele BELARDI
@ 2008-05-06 13:18       ` Raffaele BELARDI
  2008-05-06 17:08         ` Duncan
  0 siblings, 1 reply; 23+ messages in thread
From: Raffaele BELARDI @ 2008-05-06 13:18 UTC (permalink / raw
  To: gentoo-amd64

On Mon, 2008-05-05 at 10:38 +0200, Raffaele Belardi wrote:
> On Fri, 2008-05-02 at 11:33 -0400, Drake Donahue wrote:
> > >
> > > If I'm correct you're running into the ext3 large inode issue.  Briefly,
> > > old versions used 128 byte inodes, while newer versions use 256 byte
> > > inodes by default, in ordered to be ready for the improvements coming in
> > > ext4.  The problem is that legacy grub doesn't support the larger inodes,
> > > and isn't being developed any longer so that isn't going to change, while
> > > new grub isn't even scheduled for format compatibility stability until
> > > late this year!
> > >
> 
> > An interesting find. Were the inodes for ext2 also defaulted to 256 or only 
> > those for ext3? This question relevant as Raffaele only talked about using 
> > ext2 and vfat partitions on the pen drive. In a quick search I found no 
> > indications. If ext2 inode structure was also changed much more should be 
> > heard about this.
> > 
> 
> I confirm that by default mkfs.ext2 created 256 byte inodes so I'm
> positive about Duncan's suggestion. I'll try to re-create the partition
> forcing inode size to 128. I'm using stable amd64 system, updated a
> couple of weeks ago.

I confirm that passing -I 128 to mkfs.ext2 fixes the problem, now grub
finds the stage files and installs happily on the ext2 partition.

thanks again,

raf

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

* [gentoo-amd64]  Re: boot Gentoo from USB key
  2008-05-06 13:18       ` Raffaele BELARDI
@ 2008-05-06 17:08         ` Duncan
  0 siblings, 0 replies; 23+ messages in thread
From: Duncan @ 2008-05-06 17:08 UTC (permalink / raw
  To: gentoo-amd64

Raffaele BELARDI <raffaele.belardi@st.com> posted
1210079881.6197.36.camel@ws2912.agr.st.com, excerpted below, on  Tue, 06
May 2008 15:18:01 +0200:

> I confirm that passing -I 128 to mkfs.ext2 fixes the problem, now grub
> finds the stage files and installs happily on the ext2 partition.
> 
> thanks again,

Happy to be of help, but it's coincidence, really.  I read the thread 
here, then one of my RSS feeds had that article the next day... and I put 
two and two and two together including the Gentoo-dev thread I had read 
earlier, but hadn't realized the significance of at the time.  Still, 
glad to pass it on once I got all the pieces and realized they fit. =8^)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

-- 
gentoo-amd64@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2008-05-06 17:09 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-30  6:43 [gentoo-amd64] boot Gentoo from USB key Raffaele BELARDI
2008-04-30  6:49 ` Kyle Liddell
2008-04-30  6:56 ` Branko Badrljica
2008-04-30  7:44   ` Raffaele BELARDI
2008-05-05  8:40     ` Raffaele BELARDI
2008-04-30 10:47 ` [gentoo-amd64] " Duncan
2008-04-30 12:35 ` [gentoo-amd64] " Jason
2008-04-30 14:29   ` Branko Badrljica
2008-04-30 14:47     ` Jason
2008-04-30 15:05       ` Branko Badrljica
2008-04-30 15:40         ` Jason
2008-04-30 15:55           ` Branko Badrljica
2008-05-05  8:53           ` Raffaele BELARDI
2008-04-30 17:39 ` Hernan Lopez
2008-04-30 17:58   ` Branko Badrljica
2008-05-01  7:26     ` Branko Badrljica
2008-04-30 18:03 ` Drake Donahue
2008-04-30 18:21   ` Drake Donahue
2008-05-02 11:22 ` [gentoo-amd64] " Duncan
2008-05-02 15:33   ` Drake Donahue
2008-05-05  8:38     ` Raffaele BELARDI
2008-05-06 13:18       ` Raffaele BELARDI
2008-05-06 17:08         ` Duncan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox