1
<!-- retain these comments for translator revision tracking -->
2
<!-- original version: 14337 untranslated -->
4
<sect1 condition="bootable-usb" id="boot-usb-files">
5
<title>Preparing Files for USB Memory Stick Booting</title>
9
For preparing the USB stick you will need a system where GNU/Linux is
10
already running and where USB is supported. You should assure that the
11
usb-storage kernel module is loaded (<userinput>modprobe
12
usb-storage</userinput>) and try to find out which SCSI device the USB
13
stick has been mapped to (in this example
14
<filename>/dev/sda</filename> is used). To write to your stick, you
15
will probably have to turn off its write protection switch.
19
Note, that the USB stick should be at least 128 MB in size (smaller
20
setups are possible if you follow <xref linkend="usb-copy-flexible"/>).
24
<sect2 id="usb-copy-easy">
25
<title>Copying the files - the easy way</title>
28
There is an all-in-one file <filename>hd-media/boot.img.gz</filename>
29
which contains all the installer files (including the kernel) as well
30
as <command>SYSLINUX</command> and its configuration file. You only
31
have to extract it directly to to your USB stick:
33
<informalexample><screen>
35
gzip -dc boot.img.gz >/dev/<replaceable>sda</replaceable>
37
</screen></informalexample>
39
Of course this will destroy anything already on the device, so take
40
care that you use the correct device name for your USB stick.
44
After that, mount the USB memory stick (<userinput>mount /dev/sda
45
/mnt</userinput>), which will now have a FAT filesystem on it, and
46
copy a Debian netinst or businesscard ISO image to it. Please note
47
that the file name must end in <filename>.iso</filename>. Unmount the
48
stick (<userinput>umount /mnt</userinput>) and you are done.
53
<sect2 id="usb-copy-flexible">
54
<title>Copying the files - the flexible way</title>
57
If you like more flexibility or just want to know what's going on, you
58
should use the following method to put the files on your stick. We
59
will show how to setup the memory stick to use the first partition,
60
instead of entire device.
64
Since most USB sticks come pre-configured with a single FAT16
65
partition, you probably won't have to repartition or reformat the
66
stick. If you have to do that anyway, use <command>cfdisk</command>
67
or any other partitioning tool for creating a FAT16 partition and then
70
<informalexample><screen>
72
mkdosfs /dev/<replaceable>sda1</replaceable>
74
</screen></informalexample>
76
Take care that you use the correct device name for your USB stick. The
77
<command>mkdosfs</command> command is contained in the
78
<classname>dosfstools</classname> Debian package.
82
In order to start the kernel after booting from the USB stick, we will
83
put a boot loader on the stick. Although any boot loader
84
(e.g. <command>LILO</command>) should work, it's convenient to use
85
<command>SYSLINUX</command>, since it uses a FAT16 partition and can
86
be reconfigured by just editing a text file. Any operating system
87
which supports the FAT file system can be used to make changes to the
88
configuration of the boot loader.
92
To put <command>SYSLINUX</command> on the FAT16 partition on your USB
93
stick, install the <classname>syslinux</classname> and
94
<classname>mtools</classname> packages on your system, and type
96
<informalexample><screen>
98
syslinux /dev/<replaceable>sda1</replaceable>
100
</screen></informalexample>
102
Again, take care that you use the correct device name. The partition
103
must not be mounted when starting <command>SYSLINUX</command>. This
104
procedure writes a boot sector to the partition and creates the file
105
<filename>ldlinux.sys</filename> which contains the boot loader code.
109
Mount the parition (<userinput>mount /dev/sda1 /mnt</userinput>) and
110
copy the following files from the Debian archives to the stick:
115
<filename>vmlinuz</filename> (kernel binary)
120
<filename>initrd.gz</filename> (initial ramdisk image)
125
<filename>syslinux.cfg</filename> (SYSLINUX configuration file)
130
Optional kernel modules
135
If you want to rename the files, please note that
136
<command>SYSLINUX</command> can only process DOS (8.3) file names.
140
The <filename>syslinux.cfg</filename> configuration file should
141
contain the following two lines:
143
<informalexample><screen>
146
append initrd=initrd.gz ramdisk_size=10000 root=/dev/rd/0 init=/linuxrc devfs=mount,dall rw
148
</screen></informalexample>
150
Please note, that the <userinput>ramdisk_size</userinput> parameter
151
may need to be increased, depending on the image you are booting.
155
Now you should put any Debian ISO image (businesscard, netinst or even
156
a full one) onto your stick (if it fits). The file name of such an
157
image must end in <filename>.iso</filename>.
161
If you want to install over the network, without using an ISO image,
162
you will of course skip the previous step. Moreover you will have to
163
use the initial ramdisk from the <filename>netboot</filename>
164
directory instead of the one from <filename>hd-media</filename>,
165
because <filename>hd-media/initrd.gz</filename> does not have network
170
When you are done, unmount the USB memory stick (<userinput>umount
171
/mnt</userinput>) and activate its write protection switch.
173
</para><warning><para>
175
If your system refuses to boot from the memory stick, the stick may
176
contain an invalid master boot record (MBR). To fix this, use the
177
<command>install-mbr</command> command from the package
178
<classname>mbr</classname>:
180
<informalexample><screen>
182
install-mbr /dev/<replaceable>sda</replaceable>
184
</screen></informalexample>