6 grml2usb - install grml ISO(s) on usb device for booting
10 grml2usb [ options ] <ISO[s]> <device>
12 *******************************************************************************
13 Important! The grml team does not take responsibility for loss of any data!
14 *******************************************************************************
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).
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') and
30 grub is being used as default bootloader. Avoid installation of the default MBR
31 using the '--skip-mbr' option or if you encounter any problems with the default
32 MBR consider using '--syslinux-mbr' instead. If bootloader grub doesn't work for
33 you check out <<faq,the FAQ section of this document>> or consider using the
40 The ISO[s] should be the path to one or multiple grml-ISOs and/or the path to
41 the currently running live-system (being /live/image).
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.
48 The following options are supported:
50 *\--bootoptions=...*::
52 Use specified bootoptions as default.
54 *\--bootloader-only*::
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.
62 Copy files only but do *not* install a bootloader.
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.
72 Format specified partition with FAT16.
73 **Important:** this will destroy any existing data on the specified partition!
77 Force any (possible dangerous) actions requiring manual interaction (like --fat16).
81 Install grub into MBR (Master Boot Record) instead of PBR (Partition Boot
82 Record). This option sadly had to be introduced because grub2 can not be
83 installed to partitions (PBR) instead of MBR anymore. Check out <<mbr-vs-pbr,the
84 'mbr-vs-pbr' section in the FAQ of this document>> for further details.
88 Display usage information and exit.
90 //////////////////////////////////////////////////////////////////////////
93 Install specified initrd instead of the default. You might want to specify
94 option *--kernel* as well. (Be aware when using multiboot setup.)
95 [Notice: not implemented yet.]
96 //////////////////////////////////////////////////////////////////////////
98 //////////////////////////////////////////////////////////////////////////
101 Install specified kernel instead of the default. You might want to specify
102 option *--initrd* as well. (Be aware when using multiboot setup.)
103 [Notice: not implemented yet.]
104 //////////////////////////////////////////////////////////////////////////
106 *\--lilo-binary=...*::
108 Use specified lilo executable for installing master boot record (MBR) when using
109 the --syslinux-mbr option. By default any system wide (from $PATH) lilo
110 executable is taken. If there can not be find any lilo executable the
111 statically compiled version of the grml2usb Debian package (see
112 /usr/share/grml2usb/lilo/lilo.static.[amd64|i386]) is taken.
116 Install master boot record (MBR) with integrated boot menu: interactively choose
117 the partition to boot from, with a timeout to load the default partition, or
118 boot from floppy. When NOT using the --mbr-menu option a MBR with LBA and large
119 disc support but without an integrated boot menu is installed (so it's not
120 visible at all but instead directly jumps to the bootloader - being grub or
121 syslinux). Note: This options is available only when using the default MBR and
122 won't have any effect if you're using the --syslinux-mbr option.
126 Do not output anything but just errors on console.
130 Do not install /boot/addons/ files (like dos, grub, memdisk,...).
132 *\--skip-grub-config*::
134 Skip generation of grub configuration files. By default the configuration
135 files for syslinux *and* grub will be written so you've a working configuration
136 file no matter whether you're using grub or syslinux as bootloader.
140 Do not touch/install the master boot record (MBR).
142 *\--skip-syslinux-config*::
144 Skip generation of syslinux configuration files. By default the configuration
145 files for syslinux *and* grub will be written so you've a working configuration
146 file no matter whether you're using grub or syslinux as bootloader.
150 Install syslinux bootloader instead of the default one (being grub).
154 Install syslinux' master boot record (MBR, which is booting from the partition
155 with the "active" flag set) instead of the default one. If you encounter any
156 problems with the default MBR you can try using the syslinux MBR instead. If
157 that works for you please <<author,let us know>> so we can adjust our default
158 MBR accordingly. Note: When using the --syslinux-mbr option lilo is executed
159 before the MBR is installed so the according partitions are set active.
161 //////////////////////////////////////////////////////////////////////////
164 Install specified squashfs file instead of the default.
165 [Notice: not implemented yet.]
166 //////////////////////////////////////////////////////////////////////////
168 //////////////////////////////////////////////////////////////////////////
171 Uninstall grml ISO files.
172 [Notice: not implemented yet.]
173 //////////////////////////////////////////////////////////////////////////
177 Return version and exit.
187 Directory layout on usb device
188 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192 | |-- allinone.img [grub - all in one image]
193 | |-- bsd4grml/ [MirBSD]
194 | |-- balder10.imz [FreeDOS]
195 | |-- memdisk [chainloading helper]
196 | |-- memtest [memtest86+]
199 | | |-- linux26 [Kernel]
200 | | |-- initrd.gz [initramfs]
202 | | |-- linux26 [Kernel]
203 | | |-- initrd.gz [initramfs]
205 | | |-- linux26 [...]
217 | |-- grml.png [splash screen for grub2]
218 | |-- grub.cfg [configuration file for grub2]
219 | |-- menu.lst [configuration file for grub1]
220 | |-- splash.xpm.gz [splash screen for grub1]
222 |-- boot.msg [boot splash for syslinux]
223 |-- f1 [screen when pressing f1]
224 |-- f2 [screen when pressing f2]
233 |-- logo.16 [graphical part of boot splash]
234 `-- syslinux.cfg [configuration file for syslinux]
237 |-- grml2usb.txt [not yet implemented]
238 |-- grml-cheatcodes.txt [list of bootoptions for grml]
239 |-- grml-version.txt [file containing information about grml-version]
240 |-- LICENSE.txt [license information]
241 |-- md5sums [md5sums of original ISO]
242 |-- README.txt [informational text]
243 `-- web/ [browser related files]
254 | |-- filesystem.module [module specifying which squashfs should be used for grml]
255 | `-- grml.squashfs [squashfs file for grml]
257 | |-- filesystem.module [module specifying which squashfs should be used for grml-medium]
258 | `-- grml-medium.squashfs [squashfs file for grml-medium]
260 | |-- filesystem.module [module specifying which squashfs should be used for grml-medium]
261 | `-- grml-small.squashfs [squashfs file for grml-small]
268 % git clone git://git.grml.org/grml2usb.git
271 Developers Debugging Hints
272 ~~~~~~~~~~~~~~~~~~~~~~~~~~
274 To play with grml2usb you can avoid using a real device via a loopback file
277 # dd if=/dev/zero of=~/loopback bs=1M count=100 # adjust size to your needs
278 # losetup /dev/loop1 ~/loopback
280 Then create according partitions either running for example:
282 # echo -en "n\np\n1\n\n\nt\n6\na\n1\n w\n" | fdisk /dev/loop1
286 # parted /dev/loop1 -s "mkpart primary fat16 0 -1s mkfs 1 fat16"
288 Finally create a filesystem and execute grml2usb as needed:
290 # mkfs.vfat /dev/loop1
291 # grml2usb --bootloader-only /grml/isos/grml-small_2009.05.iso /dev/loop1
293 [[performance-tracing]]
297 # blktrace -d /dev/sdX -o - | blkparse -i -
298 # grml2usb grml_2009.05.iso /dev/sdX1
301 Troubleshooting and Pitfalls when booting
302 -----------------------------------------
304 Here is a list of common error messages from BIOS/bootloader when trying to boot
307 ///////////////////////////////////////////////////////////
308 TODO: better list type for the error message / reason part?
309 See http://www.methods.co.nz/asciidoc/userguide.html
310 ///////////////////////////////////////////////////////////
313 *Error message*:: ran out of input data. System halted
315 *Reason*:: Everything OK, except for the filesystem used on your usb device. So
316 instead of fat16 you are using for example fat32. Fix: use the appropriate
317 filesystem (fat16 for usb pens usually). The Bootsplash might be displayed, the
318 kernel loads but you very soon get the error message.
320 *Error message*:: Invalid operating system
322 *Reason*:: the partition layout is not ok. Very probably there's no primary
323 partition (/dev/sdX{1..4}) or none has the flag 'bootable' set.
325 *Error message*:: No operating system found.
327 *Reason*:: you forgot to set the boot-flag on the partition. Or there really isn't
328 any operating system at all. :)
330 *Error message*:: kernel-panic: unable to mount root-fs...
332 *Reason*:: Kernel boots but fails to find the root filesystem. The root=
333 argument in your kernel commandline is pointing to the wrong device. Adjust
334 root=..., consider using root=UUID=....
336 *Error message*:: Could not find kernel image: ...
338 *Reason*:: either a broken isolinux/syslinux version or a broken BIOS. Check out
339 whether the vendor provides a BIOS update or if using bootloader grub instead of
340 isolinux/syslinux fixes the problem.
343 Frequently Asked Questions (FAQ)
344 --------------------------------
347 Where can I get grml2usb?
348 ~~~~~~~~~~~~~~~~~~~~~~~~~
350 grml2usb is available as Debian package via link:http://deb.grml.org/[the
351 grml-testing Debian repository].
353 If you do not want to (or can't) use the grml2usb Debian package you can either
354 use the grml2usb git tree running:
356 git clone git://git.grml.org/grml2usb.git
361 or download the provided
362 link:http://grml.org/grml2usb/grml2usb.tgz[http://grml.org/grml2usb/grml2usb.tgz]
363 (link:http://grml.org/grml2usb/grml2usb.tgz.md5.asc[gpg signed md5 hash]).
364 Download and extract the tarball and execute the provided script 'install.sh'.
367 It is *NOT* enough to have just the grml2usb script itself without the according
368 files provided either via the Debian package, the git tree or the file
371 [[grml2hd-vs-grml2usb]]
372 What's the difference between grml2hd and grml2usb?
373 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
375 grml2hd installs a running grml system to a harddisk. When rebooting the
376 harddisk installation can be modified and changes will find their way to the
377 harddisk immediately. grml2usb copies just the compressed chroot filesystem
378 (being the squashfs file), some further informational files and a bootloader to
379 your device. This way you don't need as much space as with a harddisk
380 installation (just a USB device with >=ISO size) and when rebooting the system
381 your changes will be lost (unless you are using the persistency feature, see
382 link:http://wiki.grml.org/doku.php?id=persistency[http://wiki.grml.org/doku.php?id=persistency]).
383 Think of using a better CD version: booting is (usually) faster, you don't need
384 to burn a new CD when a new ISO version arrives (just install the new ISO using
385 grml2usb) and you can carry additional files on a writable medium with yourself.
388 Why can't I just dd the ISO to a USB device?
389 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
394 Note that ANY existing data on your USB device will be destroyed when
395 using the dd approach.
397 Grab a recent grml ISO and use
398 link:http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE[isohybrid
399 from the syslinux project]:
401 % isohybrid grml_2009.05.iso
403 This allows you to dd the grml ISO to your USB device (use for example
404 link:http://www.chrysocome.net/rawwrite[rawwrite] if you've just a Windows
405 system available) running:
407 % dd if=grml_2009.05.iso of=/dev/sdX
409 where /dev/sdX is your USB device.
412 Upcoming stable versions of grml will provide dd-able ISOs straight
413 out-of-the-box (and current link:http://daily.grml.org/[daily snapshots] already
414 do) using a so called manifold boot method.
417 What's the difference between grml2usb and just using dd?
418 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
420 grml2usb does not remove any data from your USB device and does not alter the
421 partition table at all. grml2usb provides multi-ISO support, support for adding
422 default bootoptions and selecting the bootloader (grub vs. syslinux) without
423 having to manually touch the ISO at all.
429 grml2iso is a script which uses grml2usb to generate a multiboot ISO out of
430 several grml ISOs. See 'man grml2iso' for further details.
433 Why is there a menu.lst and a grub.cfg inside /boot/grub/?
434 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
436 grml2usb supports grub version 1 (grub1) as well as grub version 2 (grub2).
437 Whereas grub1 uses menu.lst the new version grub2 needs grub.cfg.
438 Providing both files allows grml2usb to install grub on the target device
439 no matter which grub version is available on the host where grml2usb is
443 grub-install fails with 'The file ../boot/grub/stage1 not read correctly"?!
444 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
446 Check whether the partition has the right partition type. For example do NOT use
447 FAT16 (partition type 6) when using a ext3 filesystem on the partition but
448 instead use the correct partition type ('83' - Linux) then.
450 [[grub-install-xfs_freeze]]
451 grub-install complains about /sbin/grub-install and/or xfs_freeze?!
452 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
454 The following message:
456 You shouldn't call /sbin/grub-install. Please call /usr/sbin/grub-install instead!
457 xfs_freeze: specified file ["/tmp/tmpqaBK6z/boot/grub"] is not on an XFS filesystem
459 This is "normal". grub-install sends those messages to stderr. To avoid hiding any
460 possible real error messages grml2usb doesn't ignore those messages.
463 grub-install complains about /boot/grub/device.map?!
464 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
466 The following message:
468 grub-probe: error: Cannot open `/boot/grub/device.map'
470 This is "normal" (at least with grub1). This isn't a problem, because the
471 device.map file will be generated on the target device anyway.
474 grub-install complains about a unary operator?!
475 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
477 The following message:
479 '/usr/sbin/grub-install: line 374: [: =: unary operator expected'
481 This is "normal". Just ignore it. (It usually doesn't appear
482 on the second invocation on the same device.)
484 [[unknown-filesystem]]
485 grub-install fails with grub-probe: error: unknown filesystem?!
486 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
488 The following message:
490 grub-probe: error: unknown filesystem
491 Auto-detection of a filesystem module failed.
492 Please specify the module with the option `--modules' explicitly.
494 usually means that the device partition table says something else than the
495 filesystem on the device. For example using FAT16 as filesystem type and
496 using FAT32 as filesystem on the partition will not work. Either set filesystem
497 type to FAT32 or format the partition using FAT16. It is essential that
498 device partition table and filesystem use the same filesystem type.
501 grub-setup fails after Attempting to install GRUB to a partition instead of the MBR?!
502 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
504 The following message:
506 grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea.
507 grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged.
508 grub-setup: error: Cannot read `/grub/core.img' correctly
510 appears because recent grub2 versions sadly introduced a regression which avoids
511 that grub is being installed into a partition (PBR, Partition Boot Record)
512 instead of MBR (Master Boot Record).
514 To work around this issue you can install grub into the MBR (Master Boot Record)
515 using the '--grub-mbr' option of grml2usb or switch to syslinux as bootmanager
516 (using the '--syslinux' option).
518 To fix this issue manually you can also execute (adjust '/dev/sdX' to your
521 mount /dev/sdX1 /mnt/test
522 grub-install --force --recheck --no-floppy --root-directory=/mnt/test /dev/sdX
527 I'm getting something like "Error: /usr/share/grml2usb/grub/splash.xpm.gz can not be read"!?
528 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
530 Looks like you've only the grml2usb script itself available. Please make sure
531 you've the grml2usb Debian package installed. The most resent stable version is
532 available via link:http://deb.grml.org/[the grml-testing Debian repository]. If
533 you do not have a Debian system please see section <<download,Where can I get
534 grml2usb?>> in this FAQ.
537 Why do I have to use a FAT16/FAT32 filesystem?
538 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
540 You have to use a FAT16/FAT32 filesystem only if you consider using syslinux.
541 Syslinux (currently) does not support any other filesystems. If you want to use
542 another filesystem (like ext2/3) just don't use syslinux (drop the \--syslinux
543 option) but use the default bootloader (grub) instead. Note that FAT32 is
544 supported since syslinux version 3.0.
547 I think I've got a really cool idea!
548 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
550 Great! Please check out
551 link:http://git.grml.org/?p=grml2usb.git;a=blob;f=TODO;hb=HEAD[the TODO file].
552 Feel free to <<author,report your wishes to the author>>. Patches highly
556 I've problems with booting from USB.
557 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
559 Check out <<troubleshooting,Troubleshooting and Pitfalls when booting>>.
565 Please <<author,report it to the author>>. Please provide usage examples and output
566 of your grml2usb commandline (consider using the "\--verbose" option).
572 # grml2usb /home/grml/grml_2009.05.iso /dev/sdX1
574 Install specified ISO on device /dev/sdX1.
576 # grml2usb /home/grml/grml_2009.05.iso /home/grml/grml_small_2009.05.iso /dev/sdX1
578 Install specified ISOs on device /dev/sdX1 for multibooting ISOs.
579 Note: boot "grml" as usual, for booting grml-small use "grml-small on the
580 bootprompt, for grml64 use "grml64" and so on... The *first* specified ISO is
581 the one being the default (when just pressing enter or waiting until the timeout
584 # grml2usb /live/image /dev/sdX1
586 Install currently running grml live system on device /dev/sdX1.
588 # grml2usb /live/image /home/grml/grml_2009.05.iso /dev/sdX1
590 Install currently running grml live system and the specified
591 ISO on device /dev/sdX1 for multibooting.
593 # grml2usb --fat16 /home/grml/grml_2009.05.iso /dev/sdX1
595 Install specified ISO on device /dev/sdX1 and format partition /dev/sdX1 with
598 # grml2usb --syslinux /home/grml/grml_2009.05.iso /dev/sdX1
600 Install specified ISO on device /dev/sdX1 and use syslinux as bootloader
601 (instead of grub being the default).
603 ///////////////////////////////////////////////////////////////////////////////////////
604 # grml2usb --kernel=/boot/vmlinuz-2.6.28-grml --initrd=/boot/initrd.img-2.6.28-grml \
605 /home/grml/grml_2009.05.iso /dev/sdX1
607 Install specified ISO on device /dev/sdX1 but use given kernel and initrd
608 instead of the ones provided by the ISO.
610 # grml2usb --squashfs=/grml/grml-live/grml_cd/live/grml.squashfs \
611 /home/grml/grml_2009.05.iso /dev/sdX1
613 Install specified ISO on device /dev/sdX1 but use given squashfs
614 file instead of the one provided by the ISO.
615 ///////////////////////////////////////////////////////////////////////////////////////
617 # grml2usb --bootoptions="lang=de ssh=mysecret" grml_2009.05.iso /dev/sdX1
619 Install specified ISO on device /dev/sdX1 and use "lang=de ssh=mysecret" as
626 Check out the link:http://grml.org/grml2usb/[grml2usb webpage] and the
627 link:http://git.grml.org/?p=grml2usb.git[grml2usb git repository].
632 Please report feedback, bugreports and wishes <<author,to the author>>.
637 Michael Prokop <mika@grml.org>
639 /////////////////////////////////////////////////////////////////
640 http://wiki.grml.org/doku.php?id=tips#multiboot_usb_pen
641 http://www.startx.ro/sugar/isotostick.sh
642 https://help.ubuntu.com/community/Installation/FromUSBStick
643 http://unetbootin.sourceforge.net/
644 http://www.tux.org/pub/people/kent-robotti/looplinux/rip/mkusb.sh
645 https://fedorahosted.org/liveusb-creator/
646 /////////////////////////////////////////////////////////////////