Having tired of manually decoding UDEV’s essentially random device names produced for the various USB action cameras and card readers, I put the device UUIDs in
/etc/fstab and let the device names fall where they may:
UUID=B40C6DD40C6D9262 /mnt/video ntfs noauto,uid=ed 0 0 UUID=0FC4-01AB /mnt/Fly6 vfat noauto,nodiratime,uid=ed 0 0 UUID=0000-0001 /mnt/M20 vfat noauto,nodiratime,uid=ed 0 0 LABEL=AS30V /mnt/AS30V exfat noauto,nodiratime,uid=ed 0 0
You get those by plugging everything in, running
blkid, and sorting out the results.
The 64 GB MicroSD card from the Sony AS30V camera uses Microsoft’s proprietary
exfat file system, which apparently doesn’t associate a UUID/GUID with the entire device, so you must use a partition label. The Official SD Card Formatter doesn’t (let you) set one, so:
exfatlabel /dev/sdd1 AS30V
It turns out you can include spaces in the partition label, but there’s no way to escape them (that I know of) in
/etc/fstab, so being succinct counts for more than being explanatory.
One could name the partition in the Windows device properties pane, which would make sense if one knew it was necessary while the Token Windows Laptop was booted with the card in place.
I think this is easier then trying to persuade UDEV to create known device names based on the USB hardware characteristics, because those will depend on which USB card / device / reader I use. I can force the UUIDs to be whatever I want, because they’re just bits in the disk image.
With all that in place, you plug in All. The. Gadgets. and run the script (as seen below). The general idea is to verify the bulk video drive mounted OK, attempt to mount each memory card and fire off a corresponding
rsync copy, wait until they’re all done, tidy the target filenames, then delete all the source files to get ready for the next ride.
Funneling all three copies to a single USB hard drive probably isn’t the smartest thing, but the overall write ticks along at 18 MB/s, which is Good Enough for my simple needs. If the drive thrashes itself to death, I won’t do it again; I expect it won’t fail until well outside the 1 year limited warranty.
If any of the
rsync copies fail, then nothing gets deleted. I’m a little queasy about automagically deleting files, but it’s really just video with very little value. Should something horrible happen, I’d do the copies by hand, taking great care to not screw up.
After all, how many pictures like this do we need?
The Bash script as a GitHub Gist: