Gentoo Archives: gentoo-amd64

From: Branko Badrljica <brankob@××××××××××.com>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] boot Gentoo from USB key
Date: Wed, 30 Apr 2008 06:56:08
Message-Id: 48181818.5060502@avtomatika.com
In Reply to: [gentoo-amd64] boot Gentoo from USB key by Raffaele BELARDI
1 I had the same two problems.
2
3 WRT to grub, I don't remember anymore exactly what I have done, but I
4 think I have
5 copied sectors 1-62 from one conventional grub-bootable HDD to USB,
6
7 Or maybe used some old HDD and formated it, parittioned it like the USB
8 disk, copied /boot partition on it and set up grub on it, then copied
9 sectors 1-62 back to USB disk.
10 Sector 0 is for MBR codeand last few tens of bytes contain headers for
11 first 4 partitions, so it shouldn't be touched and first partition
12 begins with sector 63.
13
14 Something like that.
15
16
17 WRT to boot panics, kernel can't find USB key at boot since USB
18 initialisation code needs more time for key to stabilise. Use kernel
19 parameter rootdelay=10 for 10 second wait period for USB
20
21 Hope this helps.
22
23
24 BTW: You will in all likelyhood be dissapointed with USB key
25 performance. Its R/W throughput is comparable to HDD only on paper. In
26 reality it seems that USB can't cope efficiently with small sector-sized
27 writes but also scattered reads seem to be far from optimal.Either that
28 or USB driver really sucks on Linux.
29
30 It is very useable as fallback though. Like having one USB key soldered
31 directly on the MoBO and using it for boot if/when your HDD croaks or if
32 something eats your main boot option...
33
34
35 Regards,
36
37
38 Branko
39
40
41
42
43 Raffaele BELARDI wrote:
44 > In the process of building an amd64 diskless box, I am trying to make a
45 > bootable USB key with no success up to now.
46 >
47 > The first problem I encountered was related to ext2/vfat. I initially
48 > tried to format the key as ext2, but grub refuses to install on it. Even
49 > though I copied the /boot/grub/* directory into the key, and I see it is
50 > there, grub does not see it. The problem does not happen with vfat.
51 >
52 > So I worked around that and created two partitions in the key, a small
53 > vfat for the /boot and a 2Gb ext2 for the /. I copied the stage3 into
54 > the / with no problem. In the /boot I put the kernel image which I am
55 > already using on the same box, for now with discs still connected. All
56 > the modules are compiled in.
57 >
58 > When I boot from the key, grub enters the shell (although I did create
59 > the grub.conf and menu.1st, so I don't understand why it doesn't show
60 > the menu). I manually specify the kernel file location and root
61 > parameter:
62 >
63 >
64 >> kernel /linux-2.6.24-gentoo-r4 root=/dev/sdg1
65 >> boot
66 >>
67 >
68 > The kernel starts to load, but panics because it is unable to find the
69 > root partition. When it stops it shows the available partitions, these
70 > include all the hard disk partitions but no USB key partition. In fact,
71 > if I omit the 'root' parameter from the grub shell the boot works fine
72 > but it uses the hard disk root partition instead of the USB one.
73 >
74 > >From the log on the screen the USB controller seems correctly detected,
75 > so I don't understand why it is not finding the root. While writing this
76 > one idea comes to my mind, maybe it is failing because I attach the key
77 > to a SDC/MMC/USB card reader? This evening I'll try to plug it into a
78 > different USB slot.
79 >
80 > Any other ideas welcome.
81 >
82 > raffaele
83 >
84 >
85
86 --
87 gentoo-amd64@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-amd64] boot Gentoo from USB key Raffaele BELARDI <raffaele.belardi@××.com>