grub2 changes: use ascii.pf2 as grub2 font; support terminal_output command
[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 Introduction
18 ------------
19
20 grml2usb installs grml on a given partition of your usb device and makes it
21 bootable. It provides multi-iso support, meaning you can specify several grml
22 ISOs on the command line at once and select the grml flavour you would like to
23 boot on the bootprompt then. Note that the *first* ISO specified on the grml2usb
24 command line will become the default one (that's the one that will boot when
25 just pressing enter on the bootprompt or wait until the boot timeout matches).
26
27 [IMPORTANT]
28 By default a compatible master boot record (MBR) is installed on the device
29 (being for example /dev/sdx when executing 'grml2usb grml.iso /dev/sdx1')
30 and grub is being used as default bootloader. Avoid installation of the
31 default MBR using the --skip-mbr option or if you encounter any problems
32 with the default MBR consider using --syslinux-mbr instead. If bootloader
33 grub doesn't work for you check out the --syslinux option.
34
35 [[options]]
36 Options
37 -------
38
39 The ISO[s] should be the path to one or multiple grml-ISOs and/or the path to
40 the currently running live-system (being /live/image).
41
42 The device either might be a device name like /dev/sdx1 or a directory. When
43 specifying a device name the device is mounted automatically. When specifying a
44 directory grml2usb is assuming that you did set up a bootloader on your own (or
45 don't need one) and a bootloader won't be installed automatically.
46
47 The following options are supported:
48
49   *\--bootoptions=...*::
50
51 Use specified bootoptions as default.
52
53   *\--bootloader-only*::
54
55 Do *not* copy files but instead just install a bootloader.  Note that the boot
56 addons are copied to /boot/addons at this stage as well.  If you want to skip
57 copying the boot addons consider using the --skip-addons option.
58
59   *\--copy-only*::
60
61 Copy files only but do *not* install a bootloader.
62
63   *\--dry-run*::
64
65 Avoid executing commands, instead show what would be executed.
66 Warning: please notice that the ISO has to be mounted anyway, otherwise
67 identifying the grml flavour would not be possible.
68
69   *\--fat16*::
70
71 Format specified partition with FAT16.
72 **Important:** this will destroy any existing data on the specified partition!
73
74   *\--force*::
75
76 Force any (possible dangerous) actions requiring manual interaction (like --fat16).
77
78   *\--help*::
79
80 Display usage information and exit.
81
82 //////////////////////////////////////////////////////////////////////////
83   *\--initrd=...*::
84
85 Install specified initrd instead of the default. You might want to specify
86 option *--kernel* as well. (Be aware when using multiboot setup.)
87 [Notice: not implemented yet.]
88 //////////////////////////////////////////////////////////////////////////
89
90 //////////////////////////////////////////////////////////////////////////
91   *\--kernel=...*::
92
93 Install specified kernel instead of the default. You might want to specify
94 option *--initrd* as well. (Be aware when using multiboot setup.)
95 [Notice: not implemented yet.]
96 //////////////////////////////////////////////////////////////////////////
97
98   *\--lilo-binary=...*::
99
100 Use specified lilo executable for installing master boot record (MBR) when using
101 the --syslinux-mbr option. By default any system wide (from $PATH) lilo
102 executable is taken.  If there can not be find any lilo executable the
103 statically compiled version of the grml2usb Debian package (see
104 /usr/share/grml2usb/lilo/lilo.static.[amd64|i386]) is taken.
105
106   *\--mbr-menu*::
107
108 Install master boot record (MBR) with integrated boot menu: interactively choose
109 the partition to boot from, with a timeout to load the default partition, or
110 boot from floppy. When NOT using the --mbr-menu option a MBR with LBA and large
111 disc support but without an integrated boot menu is installed (so it's not
112 visible at all but instead directly jumps to the bootloader - being grub or
113 syslinux). Note: This options is available only when using the default MBR and
114 won't have any effect if you're using the --syslinux-mbr option.
115
116   *\--quiet*::
117
118 Do not output anything but just errors on console.
119
120   *\--skip-addons*::
121
122 Do not install /boot/addons/ files (like dos, grub, memdisk,...).
123
124   *\--skip-grub-config*::
125
126 Skip generation of grub configuration files. By default the configuration
127 files for syslinux *and* grub will be written so you've a working configuration
128 file no matter whether you're using grub or syslinux as bootloader.
129
130   *\--skip-mbr*::
131
132 Do not touch/install the master boot record (MBR).
133
134   *\--skip-syslinux-config*::
135
136 Skip generation of syslinux configuration files. By default the configuration
137 files for syslinux *and* grub will be written so you've a working configuration
138 file no matter whether you're using grub or syslinux as bootloader.
139
140   *\--syslinux*::
141
142 Install syslinux bootloader instead of the default (being grub).
143
144   *\--syslinux-mbr*::
145
146 Install syslinux' master boot record (MBR, which is booting from the partition
147 with the "active" flag set) instead of the default one.  If you encounter any
148 problems with the default MBR you can try using the syslinux MBR instead. If
149 that works for you please <<author,let us know>> so we can adjust our default
150 MBR accordingly.  Note: When using the --syslinux-mbr option lilo is executed
151 before the MBR is installed so the according partitions are set active.
152
153 //////////////////////////////////////////////////////////////////////////
154   *\--squashfs=*::
155
156 Install specified squashfs file instead of the default.
157 [Notice: not implemented yet.]
158 //////////////////////////////////////////////////////////////////////////
159
160 //////////////////////////////////////////////////////////////////////////
161   *\--uninstall*::
162
163 Uninstall grml ISO files.
164 [Notice: not implemented yet.]
165 //////////////////////////////////////////////////////////////////////////
166
167   *-v*, *\--version*::
168
169 Return version and exit.
170
171   *\--verbose*::
172
173 Enable verbose mode.
174
175 Developers Corner
176 -----------------
177
178 [[directory-layout]]
179 Directory layout on usb device
180 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181
182   boot/ ->
183     |-- addons/
184     |   |-- allinone.img     [grub - all in one image]
185     |   |-- bsd4grml/        [MirBSD]
186     |   |-- balder10.imz     [FreeDOS]
187     |   |-- memdisk          [chainloading helper]
188     |   |-- memtest          [memtest86+]
189     |-- release/
190     |   |-- grml/
191     |   |   |-- linux26      [Kernel]
192     |   |   |-- initrd.gz    [initramfs]
193     |   |-- grml64
194     |   |   |-- linux26      [Kernel]
195     |   |   |-- initrd.gz    [initramfs]
196     |   |-- grml-medium
197     |   |   |-- linux26      [...]
198     |   |   |-- initrd.gz
199     |   |-- grml64-medium
200     |   |   |-- linux26
201     |   |   |-- initrd.gz
202     |   |-- grml-small
203     |   |   |-- linux26
204     |   |   |-- initrd.gz
205     |   `-- grml64-small
206     |       |-- linux26
207     |       |-- initrd.gz
208     |-- grub/
209     |   |-- grml.png         [splash screen for grub2]
210     |   |-- grub.cfg         [configuration file for grub2]
211     |   |-- menu.lst         [configuration file for grub1]
212     |   |-- splash.xpm.gz    [splash screen for grub1]
213     `-- syslinux/
214         |-- boot.msg         [boot splash for syslinux]
215         |-- f1               [screen when pressing f1]
216         |-- f2               [screen when pressing f2]
217         |-- f3               [...]
218         |-- f4
219         |-- f5
220         |-- f6
221         |-- f7
222         |-- f8
223         |-- f9
224         |-- f10
225         |-- logo.16          [graphical part of boot splash]
226         `-- syslinux.cfg     [configuration file for syslinux]
227
228   grml/
229     |-- grml2usb.txt         [not yet implemented]
230     |-- grml-cheatcodes.txt  [list of bootoptions for grml]
231     |-- grml-version.txt     [file containing information about grml-version]
232     |-- LICENSE.txt          [license information]
233     |-- md5sums              [md5sums of original ISO]
234     |-- README.txt           [informational text]
235     `-- web/                 [browser related files]
236         |-- index.html
237         |-- style.css
238         `-- images/
239             |-- button.png
240             |-- favicon.png
241             |-- linux.jpg
242             `-- logo.png
243
244   live/
245     |-- grml/
246     |   |-- filesystem.module    [module specifying which squashfs should be used for grml]
247     |   `-- grml.squashfs        [squashfs file for grml]
248     |-- grml-medium/
249     |   |-- filesystem.module    [module specifying which squashfs should be used for grml-medium]
250     |   `-- grml-medium.squashfs [squashfs file for grml-medium]
251     |-- grml-small/
252     |   |-- filesystem.module    [module specifying which squashfs should be used for grml-medium]
253     |   `-- grml-small.squashfs  [squashfs file for grml-small]
254     `-- ...
255
256 [[source]]
257 Grabbing the source
258 ~~~~~~~~~~~~~~~~~~~
259
260   % git clone git://git.grml.org/grml2usb.git
261
262 [[debugging]]
263 Developers Debugging Hints
264 ~~~~~~~~~~~~~~~~~~~~~~~~~~
265
266 To play with grml2usb you can avoid using a real device via a loopback file
267 setup, like:
268
269   # dd if=/dev/zero of=~/loopback bs=1M count=100 # adjust size to your needs
270   # losetup /dev/loop1 ~/loopback
271
272 Then create according partitions either running for example:
273
274   # echo -en "n\np\n1\n\n\nt\n6\na\n1\n w\n" | fdisk /dev/loop1
275
276 or:
277
278   # parted /dev/loop1 -s "mkpart primary fat16 0 -1s mkfs 1 fat16"
279
280 Finally create a filesystem and execute grml2usb as needed:
281
282   # mkfs.vfat /dev/loop1
283   # grml2usb --bootloader-only /grml/isos/grml-small_2009.05.iso /dev/loop1
284
285 [[performance-tracing]]
286 Performance tracing
287 ~~~~~~~~~~~~~~~~~~~
288
289   # blktrace -d /dev/sdx -o - | blkparse -i -
290   # grml2usb grml_2009.05.iso /dev/sdx1
291
292 [[troubleshooting]]
293 Troubleshooting and Pitfalls when booting
294 -----------------------------------------
295
296 Here is a list of common error messages from BIOS/bootloader when trying to boot
297 from USB.
298
299 ///////////////////////////////////////////////////////////
300 TODO: better list type for the error message / reason part?
301 See http://www.methods.co.nz/asciidoc/userguide.html
302 ///////////////////////////////////////////////////////////
303
304 [horizontal]
305 *Error message*:: ran out of input data. System halted
306
307 *Reason*:: Everything OK, except for the filesystem used on your usb device. So
308 instead of fat16 you are using for example fat32. Fix: use the appropriate
309 filesystem (fat16 for usb pens usually). The Bootsplash might be displayed, the
310 kernel loads but you very soon get the error message.
311
312 *Error message*:: Invalid operating system
313
314 *Reason*:: the partition layout is not ok. Very probably there's no primary
315   partition (/dev/sdX{1..4}) or none has the flag 'bootable' set.
316
317 *Error message*:: No operating system found.
318
319 *Reason*:: you forgot to set the boot-flag on the partition. Or there really isn't
320 any operating system at all. :)
321
322 *Error message*:: kernel-panic: unable to mount root-fs...
323
324 *Reason*:: Kernel boots but fails to find the root filesystem. The root=
325 argument in your kernel commandline is pointing to the wrong device. Adjust
326 root=..., consider using root=UUID=....
327
328 *Error message*::  Could not find kernel image: ...
329
330 *Reason*:: either a broken isolinux/syslinux version or a broken BIOS. Check out
331 whether the vendor provides a BIOS update or if using bootloader grub instead of
332 isolinux/syslinux fixes the problem.
333
334 [[faq]]
335 Frequently Asked Questions (FAQ)
336 --------------------------------
337
338 [[download]]
339 Where can I get grml2usb?
340 ~~~~~~~~~~~~~~~~~~~~~~~~~
341
342 grml2usb is available as Debian package via link:http://deb.grml.org/[the
343 grml-testing Debian repository]. Please make sure you really have the Debian
344 package installed as having just the grml2usb script available is definitely
345 *NOT* enough!
346
347 If you do NOT have a Debian based system but still want to be able to use
348 grml2usb you can use the provided
349 link:http://grml.org/grml2usb/grml2usb.tgz[http://grml.org/grml2usb/grml2usb.tgz]
350 (link:http://grml.org/grml2usb/grml2usb.tgz.md5.asc[gpg signed md5 hash]).
351 Download and extract the tarball and execute the provided script 'install.sh'.
352
353 [[grml2hd-vs-grml2usb]]
354 What's the difference between grml2hd and grml2usb?
355 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
356
357 grml2hd installs a running grml system to a harddisk. When rebooting the
358 harddisk installation can be modified and changes will find their way to the
359 harddisk immediately.  grml2usb copies just the compressed chroot filesystem
360 (being the squashfs file), some further informational files and a bootloader to
361 your device. This way you don't need as much space as with a harddisk
362 installation (just a USB device with >=ISO size) and when rebooting the system
363 your changes will be lost (unless you are using the persistency feature, see
364 link:http://wiki.grml.org/doku.php?id=persistency[http://wiki.grml.org/doku.php?id=persistency]).
365 Think of using a better CD version: booting is (usually) faster, you don't need
366 to burn a new CD when a new ISO version arrives (just install the new ISO using
367 grml2usb) and you can carry additional files on a writable medium with yourself.
368
369 [[dd]]
370 Why can't I just dd the ISO to a USB device?
371 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
372
373 Well, you can. :)
374
375 [IMPORTANT]
376 Note that ANY existing data on your USB device will be destroyed when
377 using the dd approach.
378
379 Grab a recent grml ISO and use
380 link:http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE[isohybrid
381 from the syslinux project]:
382
383   % isohybrid grml_2009.05.iso
384
385 This allows you to dd the grml ISO to your USB device (use for example
386 link:http://www.chrysocome.net/rawwrite[rawwrite] if you've just a Windows
387 system available) running:
388
389   % dd if=grml_2009.05.iso of=/dev/sdX
390
391 where /dev/sdX is your USB device.
392
393 [TIP]
394 Upcoming stable versions of grml will provide dd-able ISOs straight
395 out-of-the-box (and current link:http://daily.grml.org/[daily snapshots] already
396 do) using a so called manifold boot method.
397
398 [[grml2usb-vs-dd]]
399 What's the difference between grml2usb and just using dd?
400 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
401
402 grml2usb does not remove any data from your USB device and does not alter the
403 partition table at all. grml2usb provides multi-ISO support, support for adding
404 default bootoptions and selecting the bootloader (grub vs. syslinux) without
405 having to manually touch the ISO at all.
406
407 [[grml2iso]]
408 What's grml2iso?
409 ~~~~~~~~~~~~~~~~
410
411 grml2iso is a script which uses grml2usb to generate a multiboot ISO out of
412 several grml ISOs. See 'man grml2iso' for further details.
413
414 [[menu-lst]]
415 Why is there a menu.lst and a grub.cfg inside /boot/grub/?
416 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
417
418 grml2usb supports grub version 1 (grub1) as well as grub version 2 (grub2).
419 Whereas grub1 uses menu.lst the new version grub2 needs grub.cfg.
420 Providing both files allows grml2usb to install grub on the target device
421 no matter which grub version is available on the host where grml2usb is
422 executed on.
423
424 [[stage1]]
425 grub-install fails with 'The file ../boot/grub/stage1 not read correctly"?!
426 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
427
428 Check whether the partition has the right partition type. For example do NOT use
429 FAT16 (partition type 6) when using a ext3 filesystem on the partition but
430 instead use the correct partition type ('83' - Linux) then.
431
432 [[grub-install-xfs_freeze]]
433 grub-install complains about /sbin/grub-install and/or xfs_freeze?!
434 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
435
436 The following message:
437
438   You shouldn't call /sbin/grub-install. Please call /usr/sbin/grub-install instead!
439   xfs_freeze: specified file ["/tmp/tmpqaBK6z/boot/grub"] is not on an XFS filesystem
440
441 This is "normal". grub-install sends those messages to stderr. To avoid hiding any
442 possible real error messages grml2usb doesn't ignore those messages.
443
444 [[device-map]]
445 grub-install complains about /boot/grub/device.map?!
446 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
447
448 The following message:
449
450   grub-probe: error: Cannot open `/boot/grub/device.map'
451
452 This is "normal" (at least with grub1). This isn't a problem, because the
453 device.map file will be generated on the target device anyway.
454
455 [[unary-operator]]
456 grub-install complains about a unary operator?!
457 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
458
459 The following message:
460
461   '/usr/sbin/grub-install: line 374: [: =: unary operator expected'
462
463 This is "normal". Just ignore it.
464
465 [[unknown-filesystem]]
466 grub-install fails with grub-probe: error: unknown filesystem?!
467 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
468
469 The following message:
470
471   grub-probe: error: unknown filesystem
472   Auto-detection of a filesystem module failed.
473   Please specify the module with the option `--modules' explicitly.
474
475 usually means that the device partition table says something else than the
476 filesystem on the device. For example using FAT16 as filesystem type and
477 using FAT32 as filesystem on the partition will not work. Either set filesystem
478 type to FAT32 or format the partition using FAT16. It is essential that
479 device partition table and filesystem use the same filesystem type.
480
481
482 [[splash-xpm]]
483 I'm getting something like "Error: /usr/share/grml2usb/grub/splash.xpm.gz can not be read"!?
484 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
485
486 Looks like you've only the grml2usb script itself available. Please make sure
487 you've the grml2usb Debian package installed. The most resent stable version is
488 available via link:http://deb.grml.org/[the grml-testing Debian repository].  If
489 you do not have a Debian system please see section <<download,Where can I get
490 grml2usb?>> in this FAQ.
491
492 [[fat16]]
493 Why do I have to use a FAT16 filesystem?
494 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
495
496 You have to use a FAT16 filesystem only if you consider using syslinux. Syslinux
497 (currently) does not support any other filesystems. If you want to use another
498 filesystem (like ext2/3) just don't use syslinux (drop the \--syslinux option)
499 but use the default bootloader (grub) instead.
500
501 [[cool-idea]]
502 I think I've got a really cool idea!
503 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
504
505 Great! Please check out
506 link:http://git.grml.org/?p=grml2usb.git;a=blob;f=TODO;hb=HEAD[the TODO file].
507 Feel free to <<author,report your wishes to the author>>. Patches highly
508 appreciated.
509
510 [[booting-from-usb]]
511 I've problems with booting from USB.
512 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
513
514 Check out <<troubleshooting,Troubleshooting and Pitfalls when booting>>.
515
516 [[found-a-bug]]
517 I've found a bug!
518 ~~~~~~~~~~~~~~~~~
519
520 Please <<author,report it to the author>>. Please provide usage examples and output
521 of your grml2usb commandline (consider using the "\--verbose" option).
522
523 [[usage-examples]]
524 Usage examples
525 --------------
526
527   # grml2usb /home/grml/grml_2009.05.iso /dev/sdx1
528
529 Install specified ISO on device /dev/sdx1.
530
531   # grml2usb /home/grml/grml_2009.05.iso /home/grml/grml_small_2009.05.iso /dev/sdx1
532
533 Install specified ISOs on device /dev/sdx1 for multibooting ISOs.
534 Note: boot "grml" as usual, for booting grml-small use "grml-small on the
535 bootprompt, for grml64 use "grml64" and so on... The *first* specified ISO is
536 the one being the default (when just pressing enter or waiting until the timeout
537 is reached).
538
539   # grml2usb /live/image /dev/sdx1
540
541 Install currently running grml live system on device /dev/sdx1.
542
543   # grml2usb /live/image /home/grml/grml_2009.05.iso /dev/sdx1
544
545 Install currently running grml live system and the specified
546 ISO on device /dev/sdx1 for multibooting.
547
548   # grml2usb --fat16 /home/grml/grml_2009.05.iso /dev/sdx1
549
550 Install specified ISO on device /dev/sdx1 and format partition /dev/sdx1 with
551 FAT16 filesystem.
552
553   # grml2usb --syslinux /home/grml/grml_2009.05.iso /dev/sdx1
554
555 Install specified ISO on device /dev/sdx1 and use syslinux as bootloader
556 (instead of grub being the default).
557
558 ///////////////////////////////////////////////////////////////////////////////////////
559   # grml2usb --kernel=/boot/vmlinuz-2.6.28-grml --initrd=/boot/initrd.img-2.6.28-grml \
560              /home/grml/grml_2009.05.iso /dev/sdx1
561
562 Install specified ISO on device /dev/sdx1 but use given kernel and initrd
563 instead of the ones provided by the ISO.
564
565   # grml2usb --squashfs=/grml/grml-live/grml_cd/live/grml.squashfs \
566              /home/grml/grml_2009.05.iso /dev/sdx1
567
568 Install specified ISO on device /dev/sdx1 but use given squashfs
569 file instead of the one provided by the ISO.
570 ///////////////////////////////////////////////////////////////////////////////////////
571
572   # grml2usb --bootoptions="lang=de ssh=mysecret" grml_2009.05.iso /dev/sdx1
573
574 Install specified ISO on device /dev/sdx1 and use "lang=de ssh=mysecret" as
575 default bootoptions.
576
577 [[ressources]]
578 Online Ressources
579 -----------------
580
581 Check out the link:http://grml.org/grml2usb/[grml2usb webpage] and the
582 link:http://git.grml.org/?p=grml2usb.git[grml2usb git repository].
583
584 [[bugs]]
585 Bugs
586 ----
587 Please report feedback, bugreports and wishes <<author,to the author>>.
588
589 [[author]]
590 Author
591 ------
592 Michael Prokop <mika@grml.org>
593
594 /////////////////////////////////////////////////////////////////
595 http://wiki.grml.org/doku.php?id=tips#multiboot_usb_pen
596 http://www.startx.ro/sugar/isotostick.sh
597 https://help.ubuntu.com/community/Installation/FromUSBStick
598 http://unetbootin.sourceforge.net/
599 http://www.tux.org/pub/people/kent-robotti/looplinux/rip/mkusb.sh
600 https://fedorahosted.org/liveusb-creator/
601 /////////////////////////////////////////////////////////////////