1

When I mount blank btrfs partition in Dolphin, I get "Permission denied" on write. You can see that it's mounted on /run/media/%username% dir which is correct, but owner is root.

[doctor@doctoror doctor]$ pwd
/run/media/doctor
[doctor@doctoror doctor]$ ls -l
total 4
dr-xr-xr-x 1 root root 0 січ  1  1970 Home
[doctor@doctoror doctor]$ mkdir Home/tmp
mkdir: cannot create directory ‘Home/tmp’: Permission denied
  • Please post the relevant line of /etc/fstab. – terdon Sep 29 '13 at 12:25
  • @terdon this partition is not in fstab. – Yaroslav Mytkalyk Sep 29 '13 at 16:07
  • Then post the relevant line from /proc/mounts so people can see the mount options. – Mat Sep 29 '13 at 19:24
3

When you create a filesystem that supports file ownership, its root directory starts owned by root (with all the mkfs that I remember seeing). The ownership of the mount point and the user who did the mounting are irrelevant to the ownership of the root directory (or any other file) on that filesystem. It would be problematic after all if mounting a filesystem in a different place changed the privileges required to access each file on it.

If you want to create files as a non-root user, you'll have to give that user write permission to some directory on that filesystem.

2

Not sure whether this applies in general, but here's how things work on a freshly installed Linux Mint 16, udisks2 DPKG package version 2.1.0-4:

It looks like /usr/lib/udisks2/udisksd creates those mount point directories as root:root with permissions drwxr-xr-x, so octal 755; and the fix is indeed to simply change the permissions on the directory, for example:

sudo -i
cd /media/paul
chgrp paul DISK1 DISK2
chmod g+w DISK1 DISK2

Permissions will persist across remounts and reboots, which surprised me, because the moint point directories do disappear on unmount; so something (probably udisks/udisks2) remembers their permissions and then recreates them as you left them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.