Return to the main mkusb page


mkusb minimal shellscript - mkusb-min

Separate versions for graphical mode and text mode

Starting with version 9 there are separate versions for

  • GUI mode: mkusb

  • text mode: mkusb-nox, mkusb-bas and now also mkusb-min

mkusb-min is simple, the shellscript is very small compared to the other versions, yet it serves the purpose to wrap a safety belt around 'dd'.

Small and flexible

  • mkusb-min needs no extra packages (but makes the user experience nicer, if you install pv). It runs in text screens, terminal windows, via ssh and other network connections.

  • mkusb-min works in many different linux distros. It needs bash and some standard tools and features (dd, grep, ls, lsblk, sed, sleep, sort, tr, /dev/disk/by-id), that are present in almost all current linux distros (2017).

Only cloning from a source file to a target device

mkusb-min is a cloning tool, that helps you clone from a source file to a target device (typically from a linux iso file or image file to a USB pendrive or memory card). This works with all hybrid iso files, and most linux distros provide hybrid iso files.

  • Unlike the other mkusb versions, mkusb-min does not manage compressed image files. You have to extract the image file from the compressed file before using it.

  • mkusb-min cannot make persistent live drives, you must use another tool, for example the mainstream mkusb for that purpose.

  • mkusb-min cannot make install drives for Windows, you must use another tool, for example the mainstream mkusb for that purpose.

Downloading and installation

The mkusb-min shellscript file is available as a file to be downloaded from this page.

Download

Download the attached file mkusb-min and the corresponding md5sum mkusb-min.md5.asc.

The file is small compared to standard mkusb,

$ wc mkusb-min
 208  736 5435 mkusb-min

It should be rather easy to see what the shellscript is doing simply by reading it in a text editor.

md5sum

The simple check is to run

md5sum mkusb-min

and compare the result with the corresponding line in the file

mkusb-min.md5.asc

You may want a higher level of security. This file is signed with gpg and you can verify it according to the following commands.

gpg --keyserver keyserver.ubuntu.com --recv-keys EB0FC2C8
gpg --verify mkusb-min.md5.asc

The warning "This key is not certified with a trusted signature! There is no indication that the signature belongs to the owner." means that there is no chain of trusted keys between your computer's keyring and the key, that was used to sign the checksums (the key of sudodus). Check that the result matches with the following output, when you verify it,

tester@xenial32 ~ $ gpg --keyserver keyserver.ubuntu.com --recv-keys EB0FC2C8
gpg: directory `/home/tester/.gnupg' created
gpg: new configuration file `/home/tester/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/tester/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/tester/.gnupg/secring.gpg' created
gpg: keyring `/home/tester/.gnupg/pubring.gpg' created
gpg: requesting key EB0FC2C8 from hkp server keyserver.ubuntu.com
gpg: /home/tester/.gnupg/trustdb.gpg: trustdb created
gpg: key EB0FC2C8: public key "Nio Sudden Wiklund (sudodus) <address@mailserver.com>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

tester@xenial32 ~ $ gpg --verify mkusb-min.md5.asc
gpg: Signature made mån 18 dec 2017 18:04:25 CET using RSA key ID EB0FC2C8
gpg: Good signature from "Nio Sudden Wiklund (sudodus) <nio.wiklund@gmail.com>"
gpg: WARNING: not a detached signature; file 'mkusb-min.md5' was NOT verified!
$ 

Then there is reason to trust that nobody else has written the checksums. The date of the signature will change at updates, and the text might be translated to your local language, but it should be clear that it is a 'Good signature from "Nio Sudden Wiklund (sudodus)"'.

If you have the shellscript and the md5sum file in the same directory, you can use the md5sum program to check the tarballs like this,

tester@xenial32 ~ $ md5sum -c mkusb-min.md5.asc
mkusb-min: OK
md5sum: WARNING: 14 lines are improperly formatted

The 'improperly formatted lines' are the lines belonging to the gpg signature.

Run locally or install

You can but need not install mkusb-min. It can be run locally from the current directory.

Make the shellscript executable,

chmod ugo+x mkusb-min

Run locally

Then mkusb-min can be run with superuser permissions (with sudo or as root depending on the linux distro) in the current directory,

$ sudo ./mkusb-min file.iso /dev/sdx

or

# ./mkusb-min file.iso /dev/sdx

Install

If /usr/local/sbin exists in your computer and in PATH, you can copy mkusb-min to that directory,

sudo cp -i mkusb-min /usr/local/sbin

Otherwise you can copy it to /usr/sbin, which should exist, and there should be no other program with the same name (except maybe an old version of the same mkusb-min).

sudo cp -i mkusb-min /usr/sbin

Then mkusb-min can be run with superuser permissions (with sudo or as root depending on the linux distro) in any directory,

$ sudo mkusb-min file.iso /dev/sdx

or

# mkusb-min file.iso /dev/sdx

Using mkusb-min

The following dialogues in a terminal window illustrate how to run mkusb-min, and install live linux operating systems from iso files to a memory card and a pendrive.

Usage text with a list of available target devices

mkusb-min-01.png

Cloning from a bunsenlabs iso file to a memory card

mkusb-min-02.png

'pv' installed to show the progress;

Cloning from a Tiny Core iso file to a USB pendrive

mkusb-min-03.png

mkusb-minp can also make persistent live drives

See this link ../minp

mkusb-bas for old or very small linux distros

mkusb-min uses some commands and features, which are not available in old or very small linux distros, for example Wary Puppy and Tiny Core. A version based on mkusb 7.4 is made for such cases - mkusb-bas.

The basic mode quick start manual describes the text only and non-menu version mkusb-bas


Return to the main mkusb page

mkusb/min (last edited 2021-08-06 13:56:16 by nio-wiklund)