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