Ejecting a USB Drive on a Synology NAS

What Synology uses instead of umount
September 5, 2017

I have a Synology NAS, and I’ve been using a USB drive for non-critical content. Today I tried to unmount and remove the drive, and I was only mildly surprised to find that umount {volume} doesn’t work.

root@nas:~# umount /volumeUSB1/usbshare/
umount: /volumeUSB1/usbshare/: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)

A quick run of ipkg search lsof turned up nothing, but it makes sense that the NAS would have processes camped out in the volume mount location, since it makes the USB drive available to the rest of the DSM subsystem.

The solution is to use Synology’s own utility for removing the drive.

  1. If you don’t know the device name (visible in dmesg output), you can run cat /tmp/usbtab to get a list of USB devices.
  2. Once you have the device name (sdq in my case), run synousbdisk -umount sdq to unmount it.
  3. The NAS will report something like Unmount USB device sdq succeeded, after which it is safe to remove the drive.