USB auto-mount

Problem/Justification
As discussed in this topic (Why you should avoid USB attached drives for data pool disks), using USB for data pool disks is highly discouraged. However, this discussion does mention that USB-attached storage has a legitimate place with TrueNAS:

  • Importing data to a NAS via USB storage may be faster than network copies.
  • Backup disks attached via USB for temporary connection can be used successfully.

Personally, for my new TrueNAS server, I’ve been populating my new data pools with data from portable USB HDDs. I also plan to use some portable HDDs for occasional backups.

However, the problem here is that it’s slightly cumbersome, because I have to manually mount the USB drive at the command line.

On a typical modern Linux distro like Ubuntu, I can just plug in one of these drives, and it’ll auto-mount at /media/, using the drive’s partition label. So if I plug in two drives (HDDs or flash drives), one named “frogmorton” and one named “michel_delving”, I’ll automatically have these drives available at /media/frogmorton and /media/michel_delving, and can copy files to/from these drives there. I don’t have to look at dmesg to figure out which drive is /dev/sde and which is /dev/sdf, or create my own mount points for them. When I unplug them, those subdirectories are gone.

It would be nice to have the same functionality in TrueNAS for those times I want to plug in an external USB drive for copying data. Sure, I could just do this over the network from my laptop, but a direct USB3.0 connection is significantly faster. (No, I don’t have 10Gb ethernet on my laptop, or on my TrueNAS box for that matter.)

Impact
As discussed above, it would make it easier to temporarily plug in external drives for copying data at higher speeds than the network is capable of.

The only disadvantage I can see is that it might cause some confusion with people who use USB drives for ZFS pools. Currently, every time I plug in one of these drives, the TrueNAS UI asks me if I want to create a pool with it. Of course, I don’t (as discussed in the referenced article above). It would be nice too, if TrueNAS could be configured to not ask this question about USB-connected devices.

User Story

  1. User plugs in their portable USB HDD to USB port on TrueNAS server
  2. User sees confirmation in UI that disk is mounted, and opens file-browsing application in UI (probably in “apps”). User doesn’t need to use command-line, or look at which dev or partition number is needed in dmesg.
  3. User copies data to/from USB HDD, using convenient mount point at /media/
  4. User unmounts USB disk from UI
  5. User unplugs USB disk and puts it away, gives it to friend, puts it in safety-deposit box, etc.

One issue with USB mounted drives is file & directory attributes, aka owner, group and permissions.

Using SMB or NFS creates the files on the NAS with the proper permissions. Using local storage as a source may be faster IF their is little need to maintaining or setting specific permissions. Or you can change the permissions afterward.

So the recommendation is still copy via the network, (it’s a Network Attached Storage server).

Don’t forget you can vote for your own feature request.

That’s a good point about permissions; I had forgotten about that. Currently I have to change them manually.

Still, it’s worth the trouble for me, because the speed is so much faster. Yes, it is a network-attached storage server, but a direct USB connection is much faster than a gigabit ethernet connection (not to mention WiFi). For a small number of files, it’s not really worthwhile, but if I want to copy a terabyte of data, it saves a lot of time.