Strange pendrive backup issue

I have a fine working usb flash disk. It is not very interesting, formatted in a regular dumb way from Windows 11 into fat32. Works in windows just fine. I’ve wanted to make a backup to it.

Backup fails with “no pendrive found” error.

In MDX it appears as /dev/sda , just /dev/sda
I even can mount /dev/sda manually to some random folder in /tmp and see or write files just fine.

Please notice, the /dev/sda itself contains the filesystem, there are no sda1, or sda2 or whatever partitions.

I had tried quick formatting, even tried exFat with no luck.

Here is a related dmesg log:

[  496.957589] usb 1-1: new high-speed USB device number 4 using ehci-platform
[  497.072522] usb 1-1: New USB device found, idVendor=abcd, idProduct=1234
[  497.072530] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  497.072535] usb 1-1: Product: UDisk
[  497.072539] usb 1-1: Manufacturer: General
[  497.072544] usb 1-1: SerialNumber: \xffffffd0\xffffff89
[  497.073153] usb-storage 1-1:1.0: USB Mass Storage device detected
[  497.074910] scsi host2: usb-storage 1-1:1.0
[  498.077297] scsi 2:0:0:0: Direct-Access     General  UDisk            5.00 PQ: 0 ANSI: 2
[  498.078288] sd 2:0:0:0: [sda] 30720000 512-byte logical blocks: (15.7 GB/14.6 GiB)
[  498.078952] sd 2:0:0:0: [sda] Write Protect is off
[  498.078964] sd 2:0:0:0: [sda] Mode Sense: 0b 00 00 08
[  498.079818] sd 2:0:0:0: [sda] No Caching mode page found
[  498.079829] sd 2:0:0:0: [sda] Assuming drive cache: write through
[  498.083032]  sda:
[  498.086036] sd 2:0:0:0: [sda] Attached SCSI removable disk

I’ve checked the webserver.py code, and found out that backup script mod-backup checks
ls /dev/disk/by-id/usb-part1* to find the pendrive existence

Meanwhile only /dev/disk/by-id/usb-General_UDisk-0:0 existed


Workaround:

I assumed that MDX wants filesystem to be on the separate volume, not on the sda block device itself (while windows works fine with that), and reformatted usb flash to have two separate volume:

image

After that MDX sees usb pendrive as a block device + two volumes sda1 sda2

/dev/disk/by-id/usb-General_UDisk-0:0@
/dev/disk/by-id/usb-General_UDisk-0:0-part1@
/dev/disk/by-id/usb-General_UDisk-0:0-part2@


[ 1043.097386] usb 1-1: new high-speed USB device number 4 using ehci-platform
[ 1043.212217] usb 1-1: New USB device found, idVendor=abcd, idProduct=1234
[ 1043.212225] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1043.212230] usb 1-1: Product: UDisk
[ 1043.212235] usb 1-1: Manufacturer: General
[ 1043.212240] usb 1-1: SerialNumber: \xffffffd0\xffffff89
[ 1043.212853] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 1043.214219] scsi host2: usb-storage 1-1:1.0
[ 1044.216993] scsi 2:0:0:0: Direct-Access     General  UDisk            5.00 PQ: 0 ANSI: 2
[ 1044.219246] sd 2:0:0:0: [sda] 30720000 512-byte logical blocks: (15.7 GB/14.6 GiB)
[ 1044.219853] sd 2:0:0:0: [sda] Write Protect is off
[ 1044.219859] sd 2:0:0:0: [sda] Mode Sense: 0b 00 00 08
[ 1044.220477] sd 2:0:0:0: [sda] No Caching mode page found
[ 1044.220481] sd 2:0:0:0: [sda] Assuming drive cache: write through
[ 1044.223854]  sda: sda1 sda2
[ 1044.227603] sd 2:0:0:0: [sda] Attached SCSI removable disk

After such manipulations I was able to make a backup with no “no pendrive found” error message.
Manipulations are not much user friendly.


To conclude, MDX does not understand a usb pendrive with a filesystem on the whole block device itself, with no additional partitions. Windows does, and regular user-friendly quick formatting does not change anything to make MDX to understand the pendrive.

Are you plugging the USB drive into the “A” USB on the mod box itself? This is where the back up data is saved on the “pen drive” - m

Sure.
To rephrase the problem -
Usb flash can be formatted in two ways.

  1. When filesystem lives on the block device itself, partitionless. (e.g. /dev/sda)
  2. When filesystem live on the partition. (e.g. /dev/sda1 )

Option 1 does not work on MDX
Option 2 works on MDX

Both ways work on my windows machine and both can be mounted to linux therefore I consder them both to be valid
I do not recall how I’ve ended with a partitionless flashdrive, but it may happen.

Conclusion - partitionless usb flash drive should be supported or at least documentation should mention that it is not supported.

1 Like