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