mshelby
Posts: 5
Joined: Wed Nov 16, 2016 2:25 am

Trouble mounting usb drives

Tue Feb 13, 2018 1:40 pm

I have a raspbian-lite headless server setup.
Debian 9 (stretch)

I am having difficulty properly mounting two usb drives with write permissions.
My setup is nothing fancy, and no real alterations or deviations from a normal headless server.
I can get fstab to auto-mount them, but then permissions are always not right.

The two usb drives (from fstab output) are:

proc /proc proc defaults 0 0
PARTUUID=815bed4b-01 /boot vfat defaults 0 2
PARTUUID=815bed4b-02 / ext4 defaults,noatime 0 1
----> UUID=596FBA3E042EEE51 /media/usb0 ntfs-3g errors=force,rw,defaults 1 1
----> PARTUUID=69ac58f5-01 /media/usb1 ext3 defaults,nofail 0 0


Problem #1: I cannot get the system to automatically mount the devices upon insert into the usb slots.

So I'm pretty experienced using linux command line... and I've setup a fair number of distros including several raspbian ones. I'm pretty proficient with Debian as well. I'm sure I've had success detecting and mounting usb attached hardware in the past. Seems like a few programs had to be installed for this to happen automatically. I feel like I've installed all that I routinely remember. (mount, pmount, usbmount, ntfs-3g...etc...)

Problem #2: I cannot get rw permissions for all on either drive?

So, has something changed recently with systemd, udev, or basically in Debian 9 that changed mounting processes? I have tried multiple formats on each drive... seems like raspberry pi does not work with usb hardware in the same way Debian does?

Also, I've looked all over for good information to address the issue. Most posts and answers seem to only confuse the discussion. Most all solutions I've been able to find either no longer work, or are very specific to a users system.

My hope in posting this is to get some clarity! Thanks!

k-pi
Posts: 646
Joined: Sun Feb 12, 2017 1:46 pm
Location: Upper Hale, Surrey, UK.

Re: Trouble mounting usb drives

Tue Feb 13, 2018 2:04 pm


mshelby
Posts: 5
Joined: Wed Nov 16, 2016 2:25 am

Re: Trouble mounting usb drives

Wed Feb 14, 2018 10:59 am

Thanks. I've looked at several links. I'll try a few solutions later today and return with feedback. Still curious why this appears to be such an issue with so many?

I have usbmount installed but it appears to do nothing on my system.
I'll have to see if I have autofs or not....

So does the full installation of Raspbian enable "plug-nplay" auto-mounting of usb attached drives? Seems like it did if I recall... It mounts the device in /media/user-name/xxxX or just /media/usbX.
But it doesn't have same behavior in a standard installation of Raspbian-lite? It doesn't in my standard installation, raspbian/debian 9 (stretch).

If so I wonder what file is not included in "Lite" that enables this functionality in "full"? Perhaps it is a package-requirement of dependency that is pulled in ostensibly when one adds a desktop environment to the "Lite" version? If so, this would be good info to know for those of us working with a headless version, i.e. Keeping it "Lite."

So, as an update, I'm aiming to solve the first delima, just getting the usb drives auto-detected and setup by the system INSTEAD of me having to stipulate an entry in /etc/fstab...

Would love to hear feedback from others as to whether my scenario is mirrored by them as well? Still trying to determine whether my case is standard behavior on a headless installation of Raspbian-Lite (Debian 9 stretch) or perhaps if something went wrong in my installation.

mshelby
Posts: 5
Joined: Wed Nov 16, 2016 2:25 am

Re: Trouble mounting usb drives

Wed Feb 14, 2018 11:37 am

Also, for the sake of clarity, I should explain what I am hoping to achieve with my setup. I think it is fairly typical, but I will clarify in hopes of keeping this discussion on topic and addressing the concerns I've raised in a more general sense so it may be helpful for others.

First, I am installing Raspbian-life (stretch) in a headless environment to setup a home server with Nextcloud file storage on it. As it is headless, I do everything from command line including accessing my Raspberry Pi 3b via "ssh" from another Linux computer running Debian 9.

In my nextcloud setup I'd like to use an external drive to store my data. Nextcloud's typical provision is to have a data directory within the parent directory to store data. I.e. ".../nextcloud/data/" . Nextcloud provides documentation on how to instead utilize an external sub drive to house your data.... So I am not looking to solve that issue. Just looking to resolve the usb mounting issue.

Second, I am attempting to mount two usb drives to my Pi3, as noted in my fstab configuration previously given. The first drive is a 32gb flash-drive formatted as ntfs-3g. The second is a 250gb flash-drive formatted as ext3. This drive appears to have some possible sector damage and I could not get it to format as FAT32, NTFS, or EXT4. Only EXT3 seems to format reliably on that drive for now.

Again, I am not looking to resolve any of those issues in this thread. I'm content to work with what I have for now. I just want to get auto-detection, setup, mounting and permissions resolved for what I have.

Thanks again, I appreciate any help I can get!

Return to “Raspbian”