Repairing a e2boot USB key

I broke an easy2boot multi-ISO key by closing the laptop while it was copying an ISO in the background (I didn’t notice that it wasn’t finished).

lsblk brings


sdb           8:16   1 115,3G  0 disk 
├─sdb1        8:17   1 115,3G  0 part 
└─sdb2        8:18   1  31,5K  0 part 

sudo fsck /dev/sdb brings

fsck de util-linux 2.33.1
e2fsck 1.43.8 (1-Jan-2018)
ext2fs_open2: Numéro magique invalide dans le super-bloc
fsck.ext2 : Superbloc invalide, tentons d'utiliser les blocs de sauvetage...
fsck.ext2: Numéro magique invalide dans le super-bloc lors de la tentative d'ouverture de /dev/sdb

Le superbloc n'a pu être lu ou ne contient pas un système de fichiers
ext2/ext3/ext4 correct. Si le périphérique est valide et qu'il contient réellement
un système de fichiers ext2/ext3/ext4 (et non pas de type swap, ufs ou autre),
alors le superbloc est corrompu, et vous pourriez tenter d'exécuter
e2fsck avec un autre superbloc :
    e2fsck -b 8193 <périphérique>
 ou
    e2fsck -b 32768 <périphérique>

Trouvé une table de partitions dos dans /dev/sdb

sudo fsck /dev/sdb1
brings


fsck de util-linux 2.33.1

sudo fsck /dev/sdb2 brings


fsck de util-linux 2.33.1
fsck.fat 4.1 (2017-01-24)
0x25: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
? 1
Perform changes ? (y/n) y
/dev/sdb2: 3 files, 2/23 clusters

and if done again


fsck de util-linux 2.33.1
fsck.fat 4.1 (2017-01-24)
/dev/sdb2: 3 files, 2/23 clusters

On the net I only find info about using fsck or gparted.

And gparted finds that sdb2 is not the right size but refuses to repair it, saying that it can’t detect the file system. It shows sdb1 with 115,30 Go and of type ntfs with flags “boot” and “type”, sdb2 with 31,5 Ko (21 used and 10,5 unused) and of type fat16 with flag “type”, and an unallocated space of 8,53 Mo.

Is there some tutorial or explanation somewhere that I can use to further test the key (and repair it even)? So far I don’t really understand what is happening.

It’s not clear what you did.

If you were copying an iso file to the full usb drive (to “/dev/sdb”), then just copy it again.

Otherwise, try writing a bunch of zeros over the start of the drive – something like:

dd if=/dev/zero of=/dev/sdb count=1024

But check carefully whether “/dev/sdb” is the correct device name before you do that.

If you want to keep the current “/dev/sdb1”, you could instead try using “fdisk” to delete the partitionn “/dev/sdb2”.

Easy2Boot is a software for multisystem USB keys: http://www.easy2boot.com/
Its main advantage is that once the USB key is created, one has only to copy any new ISO into the right folder to make the USB key able to boot on that ISO.

I copied an ISO into the _LINUX folder and did not realize that the copy was not finished when I closed the laptop’s lid and removed the USB key.

Now the key sends an error message when Thunar tries to mount it if I plug it on my computer, and when I try to boot on it it either stalls (the screen shows a blinking “-” indefinitely) or boots to the menu but then when I try to enter the Linux sub-menu I get this error:

