Add asciidoc, xsltproc and docbook-xsl to Build-Depends
[grml2usb.git] / grml2usb.8.txt
1 grml2usb(8)
2 ==========
3
4 Name
5 ----
6 grml2usb - install grml ISO(s) on usb device for booting
7
8 Synopsis
9 --------
10 grml2usb [ options ] <ISO[s]> <device>
11
12 *******************************************************************************
13 Important! The grml team does not take responsibility for loss of any data!
14 *******************************************************************************
15
16 Introduction
17 ------------
18
19 grml2usb installs grml on a given partition of your usb device and makes it
20 bootable. It provides multi-iso support, meaning you can specify several grml
21 ISOs on the command line at once and select the grml flavour you would like to
22 boot on the bootbrompt then. Note that the *first* ISO specified on the grml2usb
23 command line will become the default one (that's the one that will boot when
24 just pressing enter on the bootprompt or wait until the boot timeout matches).
25
26 [IMPORTANT]
27 By default a compatible master boot record (MBR) is installed on the device
28 (being for example /dev/sdb when executing 'grml2usb grml.iso /dev/sdb1')
29 and grub is being used as default bootloader. Avoid installation of the
30 default MBR using the --skip-mbr option or if you encounter any problems
31 with the default MBR consider using --syslinux-mbr instead. If bootloader
32 grub doesn't work for you check out the --syslinux option.
33
34 Options
35 -------
36
37 The ISO[s] might be the path to one or multiple grml-ISOs as well as the path to
38 the currently running live-system (being /live/image).
39
40 The device either might be a device name like /dev/sda1 or a directory. When
41 specifying a device name the device is mounted automatically. When specifying a
42 directory it won't be touched but instead grml2usb is assuming that you did set
43 up a bootloader on your own and a bootloader won't be installed automatically.
44
45 The following options are supported:
46
47   *--bootoptions=...*::
48
49 Use specified bootoptions as default.
50
51   *--bootloader-only*::
52
53 Do *not* copy files but instead just install a bootloader.  Note that the boot
54 addons are copied to /boot/addons at this stage as well.  If you want to skip
55 copying the boot addons consider using the --skip-addons option.
56
57   *--copy-only*::
58
59 Copy files only but do *not* install a bootloader.
60
61   *--dry-run*::
62
63 Avoid executing commands, instead show what would be executed.
64 Warning: please notice that the ISO has to be mounted anyway, otherwise
65 identifying the grml flavour would not be possible.
66
67   *--fat16*::
68
69 Format specified partition with FAT16.
70 **Important:** this will destroy any existing data on the specified partition!
71
72   *--force*::
73
74 Force any (possible dangerous) actions requiring manual interaction (like --fat16).
75
76   *--help*::
77
78 Display usage information and exit.
79
80   *--initrd=...*::
81
82 Install specified initrd instead of the default. You might want to specify
83 option *--kernel* as well. (Be aware when using multiboot setup.)
84 [Notice: not implemented yet.]
85
86   *--kernel=...*::
87
88 Install specified kernel instead of the default. You might want to specify
89 option *--initrd* as well. (Be aware when using multiboot setup.)
90 [Notice: not implemented yet.]
91
92   *--lilo-binary=...*::
93
94 Use specified lilo executable for installing master boot record (MBR) when using
95 the --syslinux-mbr option. By default any system wide (from $PATH) lilo
96 executable is taken.  If there can not be find any lilo executable the
97 statically compiled version of the grml2usb Debian package (see
98 /usr/share/grml2usb/lilo/lilo.static.[amd64|i386]) is taken.
99
100   *--mbr-manager=...*::
101
102 Install master boot record (MBR) with integrated boot manager, providing a
103 simple selection for specifying the device for booting from. This options is
104 available only when using the default MBR and won't work if using the
105 --syslinux-mbr option.
106
107   *--quiet*::
108
109 Do not output anything but just errors on console.
110
111   *--skip-addons*::
112
113 Do not install /boot/addons/ files (like dos, grub, memdisk,...).
114
115   *--skip-mbr*::
116
117 Do not touch/install the master boot record (MBR).
118
119   *--syslinux*::
120
121 Install syslinux bootloader instead of the default (being grub).
122
123   *--syslinux-mbr*::
124
125 Install syslinux master boot record (MBR) instead of the default one.  By
126 default a very compatible MBR is installed, if you encounter any problems
127 with it you can try using the syslinux MBR instead. If that works for you please
128 <<X7,let us know>> so we can adjust our default MBR accordingly.
129 Note: When using the --syslinux-mbr option lilo is executed before the MBR
130 is installed so the according partitions are set active.
131
132   *--squashfs=*::
133
134 Install specified squashfs file instead of the default.
135 [Notice: not implemented yet.]
136
137   *--uninstall*::
138
139 Uninstall grml ISO files.
140 [Notice: not implemented yet.]
141
142   *-v*, *--version*::
143
144 Return version and exit.
145
146   *--verbose*::
147
148 Enable verbose mode.
149
150 Developers Corner
151 -----------------
152
153 Directory layout on usb device
154 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
155
156   boot/ ->
157     |-- addons/
158     |   |-- allinone.img     [grub - all in one image]
159     |   |-- bsd4grml/        [MirBSD]
160     |   |-- balder10.imz     [FreeDOS]
161     |   |-- memdisk          [chainloading helper]
162     |   |-- memtest          [memtest86+]
163     |-- release/
164     |   |-- grml/
165     |   |   |-- linux26      [Kernel]
166     |   |   |-- initrd.gz    [initramfs]
167     |   |-- grml64
168     |   |   |-- linux26      [Kernel]
169     |   |   |-- initrd.gz    [initramfs]
170     |   |-- grml-medium
171     |   |   |-- linux26      [...]
172     |   |   |-- initrd.gz
173     |   |-- grml64-medium
174     |   |   |-- linux26
175     |   |   |-- initrd.gz
176     |   |-- grml-small
177     |   |   |-- linux26
178     |   |   |-- initrd.gz
179     |   `-- grml64-small
180     |       |-- linux26
181     |       |-- initrd.gz
182     |-- grub/
183     |   |-- grml.png         [splash screen for grub2]
184     |   |-- grub.cfg         [configuration file for grub2]
185     |   |-- menu.lst         [configuration file for grub1]
186     |   |-- splash.xpm.gz    [splash screen for grub1]
187     `-- syslinux/
188         |-- boot.msg         [boot splash for syslinux]
189         |-- f1               [screen when pressing f1]
190         |-- f2               [screen when pressing f2]
191         |-- f3               [...]
192         |-- f4
193         |-- f5
194         |-- f6
195         |-- f7
196         |-- f8
197         |-- f9
198         |-- f10
199         |-- logo.16          [graphical part of boot splash]
200         `-- syslinux.cfg     [configuration file for syslinux]
201
202   grml/
203     |-- grml2usb.txt         [not yet implemented]
204     |-- grml-cheatcodes.txt  [list of bootoptions for grml]
205     |-- grml-version.txt     [file containing information about grml-version]
206     |-- LICENSE.txt          [license information]
207     |-- md5sums              [md5sums of original ISO]
208     |-- README.txt           [informational text]
209     `-- web/                 [browser related files]
210         |-- index.html
211         |-- style.css
212         `-- images/
213             |-- button.png
214             |-- favicon.png
215             |-- linux.jpg
216             `-- logo.png
217
218   live/
219     |-- filesystem.module      [file specifying which squashfs should be used by default]
220     |-- grml.squashfs          [squashfs file]
221     |-- grml-medium.module     [module specifying which squashfs should be used for grml-medium]
222     |-- grml-medium.squashfs   [squashfs file for grml-medium]
223     |-- grml-small.module      [...]
224     |-- grml-small.squashfs
225     |-- grml64.module
226     |-- grml64.squashfs
227     |-- grml64-medium.module
228     |-- grml64-medium.squashfs
229     |-- grml64-small.module
230     `-- grml64-small.squashfs
231
232 Grabbing the source
233 ~~~~~~~~~~~~~~~~~~~
234
235   % git clone git://git.grml.org/grml2usb.git
236
237 Developers Debugging Hints
238 ~~~~~~~~~~~~~~~~~~~~~~~~~~
239
240 To play with grml2usb you can avoid using a real device via a loopback file
241 setup, like:
242
243   # dd if=/dev/zero of=~/loopback bs=1M count=100 # adjust size to your needs
244   # losetup /dev/loop1 ~/loopback
245
246 Then create according partitions either running for example:
247
248   # echo -en "n\np\n1\n\n\nt\n6\na\n1\n w\n" | fdisk /dev/loop1
249
250 or:
251
252   # parted /dev/loop1 -s "mkpart primary fat16 0 -1s mkfs 1 fat16"
253
254 Finally create a filesystem and execute grml2usb as needed:
255
256   # mkfs.vfat /dev/loop1
257   # grml2usb --bootloader-only /grml/isos/grml-small_2008.11.iso /dev/loop1
258
259 Performance tracing
260 ~~~~~~~~~~~~~~~~~~~
261
262   # blktrace -d /dev/sdb -o - | blkparse -i -
263   # grml2usb grml_2008.11.iso /dev/sdb1
264
265 [[X6]]
266 Troubleshooting and Pitfalls when booting
267 -----------------------------------------
268
269 Here is a list of common error messages from BIOS/bootloader when trying to boot
270 from USB.
271
272 ///////////////////////////////////////////////////////////
273 TODO: better list type for the error message / reason part?
274 See http://www.methods.co.nz/asciidoc/userguide.html
275 ///////////////////////////////////////////////////////////
276
277 [horizontal]
278 *Error message*:: ran out of input data. System halted
279
280 *Reason*:: Everything OK, except for the filesystem used on your usb device. So
281 instead of fat16 you are using for example fat32. Fix: use the appropriate
282 filesystem (fat16 for usb pens usually). The Bootsplash might be displayed, the
283 kernel loads but you very soon get the error message.
284
285 *Error message*:: Invalid operating system
286
287 *Reason*:: the partition layout is not ok. Very probably there's no primary
288   partition (/dev/sdX{1..4}) or none has the flag 'bootable' set.
289
290 *Error message*:: No operating system found.
291
292 *Reason*:: you forgot to set the boot-flag on the partition. Or there really isn't
293 any operating system at all. :)
294
295 *Error message*:: kernel-panic: unable to mount root-fs...
296
297 *Reason*:: Kernel boots but fails to find the root filesystem. The root=
298 argument in your kernel commandline is pointing to the wrong device. Adjust
299 root=..., consider using root=UUID=....
300
301 *Error message*::  Could not find kernel image: ...
302
303 *Reason*:: either a broken isolinux/syslinux version or a broken BIOS. Check out
304 whether the vendor provides a BIOS update or if using bootloader grub instead of
305 isolinux/syslinux fixes the problem.
306
307 Frequently Asked Questions (FAQ)
308 --------------------------------
309
310 What's the difference between grml2hd and grml2usb?
311 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
312
313 grml2hd installs a running grml system to a harddisk. When rebooting the
314 harddisk installation can be modified and changes will find their way to the
315 harddisk immediately.  grml2usb copies just the compressed chroot filesystem
316 (being the squashfs file), some further informational files and a bootloader to
317 your device. This way you don't need as much space as with a harddisk
318 installation (just a USB device with >=ISO size) and when rebooting the system
319 your changes will be lost (even though a persistent root feature is
320 work-in-progress). Think of using a better CD version: booting is (usually)
321 faster, you don't need to burn a new CD when a new ISO version arrives (just
322 install the new ISO using grml2usb) and you can carry additional files on a
323 writable medium with yourself.
324
325 Why is there a menu.lst and a grub.cfg inside /boot/grub/?
326 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
327
328 grml2usb supports grub version 1 (grub1) as well as grub version 2 (grub2).
329 Whereas grub1 uses menu.lst the new version grub2 needs grub.cfg.
330 Providing both files allows grml2usb to install grub on the target device
331 no matter which grub version is available on the host where grml2usb is
332 executed on.
333
334 Why do I have to use a FAT16 filesystem?
335 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
336
337 You have to use a FAT16 filesystem only if you consider using syslinux, Syslinux
338 (currently) does not support any other filesystems. If you want to use another
339 filesystem (like ext2/3) just don't use syslinux (drop the --syslinux option)
340 but use the default bootloader (grub) instead.
341
342 I think I've got a really cool idea!
343 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
344
345 Please <<X7,report it to the author>>. Or even better: send us a patch. :)
346
347 I've problems with booting from USB.
348 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
349
350 Check out <<X6,Troubleshooting and Pitfalls when booting>>.
351
352 I've found a bug!
353 ~~~~~~~~~~~~~~~~~
354
355 Please <<X7,report it to the author>>. Please provide usage examples and output
356 of your grml2usb commandline (consider using the "--verbose" option).
357
358 Usage examples
359 --------------
360
361   # grml2usb /home/grml/grml_2008.11.iso /dev/sdb1
362
363 Install specified ISO on device /dev/sdb1.
364
365   # grml2usb /home/grml/grml_2008.11.iso /home/grml/grml_small_2008.11.iso /dev/sdb1
366
367 Install specified ISOs on device /dev/sdb1 for multibooting ISOs.
368 Note: boot "grml" as usual, for booting grml-small use "grml-small on the
369 bootprompt, for grml64 use "grml64" and so on... The *first* specified ISO is
370 the one being the default (when just pressing enter or waiting until the timeout
371 is reached).
372
373   # grml2usb --fat16 /home/grml/grml_2008.11.iso /dev/sdb1
374
375 Install specified ISO on device /dev/sdb1 and format partition /dev/sdb1 with
376 FAT16 filesystem.
377
378   # grml2usb --syslinux /home/grml/grml_2008.11.iso /dev/sdb1
379
380 Install specified ISO on device /dev/sdb1 and use syslinux as bootloader
381 (instead of grub being the default).
382
383   # grml2usb --kernel=/boot/vmlinuz-2.6.28-grml --initrd=/boot/initrd.img-2.6.28-grml \
384              /home/grml/grml_2008.11.iso /dev/sdb1
385
386 Install specified ISO on device /dev/sdb1 but use given kernel and initrd
387 instead of the ones provided by the ISO.
388
389   # grml2usb --squashfs=/grml/grml-live/grml_cd/live/grml.squashfs \
390              /home/grml/grml_2008.11.iso /dev/sdb1
391
392 Install specified ISO on device /dev/sdb1 but use given squashfs
393 file instead of the one provided by the ISO.
394
395   # grml2usb --bootoptions="lang=de ssh=mysecret" grml_2008.11.iso /dev/sdb1
396
397 Install specified ISO on device /dev/sdb1 and use "lang=de ssh=mysecret" as
398 default bootoptions.
399
400 Online Ressources
401 -----------------
402
403 Check out the link:http://grml.org/grml2usb/[grml2usb webpage] and the
404 link:http://git.grml.org/?p=grml2usb.git[grml2usb git repository].
405
406 Bugs
407 ----
408 Please report feedback, bugreports and wishes <<X7,to the author>>.
409
410 [[X7]]
411 Author
412 ------
413 Michael Prokop <mika@grml.org>
414
415 /////////////////////////////////////////////////////////////////
416 http://wiki.grml.org/doku.php?id=tips#multiboot_usb_pen
417 http://www.startx.ro/sugar/isotostick.sh
418 https://help.ubuntu.com/community/Installation/FromUSBStick
419 http://unetbootin.sourceforge.net/
420 http://www.tux.org/pub/people/kent-robotti/looplinux/rip/mkusb.sh
421 https://fedorahosted.org/liveusb-creator/
422 /////////////////////////////////////////////////////////////////