Background
My normal process for writing ISOs is downloading them (zsync
via script which performs a ISO validation & shows me the package changes (ie. manifest diff from prior download)), then use mkusb
to write it to thumb-drive, eg.
guiverc@d7050-next:/de2900/lubuntu_64$ sudo mkusb-nox mantic-desktop-amd64.iso all
I then quickly scan messages & if it looks good, eject the thumb-drive, and boot it on a nearby box & confirm media write there using a method documented here, ie.
- boot it in try mode, and wait awhile to let background media validation occur, scanning the systemd journal using
sudo journalctl |grep casper-md5check
watching for
May 11 08:37:47 ubuntu casper-md5check[3924]: Checking ./boot/grub/loopback.cfg...../boot/grub/loopback.cfg: OK
May 11 08:37:47 ubuntu casper-md5check[3924]: Check finished: no errors found.
May 11 08:37:47 ubuntu systemd[1]: Finished casper-md5check.service - casper-md5check Verify Live ISO checksums.
This validation I believe is essential, as I find 5-8% of ISO writes fail regardless of the hardware being used (ie. different boxes & different thumb-drives).
Question
Can I validate the ISO write using an easy tool, using the same box I used to write it (ie. no reboot or nearby box necessary).
My preference is terminal; as it's where I am for these tasks.
Tool to check that cloning was successful
Cloning from an image file, typically an iso file, to a USB drive is considered a robust process, but sometimes it fails. Maybe this is caused by problems with buffering when a big iso file is cloned to a pendrive with slow memory cells, maybe caused by flaky memory cells.
Anyway, I see that we need a convenient way to check that cloning was successful, so I created a small shellscript.
diff-image-drive
makes it easy to check by means of comparing the sha256sums.Demo using the original version of the shellscript:
At first there is some previous content in the target device, an SSD connected via a USB to SATA adapter:
After cloning from the mantic iso file to the target device:
In this case you need not worry about the warning from partprobe. A drive cloned from an iso file does not care about what is behind the cloned field.
Screenshots using version 1.3 of the shellscript:
The color high-lighting is there also in the original version, but checking when skipping head/tail is new. This helps checking when a drive cloned from an Ubuntu iso file has been used (so that a 'writable' partition was created).
Checking directly after cloning.
Checking after the drive was booted into.
You can find more details via this post and the following posts to my thread at the Ubuntu Forums.