You are not logged in.

#1 2021-04-20 21:04:14

Cvlc
Member
Registered: 2020-03-26
Posts: 295

Cannot write to /run/media/<user>

Hi !

I just installed a fresh Arch with Gnome and systemd-homed, and I cannot write to USB drives mounted by Gnome to /run/media/<user>/...

I don't remember this as being the default behavior in previous installs, can it have something to do with systemd-homed ?

$ ls -l /run/media/<user>/
total 16
drwxr-xr-x 1 root root 28 20 avril 15:56 6aedd0c8...
$ getfacl run/media/<user>/
# file: run/media/<user>/
# owner: root
# group: root
user::rwx
user:<user>:r-x
group::---
mask::r-x
other::---

Should I just chown the directory, or add myself to an appropriate group ? I thought this didn't have to be done for user created by systemd-homed..

Thanks for your help !

Offline

#2 2021-04-20 21:51:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,527

Re: Cannot write to /run/media/<user>

/run/media/$USER permissions are fine, what filesystem is "6aedd0c8..." (doesn't look like a FAT UUID)?

Offline

#3 2021-04-21 15:09:40

Cvlc
Member
Registered: 2020-03-26
Posts: 295

Re: Cannot write to /run/media/<user>

Thanks for your help

It was btrfs. But I formatted it to ext4 and it was the same. [edit] actually tried FAT too.

Tried with a couple other drives, and there's at least one that I could write to. So the permissions look fine indeed, it must have something to do with the way I format the drives ?

(the first time I formatted with gdisk and mkfs, and other tries I did with gnome disks)

Last edited by Cvlc (2021-04-21 15:12:05)

Offline

#4 2021-04-21 15:14:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,527

Re: Cannot write to /run/media/<user>

The permissions of actual filesystems (unlike FAT) are controlled by the filesystem, ie. if you mount some extfs node and that node is root:root/755 you're not gonna write there as UID1000
How did your FAT test go down? And what is the output of

ls -la /run/media/$USER/<somedrive>

Offline

#5 2021-04-21 16:31:27

Cvlc
Member
Registered: 2020-03-26
Posts: 295

Re: Cannot write to /run/media/<user>

Just formatted it again to fat via Nautilus, and still cannot write to it :

# ls -la /run/media/<user>/keydev/
total 4
drwxr-xr-x   2 <user> <user>   4096  1 janv.  1970 .
drwxr-x---+ 3   root       root      60      21 avril 18:27 ..

thanks for your help. Apparently other drives work normally, I initially only tried special thumbdrives like OS installers which is why I thought others were read-only as well

[edit] just noticed the + on the second line, I remember reading about this here

Last edited by Cvlc (2021-04-21 16:34:17)

Offline

#6 2021-04-21 16:35:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,527

Re: Cannot write to /run/media/<user>

That path belongs to your user… is it mounted read-only?

mount | grep  keydev

To ensure "cannot write" isn't a nautilus thing:

touch /run/media/$USER/keydev/foobar

Offline

#7 2021-04-22 22:57:54

Cvlc
Member
Registered: 2020-03-26
Posts: 295

Re: Cannot write to /run/media/<user>

Just plugged it in again, and now it's fine...

Haven't changed anything since last attempt. Maybe something got stuck in memory from the previous mount until I rebooted..

[edit]
OK it is indeed something like that.
I just formatted it back to btrfs by sudo umount, then sudo mkfs.btrfs etc...
I mounted it to /mnt/, sudo copied files to it, then unmounted, and ran $ blkid, and the ouptut was still vfat !
I then ran $ sudo blkid and the output of that is indeed btrfs.
Now when I run $ blkid again, it's like it's been "updated",  and the output is btrfs as well, without having done anything else than running $ sudo blkid

Is this normal behaviour ?

Last edited by Cvlc (2021-04-22 23:39:10)

Offline

#8 2021-04-23 06:14:02

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,527

Re: Cannot write to /run/media/<user>

blkid whatexactly

It'll require access to device nodes (/dev/sdb) that's usually not granted to regular user so in that case it can at best suggest some cachced value.
=> Did you ensure that the device was successfully unmounted? And not eg. mounted in a second path?
Did you only re-create a FS or did you also re-partition the disk?

Please also post exact IO of your actions (what you wrote, what the system wrote back), not paraphrases.

Offline

Board footer

Powered by FluxBB