()/_ISO/LINUX
cat --length=0 %DIR%/kali-linux-mate-2019.1a-amd64.iso > (md)0x220+1
Error 15: (http://grub4dos.chenali.net/e/15)
File not found
Press any key to continue...

The partitioning was created by the easy2boot executable, now I’d like to repair the key if it’s possible.
Since the kali ISO is probably the one I was copying when I made the mistake, I tried to delete it.

rm /run/media/lienrag/E2B/_ISO/LINUX/kali-linux-mate-2019.1a-amd64.iso
rm: impossible de supprimer '/run/media/lienrag/E2B/_ISO/LINUX/kali-linux-mate-2019.1a-amd64.iso': Erreur d'entrée/sortie

(erreur d’entrée/sortie means I/O error)

Globally ls’ output is this:

:~> ls /run/media/lienrag/
E2B/  PTN2/ 

:~> ls /run/media/lienrag/PTN2/
System Volume Information
:~> ls /run/media/lienrag/PTN2/System\ Volume\ Information/
IndexerVolumeGuid



:~> ls /run/media/lienrag/E2B/
ls: impossible d'accéder à '/run/media/lienrag/E2B/syncguid.dat': Erreur d'entrée/sortie
ls: impossible d'accéder à '/run/media/lienrag/E2B/System Volume Information': Erreur d'entrée/sortie
autorun.inf       grldr                                   MAKE_THIS_DRIVE_CONTIGUOUS.cmd     syncguid.dat                Win10PESE.ini
autounattend.xml  _ISO                                   menu.lst                            System Volume Information  Win7PESE.ini
e2b.ico           MAKE_E2B_USB_DRIVE (run as admin).cmd  QEMU_MENU_TEST  (run as admin).cmd  unattend.xml               Win8PESE.ini

:~> ls /run/media/lienrag/E2B/_ISO/
ANTIVIRUS  docs  E2B_Editor.exe  MyE2B.cfg        ReadMe_where_to_put_files.txt  SUB_MENU_Maker.cmd  UTILITIES          WINDOWS
AUTO       DOS   LINUX           PimpMyDrive.cmd  Sample_MyBackground.jpg        SWITCH_E2B.exe      UTILITIES_MEMTEST  WINPE
BACKUP     e2b   MAINMENU        ReadMe.txt       Sample_MyE2B.cfg               TXT_Maker.exe       WIN



:~> ls -l /run/media/lienrag/E2B/_ISO/LINUX/
ls: impossible d'accéder à '/run/media/lienrag/E2B/_ISO/LINUX/kali-linux-mate-2019.1a-amd64.iso': Erreur d'entrée/sortie
ls: impossible d'accéder à '/run/media/lienrag/E2B/_ISO/LINUX/linuxmint-19.1-mate-64bit.iso': Erreur d'entrée/sortie
ls: impossible d'accéder à '/run/media/lienrag/E2B/_ISO/LINUX/Solus-4.0-Budgie.iso': Erreur d'entrée/sortie
ls: impossible d'accéder à '/run/media/lienrag/E2B/_ISO/LINUX/Solus-4.0-MATE.iso': Erreur d'entrée/sortie
ls: impossible d'accéder à '/run/media/lienrag/E2B/_ISO/LINUX/trisquel-sugar_8.0_amd64.iso': Erreur d'entrée/sortie
ls: impossible d'accéder à '/run/media/lienrag/E2B/_ISO/LINUX/xubuntu-18.04-desktop-i386.iso': Erreur d'entrée/sortie
total 8430816
-????????? ? ?       ?              ?              ? kali-linux-mate-2019.1a-amd64.iso
-????????? ? ?       ?              ?              ? linuxmint-19.1-mate-64bit.iso
-rwxrwxrwx 1 lienrag users 1081999360 22 juil.  2018 lubuntu-18.04-desktop-i386.iso
-????????? ? ?       ?              ?              ? Solus-4.0-Budgie.iso
-????????? ? ?       ?              ?              ? Solus-4.0-MATE.iso
drwxrwxrwx 1 lienrag users          0 24 févr.  2019 tails-amd64-3.12.1.img
-????????? ? ?       ?              ?              ? trisquel-sugar_8.0_amd64.iso
-rwxrwxrwx 1 lienrag users 2097152000 19 mai   11:44 ubuntu-19.04-desktop-amd64.iso
-rwxrwxrwx 1 lienrag users 2001469440 21 juil.  2018 ubuntu-mate-18.04-desktop-amd64.iso
-rwxrwxrwx 1 lienrag users 2018148352 20 juil.  2018 ubuntu-mate-18.04-desktop-i386.iso
-rwxrwxrwx 1 lienrag users 1434386432 29 juil.  2018 xubuntu-18.04.1-desktop-amd64.iso
-????????? ? ?       ?              ?              ? xubuntu-18.04-desktop-i386.iso

Is there a way to repair it, should I format the key and create a new easy2boot key, or is there another better software for creating multisystem USB keys?
I used Multisystem in the past, it worked well at first but I had a lot of trouble after that (and adding ISOs to it is much more complex than just copying the ISO into the right folder).

It is still not quite clear how that stick is organised. Can you please show a

fdisk -l

of it?

You also did not show us the command you used to copy the ISO file to the stick (or I could not find it in your stories). so you could also show that.

But, when it was a dd from the ISO to a partition, it is clear that when you stop this before it is finished, there is no usable ISO there. As @nrickert already suggested, in that case you only have to repeat that dd command and let it run to the end, to put the ISO where it should be.

Also, when this is a dd from the ISO to the partition, there is no file with a name xxxxx.iso there that you can delete. There is just the partition that contains (in your case only part of) an ISO 9660 file system.

That seems like the easiest solution.

…, or is there another better software for creating multisystem USB keys?

I have experimented with multisystem in the past. They don’t seem worth the effort. I just keep a small set of USB flash drives to use when needed – by just copying the iso directly to the USB (raw copy to device). But it is even easier to just use virtualization for testing iso directly in a virtual machine.

Here is the result for fdisk -l /dev/sdb :

Disque /dev/sdb : 115,3 GiB, 123815854080 octets, 241827840 secteurs
Modèle de disque : Patriot Memory  
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d'E/S (minimale / optimale) : 512 octets / 512 octets
Type d'étiquette de disque : dos
Identifiant de disque : 0xdb751a56

Périphérique Amorçage     Début       Fin  Secteurs Taille Id Type
/dev/sdb1    *             2048 241810316 241808269 115,3G  7 HPFS/NTFS/exFAT
/dev/sdb2             241810317 241810379        63  31,5K 21 inconnu


To copy the linux ISO to the E2B/_ISO/LINUX folder I used the file manager (caja I think at this time) as easy2boot is designed for that, just drag-and-drop the ISO one wants to add to the USB key.

I don’t have that much RAM which makes virtualization not ideal (I have enough for it to work, but not to not feel the constraints) but mostly the multiboot key is useful for install parties and things like that, I can make a demo to anyone who wants to see it and install the chosen distribution as they like. Plus, testing in a VM is not a way to check that the OS will work on the physical machine (Trisquel never gives any trouble on a VM, for example).

I found this 5 Apps to Create Multiboot USB - Linux & Windows ISOs Supported which presents tools I’ve never heard of like SARDU (which isn’t free), YUMI (which is windows-only if I understand correctly) and MultibootUSB.

Is the later better than easy2boot?
Can I put it on the same key (after formating it)? I’m a long way from home and don’t have my stock of USB keys with me…
But I don’t understand if by stopping the writing process I damaged the filesystem of the key or its hardware.

It is most likely that you only damaged the file system.

Is there a way to test that?

If you try to recreate the USB setup, then you will find out if the USB itself is still good.

I’m not sure what you mean by “recreate the USB setup”? If you mean repairing the filesystem, I’d like to but so far I don’t really understand how.

Anyway I tried to install MultibootUSB package (https://github.com/mbusb/multibootusb/releases/download/v9.2.0/multibootusb-9.2.0-1suse.noarch.rpm ) but YaST gives this error message:

Erreur : INVALID :multibootusb-9.2.0-1.noarch (file-ad19f930): Échec de la vérification de la signature [6-Le fichier n’est pas signé]
Header SHA1 digest: OK
MD5 digest: OK
Le paquet n’est pas signé !

(the package isn’t signed)

For an external package it would make sense that the maintainer’s signature is not in my keyring but I can’t see a way to add it in the website’s download instructions?
Or is the problem caused by something else?
Is there a way to install it though?

I have no idea what the “E2B/_ISO/LINUX folder” is.

But why don’t you do what we all try to tell you, do again what you did and that was interrupted. As I understand what you say “just drag-and-drop the ISO one wants to add to the USB key”

As showed by the ls results, an easy2boot key is structured with 2 partitions mounted respectively in /PTN2 and /E2B (the reason for that I don’t really understand).
/E2B has a subfolder /_ISO which itself has subfolders for different categories of ISO, the /LINUX subfolder being the one of interest for a Linux distribution.

How can I drag and drop if the file manager throw an error at mounting the partition E2B? Thunar or Nautilus shows an empty folder, and as showed before ls throws errors too.

Ok, then I do not understand how this device works.

Then you must recreate that file system, but I have no idea of what type it is.
It may even be that there is no file system at all, but some construct specific to the device, Then you have recreate that.

If you know what type of file system is needed, then you can just recreate that file system.

I didn’t find that information on the web site, but maybe you know since you have used the system.