Portable USB drive permission denied

,

Hi all. Hardware is a new WD Blue 2TB disk in a portable USB case.
I have been trying to set it up using Systemd automount - following this guide

And this page as well

The drive has been partitioned using Fdisk. Then GParted was used to create btrfs file systems
for each of the partitions.

All partitions show in the Kde Removeable Devices when I boot. The usb device appears on the root file system as per the guide. Automount is working, as I can access partition 1 (for example) but I cannot write to it. So I have a permission problem it seems.

Any thoughts - ideas?

This is the contents of usb-wdblue.mount file.

[Unit]
Description=Mount Backup disk (/data/backup)

[Mount]
What=dev/disk/by-uuid/bdefe00d-469d-4536-8cf9-0d53847eec4c
Where=/usb/wdblue
Type=btrfs
Options=rw,noatime
#TimeoutSec=seconds

[Install]
WantedBy=multi-user.target

Moderator edit: In the future, please use proper formatting: [HowTo] Post command output and file content as formatted text

You as your normal user - or as root as well?

Set the permissions on the mountpoint.

Unless I am missing something …

You describe being able to mount these partitions.

That has nothing to do with the read/write/access privileges of users or groups.

If you mount a regular ext4 usb to /media/media will still be owned by root and the contents of the usb will still have the same permissions as it did when it was created. If you did not chown or chmod some directory for $USER to access, then only root would have rights.

Yes it is supposed to automount - when you access the disk using Systemd configs in
/etc/Systemd/system. I have tried chown the mount point - but no luck yet.

Hmmm
the tutorial asks for the disk to be mounted on the root file system - not in /home.
So I can see /usb (in the root directory tree) is owned by user.
But the next sub directory /wdblue is owned by root.

I may have to disable this mount by disable the systemd process
then try to chown - then try enable systemd again. I will try this.

Yes despite the sub-directory /wdblue being chown to user - it does not persist. the sub directory goes back to owner root.

My process
stop systemd xxxx.mount
disable systemd xxx.automount

All worked ok

Then chown /usb/wdblue to user. This part is not working yet.

In the future, please properly format terminal and file output. Note I’ve done it for you this time. :wink:

Update. Its early days by my problem is Solved.

I am now able to write to the USB hard drive as user. For example in Dolphin File Manager I can use the split window feature and drag files from “Home” to the drive.
Previously this was halted with “Permission Denied”.

I can attribute this to a couple of things.

  1. Changing the file /etc/systemd/system/ xxxx.mount
    to show “Options=user,uid=my userid”
  2. After deleting the mount point in the file tree. I allowed the system to recreated it (done automagically by systemd) then applied

sudo chown -R owner:group /usb/xxx to the new mount point.

Thanks all.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.