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
21 it bootable. It provides multiboot ISO support, meaning you can specify
22 several Grml ISOs on the command line at once and select the Grml
23 flavour you would like to boot on the bootprompt then. Note that the
24 *first* ISO specified on the grml2usb command line will become the
25 default one (that's the one that will boot when just pressing enter on
26 the bootprompt or wait until the boot timeout matches).
29 By default a compatible master boot record (MBR) is installed on the device
30 (being for example /dev/sdX when executing 'grml2usb grml.iso /dev/sdX1') and
31 syslinux is being used as default bootloader. Avoid installation of the default
32 MBR using the '--skip-mbr' option or if you encounter any problems with the
33 default MBR consider using '--syslinux-mbr' instead.
39 ISO[s] should be the path to one or multiple grml-ISOs and/or the path to
40 the currently running live-system (being /run/live/medium).
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.
47 The following options are supported:
49 *\--bootoptions=...*::
51 Use specified bootoptions as default. To use flavour name as a argument for a
52 boot parameter use %flavour which will be expanded to the flavour name. To add
53 multiple bootoptions you can specify the option multiple time.
55 *\--bootloader-only*::
57 Do *not* copy files but instead just install a bootloader. Note that the boot
58 addons are copied to /boot/addons at this stage as well. If you want to skip
59 copying the boot addons consider using the --skip-addons option.
63 Copy files only but do *not* install a bootloader.
67 Avoid executing commands, instead show what would be executed.
68 Warning: please notice that the ISO has to be mounted anyway, otherwise
69 identifying the Grml flavour would not be possible.
73 Format specified partition with FAT16.
74 **Important:** this will destroy any existing data on the specified partition!
78 Force any (possible dangerous) actions requiring manual interaction (like --fat16).
82 Install grub bootloader instead of (default) syslinux.
86 Install grub into MBR (Master Boot Record) instead of PBR (Partition Boot
87 Record). Check out <<mbr-vs-pbr,the 'mbr-vs-pbr' section in the FAQ of this
88 document>> for further details.
92 Display usage information and exit.
94 //////////////////////////////////////////////////////////////////////////
97 Install specified initrd instead of the default. You might want to specify
98 option *--kernel* as well. (Be aware when using multiboot setup.)
99 [Notice: not implemented yet.]
100 //////////////////////////////////////////////////////////////////////////
102 //////////////////////////////////////////////////////////////////////////
105 Install specified kernel instead of the default. You might want to specify
106 option *--initrd* as well. (Be aware when using multiboot setup.)
107 [Notice: not implemented yet.]
108 //////////////////////////////////////////////////////////////////////////
112 Install master boot record (MBR) with integrated boot menu: interactively choose
113 the partition to boot from, with a timeout to load the default partition, or
114 boot from floppy. When NOT using the --mbr-menu option a MBR with LBA and large
115 disc support but without an integrated boot menu is installed (so it's not
116 visible at all but instead directly jumps to the bootloader - being grub or
117 syslinux). Note: This options is available only when using the default MBR and
118 won't have any effect if you're using the '--syslinux-mbr' option.
122 Do not output anything but just errors on console.
126 Do not install /boot/addons/ files (like dos, grub, memdisk,...).
128 *\--remove-bootoption=...*::
130 Remove specified bootoption (could be a regex) from existing boot options. Use
131 multiple entries for removing different bootoptions at once.
135 Do not check for presence of boot flag on target device.
137 *\--skip-grub-config*::
139 Skip generation of grub configuration files. By default the configuration
140 files for syslinux *and* grub will be written so you've a working configuration
141 file no matter whether you're using grub or syslinux as bootloader.
145 Do not touch/install the master boot record (MBR).
147 *\--skip-syslinux-config*::
149 Skip generation of syslinux configuration files. By default the configuration
150 files for syslinux *and* grub will be written so you've a working configuration
151 file no matter whether you're using grub or syslinux as bootloader.
153 *\--skip-usb-check*::
155 Skip check to verify whether given device is a removable device.
156 Some USB devices are known to report wrong information, when using
157 such a device you can skip grml2usb's removable device check.
161 This option is deprecated and is being left only for backwards compatibility
162 reasons. Syslinux is the default bootloader of grml2usb and therefore the
163 '--syslinux' option doesn't have any effects. If you do not want to use syslinux
164 as bootloader consider using the '--grub' option.
168 Install syslinux' master boot record (MBR, which is booting from the partition
169 with the "active" flag set) instead of the default one. If you encounter any
170 problems with the default MBR you can try using the syslinux MBR instead. If
171 that works for you please <<author,let us know>> so we can adjust our default
174 //////////////////////////////////////////////////////////////////////////
177 Install specified squashfs file instead of the default.
178 [Notice: not implemented yet.]
179 //////////////////////////////////////////////////////////////////////////
181 //////////////////////////////////////////////////////////////////////////
184 Uninstall Grml ISO files.
185 [Notice: not implemented yet.]
186 //////////////////////////////////////////////////////////////////////////
190 Return version and exit.
200 Directory layout on USB device
201 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205 | |-- allinone.img [grub - all in one image]
206 | |-- bsd4grml/ [MirBSD]
207 | |-- balder10.imz [FreeDOS]
208 | |-- memdisk [chainloading helper]
209 | |-- memtest [memtest86+]
212 | | |-- linux26 [Kernel]
213 | | |-- initrd.gz [initramfs]
215 | | |-- linux26 [Kernel]
216 | | |-- initrd.gz [initramfs]
224 | |-- grml.png [graphical bootsplash background image for grub2]
225 | |-- grub.cfg [configuration file for grub2]
226 | |-- menu.lst [configuration file for grub1]
227 | |-- splash.xpm.gz [splash screen for grub1]
229 |-- grml.png [graphical bootsplash background image for syslinux]
230 |-- syslinux.cfg [main configuration file for syslinux]
231 `-- [....] [several further config files for syslinux]
234 |-- grml2usb.txt [not yet implemented]
235 |-- grml-cheatcodes.txt [list of bootoptions for Grml]
236 |-- grml-version.txt [file containing information about grml-version]
237 |-- LICENSE.txt [license information]
238 |-- md5sums [md5sums of original ISO]
239 |-- README.txt [informational text]
240 `-- web/ [browser related files]
251 | |-- filesystem.module [module specifying which squashfs should be used for grml]
252 | `-- grml.squashfs [squashfs file for grml]
254 | |-- filesystem.module [module specifying which squashfs should be used for grml-small]
255 | `-- grml-small.squashfs [squashfs file for grml-small]
262 % git clone git://git.grml.org/grml2usb.git
265 Developers Debugging Hints
266 ~~~~~~~~~~~~~~~~~~~~~~~~~~
268 To play with grml2usb you can avoid using a real device via a loopback file
271 # dd if=/dev/zero of=~/loopback bs=1M count=100 # adjust size to your needs
272 # losetup /dev/loop1 ~/loopback
274 Then create according partitions either running for example:
276 # echo -en "n\np\n1\n\n\nt\n6\na\n1\n w\n" | fdisk /dev/loop1
280 # parted /dev/loop1 -s "mkpart primary fat16 0 -1s mkfs 1 fat16"
282 Finally create a filesystem and execute grml2usb as needed:
284 # mkfs.vfat /dev/loop1
285 # grml2usb --bootloader-only /grml/isos/grml64-small_2018.12.iso /dev/loop1
287 [[performance-tracing]]
291 # blktrace -d /dev/sdX -o - | blkparse -i -
292 # grml2usb grml64-full_2018.12.iso /dev/sdX1
295 Troubleshooting and Pitfalls when booting
296 -----------------------------------------
298 Here is a list of common error messages from BIOS/bootloader when trying to boot
301 ///////////////////////////////////////////////////////////
302 TODO: better list type for the error message / reason part?
303 See http://www.methods.co.nz/asciidoc/userguide.html
304 ///////////////////////////////////////////////////////////
307 *Error message*:: ran out of input data. System halted
309 *Reason*:: Everything OK, except for the filesystem used on your USB device. So
310 instead of fat16 you are using for example fat32. Fix: use the appropriate
311 filesystem (fat16 for USB flash drive usually). The Bootsplash might be displayed, the
312 kernel loads but you very soon get the error message.
314 *Error message*:: Invalid operating system
316 *Reason*:: the partition layout is not ok. Very probably there's no primary
317 partition (/dev/sdX{1..4}) or none has the flag 'bootable' set.
319 *Error message*:: Boot error.
321 *Reason*:: Some BIOSses offer different modes for USB booting. The proper mode
322 to boot a USB stick is USB-HDD. If that doesn’t work or is not supported by your
323 system, you need to format your USB-Stick as USB-ZIP. To do this, syslinux
324 contains an utility called mkdiskimage, which you can use to re-format your USB
325 stick in USB-ZIP format running 'mkdiskimage -4 /dev/sdX 1 64 32'. Please be
326 aware that this procedure will erase all data on your stick. After executing
327 mkdiskimage just continue installing as usual (grml2usb ... /dev/sdX4). Note
328 that this is not going to work for any device larger than 8 GB, since
329 mkdiskimage only supports 1024c 256h 63s. For a more detailed explanation, refer
330 to /usr/share/doc/syslinux-common/usbkey.txt.
332 *Error message*:: No operating system found.
334 *Reason*:: you forgot to set the boot-flag on the partition. Or there really isn't
335 any operating system at all. :)
337 *Error message*:: kernel-panic: unable to mount root-fs...
339 *Reason*:: Kernel boots but fails to find the root filesystem. The root=
340 argument in your kernel commandline is pointing to the wrong device. Adjust
341 root=..., consider using root=UUID=....
343 *Error message*:: Could not find kernel image: ...
345 *Reason*:: either a broken isolinux/syslinux version or a broken BIOS. Check out
346 whether the vendor provides a BIOS update or if using bootloader grub instead of
347 isolinux/syslinux fixes the problem.
350 Frequently Asked Questions (FAQ)
351 --------------------------------
354 Where can I get grml2usb?
355 ~~~~~~~~~~~~~~~~~~~~~~~~~
357 grml2usb is available as Debian package via link:http://deb.grml.org/[the
358 grml-testing Debian repository].
360 If you do not want to (or can't) use the grml2usb Debian package you can either
361 use the grml2usb git tree running:
363 git clone git://git.grml.org/grml2usb.git
368 or download the provided
369 link:http://grml.org/grml2usb/grml2usb.tgz[http://grml.org/grml2usb/grml2usb.tgz]
370 (link:http://grml.org/grml2usb/grml2usb.tgz.md5.asc[gpg signed md5 hash]).
371 Download and extract the tarball and execute the provided script 'install.sh'.
374 It is *NOT* enough to have just the grml2usb script itself without the according
375 files provided either via the Debian package, the git tree or the file
379 Why can't I just dd the ISO to a USB device?
380 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
382 Well, you can. :) Starting with Grml 2009.10 the ISOs are dd-able straight out-of-the-box.
385 Note that ANY existing data on your USB device will be destroyed when
386 using the dd approach.
388 ///////////////////////////////////////////////////////////////////////////////////////////////////
389 Grab a recent Grml ISO and use
390 link:http://syslinux.zytor.com/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE[isohybrid
391 from the syslinux project]:
393 % isohybrid grml64-small_2018.12.iso
394 ///////////////////////////////////////////////////////////////////////////////////////////////////
396 This allows you to dd the Grml ISO to your USB device (use for example
397 link:http://www.chrysocome.net/rawwrite[rawwrite] if you've just a Windows
398 system available) running:
400 % dd if=grml64-full_2018.12.iso of=/dev/sdX
402 where /dev/sdX is your USB device. Of course this doesn't provide such a
403 flexible system like with grml2usb (no multi-ISO setup, no additional default
404 bootoptions,...) but it's a nice way to get a working USB boot setup if you
405 don't have grml2usb available.
408 What's the difference between grml2usb and just using dd?
409 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
411 grml2usb does not remove any data from your USB device and does not alter the
412 partition table at all. grml2usb provides multi-ISO support, support for adding
413 default bootoptions and selecting the bootloader (syslinux vs. grub) without
414 having to manually touch the ISO at all.
420 grml2iso is a script which uses grml2usb to generate a multiboot ISO out of
421 several Grml ISOs. See 'man grml2iso' for further details.
424 Why is there a menu.lst and a grub.cfg inside /boot/grub/?
425 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
427 grml2usb supports grub version 1 (grub1) as well as grub version 2 (grub2).
428 Whereas grub1 uses menu.lst the new version grub2 needs grub.cfg.
429 Providing both files allows grml2usb to install grub on the target device
430 no matter which grub version is available on the host where grml2usb is
434 grub-install fails with 'The file ../boot/grub/stage1 not read correctly"?!
435 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
437 Check whether the partition has the right partition type. For example do NOT use
438 FAT16 (partition type 6) when using a ext3 filesystem on the partition but
439 instead use the correct partition type ('83' - Linux) then.
441 [[grub-install-xfs_freeze]]
442 grub-install complains about /sbin/grub-install and/or xfs_freeze?!
443 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
445 The following message:
447 You shouldn't call /sbin/grub-install. Please call /usr/sbin/grub-install instead!
448 xfs_freeze: specified file ["/tmp/tmpqaBK6z/boot/grub"] is not on an XFS filesystem
450 This is "normal". grub-install sends those messages to stderr. To avoid hiding any
451 possible real error messages grml2usb doesn't ignore those messages.
454 grub-install complains about /boot/grub/device.map?!
455 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
457 The following message:
459 grub-probe: error: Cannot open `/boot/grub/device.map'
461 This is "normal" (at least with grub1). This isn't a problem, because the
462 device.map file will be generated on the target device anyway.
465 grub-install complains about a unary operator?!
466 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
468 The following message:
470 '/usr/sbin/grub-install: line 374: [: =: unary operator expected'
472 This is "normal". Just ignore it. (It usually doesn't appear
473 on the second invocation on the same device.)
475 [[unknown-filesystem]]
476 grub-install fails with grub-probe: error: unknown filesystem?!
477 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
479 The following message:
481 grub-probe: error: unknown filesystem
482 Auto-detection of a filesystem module failed.
483 Please specify the module with the option `--modules' explicitly.
485 usually means that the device partition table says something else than the
486 filesystem on the device. For example using FAT16 as filesystem type and
487 using FAT32 as filesystem on the partition will not work. Either set filesystem
488 type to FAT32 or format the partition using FAT16. It is essential that
489 device partition table and filesystem use the same filesystem type.
492 grub-setup fails after Attempting to install GRUB to a partition instead of the MBR?!
493 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
495 The following message:
497 grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea.
498 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.
499 grub-setup: error: Cannot read `/grub/core.img' correctly
501 appears when using grub2 versions older than 1.98 as those version introduced a
502 regression which avoids that grub is being installed into a partition (PBR,
503 Partition Boot Record) instead of MBR (Master Boot Record).
505 To work around this issue you can either 1) upgrade to grub versions >=1.98, 2)
506 install grub into the MBR (Master Boot Record) using the '--grub-mbr' option of
507 grml2usb or 3) switch to syslinux as bootmanager (just drop the '--grub'
511 I'm getting something like "Error: /usr/share/grml2usb/grub/splash.xpm.gz can not be read"!?
512 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
514 Looks like you've only the grml2usb script itself available. Please make sure
515 you've the grml2usb Debian package installed. The most resent stable version is
516 available via link:http://deb.grml.org/[the grml-testing Debian repository]. If
517 you do not have a Debian system please see section <<download,Where can I get
518 grml2usb?>> in this FAQ.
521 Why do I have to use a FAT16/FAT32 filesystem?
522 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
524 Syslinux (currently) does not support any other filesystems besides FAT16/FAT32
525 (though that's a sane default if you want to share your files with other
526 (operating) systems). If you want to use a different filesystem (like ext2/3)
527 use the bootloader grub instead using grml2usb's '--grub' option.
530 FAT32 is supported since syslinux version 3.0.
533 Addons -> Hardware Detection Tool freezes
534 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
536 This usually means that the machine you ran grml2usb on had syslinux 3.x
537 installed. The version of hdt (Hardware detection tool) shipping with Grml
538 2010.12 and newer requires syslinux 4.x.
541 I think I've got a really cool idea!
542 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
544 Great! Please check out
545 link:http://git.grml.org/?p=grml2usb.git;a=blob;f=TODO;hb=HEAD[the TODO file].
546 Feel free to <<author,report your wishes to the author>>. Patches highly
550 I've problems with booting from USB.
551 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
553 Check out <<troubleshooting,Troubleshooting and Pitfalls when booting>>.
559 Please <<author,report it to the author>>. Please provide usage examples and output
560 of your grml2usb commandline (consider using the "\--verbose" option).
566 # grml2usb /home/grml/grml64-full_2018.12.iso /dev/sdX1
568 Install specified ISO on device /dev/sdX1.
570 # grml2usb /home/grml/grml64-full_2018.12.iso /home/grml/grml32-full_2018.12.iso /dev/sdX1
572 Install specified ISOs on device /dev/sdX1 for multibooting ISOs.
574 # grml2usb /run/live/medium /dev/sdX1
576 Install currently running Grml live system on device /dev/sdX1.
578 # grml2usb /run/live/medium /home/grml/grml64-full_2018.12.iso /dev/sdX1
580 Install currently running Grml live system and the specified
581 ISO on device /dev/sdX1 for multibooting.
583 # grml2usb --fat16 /home/grml/grml64-full_2018.12.iso /dev/sdX1
585 Install specified ISO on device /dev/sdX1 and format partition /dev/sdX1 with
588 # grml2usb --grub --grub-mbr /home/grml/grml64-full_2018.12.iso /dev/sdX1
590 Install specified ISO on device /dev/sdX1 and use grub as bootloader (instead of
591 syslinux being the default) and install a master boot record (MBR) to the MBR of
594 ///////////////////////////////////////////////////////////////////////////////////////
595 # grml2usb --kernel=/boot/vmlinuz-2.6.28-grml --initrd=/boot/initrd.img-2.6.28-grml \
596 /home/grml/grml64-full_2018.12.iso /dev/sdX1
598 Install specified ISO on device /dev/sdX1 but use given kernel and initrd
599 instead of the ones provided by the ISO.
601 # grml2usb --squashfs=/grml/grml-live/grml_cd/live/grml.squashfs \
602 /home/grml/grml64-full_2018.12.iso /dev/sdX1
604 Install specified ISO on device /dev/sdX1 but use given squashfs
605 file instead of the one provided by the ISO.
606 ///////////////////////////////////////////////////////////////////////////////////////
608 # grml2usb --bootoptions="lang=de ssh=mysecret" grml64-full_2018.12.iso /dev/sdX1
609 # grml2usb --bootoptions="lang=de" --bootoptions="ssh=mysecret" grml64-full_2018.12.iso /dev/sdX1
611 Install specified ISO on device /dev/sdX1 and use "lang=de ssh=mysecret" as
615 # grml2usb --remove-bootoption="vga=791" --remove-bootoption="nomce" grml64-full_2018.12.iso /dev/sdX1
617 Install specified ISO on device /dev/sdX1 remove vga=791 and nomce from existing bootoptions.
619 # grml2usb --bootoptions="persistent-path=%flavour_name" grml64-small_2018.12.iso grml32-small_2018.12.iso /dev/sdX1
621 Install specified ISOs on device /dev/sdx and add parameter persistent-path
622 to every menu entry. %flavour_name will be expanded to the flavour of the specific
623 iso, e.g. grml64 and grml.
629 Check out the link:http://grml.org/grml2usb/[grml2usb webpage] and the
630 link:http://git.grml.org/?p=grml2usb.git[grml2usb git repository].
635 Please report feedback, bugreports and wishes <<author,to the author>>.
640 Michael Prokop <mika@grml.org>
642 /////////////////////////////////////////////////////////////////
643 http://wiki.grml.org/doku.php?id=tips#multiboot_usb_pen
644 http://www.startx.ro/sugar/isotostick.sh
645 https://help.ubuntu.com/community/Installation/FromUSBStick
646 http://unetbootin.sourceforge.net/
647 http://www.tux.org/pub/people/kent-robotti/looplinux/rip/mkusb.sh
648 https://fedorahosted.org/liveusb-creator/
649 /////////////////////////////////////////////////////////////////