Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: Gentoo Users List <gentoo-user@l.g.o>
Subject: [gentoo-user] Install from USB stick; here's how
Date: Mon, 07 Jan 2013 03:06:55
1 For those of you who don't want to do the tap-dance listed at...
4 * My netbook's harddrive is normally /dev/sda, except when I boot from a
5 USB stick. The stick will become /dev/sda and the harddrive becomes
6 /dev/sdb
8 * My desktop's harddrive is also /dev/sda. I took the linux minimal
9 install ISO, ran isohybrid on it, with the command...
11 isohybrid install-x86-minimal-20121213.iso
13 If you don't have isohybrid...
15 emerge sys-boot/syslinux
17 * I then copied it over to a USB stick (/dev/sdb) with the command...
19 dd bs=4M if=install-x86-minimal-20121213.iso of=/dev/sdb
21 Note that it's just the device letter. There is no partition number.
22 Your letter may be different. Note also that the USB stick must *NOT*
23 be mounted. - WARNING - be absolutely certain you have the letter right.
24 E.g. using your harddrive's device letter would zap your harddrive.
26 * I booted from the USB key and had an uneventful install. There were a
27 few differences...
29 - stuff that would normally be done to /dev/sda was done to /dev/sdb,
30 because the USB stick with the install ISO was /dev/sda
32 - I don't know if it was the install-from-USB, or my weird lan
33 (, but net-setup did not take for my wired eth0
34 address. I ran ifconfig and route manually.
36 - lilo had to be set up differently for the first boot. This is a
37 section in its own right
39 * lilo will be written when the netbook's harddrive is /dev/sdb, but
40 when the USB key is removed, it will boot with the harddrive as
41 /dev/sda. lilo does not allow you to specify a non-existant partition
42 in the "image" root section. But fortunately, you can do so in the
43 "append" line, and even more fortunately, the "append" line overrides
44 the "image" root section. Here's what I did...
46 - WARNING - Change the "# MBR to install LILO to:" section to
48 # MBR to install LILO to:
49 boot = /dev/sdb
51 The default /dev/sda will overwrite the boot record of the install
52 USB stick, and not update your harddrive
54 - Since my root is on partition ID 6, I set the image entry like so.
55 Adjust for your system
57 image = /boot/kernel-production
58 root = /dev/sdb6
59 label = Production
60 read-only # read-only for checking
61 append = "root=/dev/sda6"
63 Note that the main entry specifies root as /dev/sdb6 but the append
64 entry specifies root as root=/dev/sda6.
66 - run the "lilo" command. It will issue a warning about not going to
67 the first disc; ignore the warning. Reboot, and remember to take
68 out the USB stick before the system can boot from it.
70 - First thing to do after the first boot is to edit /etc/lilo.conf to
71 normal values; i.e. usually put "/dev/sda" in as expected
73 # MBR to install LILO to:
74 boot = /dev/sda
76 image = /boot/kernel-production
77 root = /dev/sda6
78 label = Production
79 read-only # read-only for checking
80 append = ""
82 Adjust for your system. Then run lilo. You now have a standard
83 lilo setup.
85 * You can keep the USB stick as "rescue CD on a USB stick". If you want
86 to return the USB stick to normal use, you'll have to zero out the
87 first sector before you can repartition and reformat it. The command
88 (assuming the stick is /dev/sdb) is...
90 dd count=1 bs=512 if=/dev/zero of=/dev/sdb
92 - WARNING - be absolutely certain you have the letter right. E.g.
93 using your harddrive's device letter would zap your harddrive.
95 --
96 Walter Dnes <waltdnes@××××××××.org>
97 I don't run "desktop environments"; I run useful applications


Subject Author
Re: [gentoo-user] Install from USB stick; here's how Bruce Hill <daddy@×××××××××××××××××××××.com>
[gentoo-user] Re: Install from USB stick; here's how Grant Edwards <grant.b.edwards@×××××.com>