You are not logged in.

#1 2016-09-10 16:19:51

tok
Member
Registered: 2016-08-10
Posts: 15

[Solved] Setting up permissions

Hello,

I apologize in advance for what is probably a pretty common question, but I seem to blank on the right search terms.

I have issues with the permissions settings, especially when mounting, unmounting and using USB sticks or external hard drives.
When I plug in a USB stick (mounting point usb0), I can't copy stuff on it. I can open it as root, but apart from being inconvenient, it's becoming painfully slow to copy anything on it(like 100 kb/s slow).
Additionally, when I want to unmount the stick, it asks for my password and says, it was mounted by another user.
That makes me think that my system somehow thinks, there are multiple users with the same name, and sure enough, when I enter "users" in terminal, it shows my username multiple times (four times atm, has been two before).

I am sorry that I can't be more specific at the moment, I am very new to this and don't know what to look for yet.

Almost forgot: the sticks are FAT formatted, if that is of any importance. Since I use multiple OS's and sometimes sticks from other people, I don't want to change that.

Thanks for reading.

Last edited by tok (2016-09-12 13:08:25)

Offline

#2 2016-09-10 17:07:54

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: [Solved] Setting up permissions

In Thunar -> Edit -> Preferences -> Advanced, have you enabled Volume Management and configured it?

usb file copying is notorious on Linux.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#3 2016-09-10 21:52:48

tok
Member
Registered: 2016-08-10
Posts: 15

Re: [Solved] Setting up permissions

Well, it is enabled, but I can't say I configured it wink
I tried playing around, checking and unchecking boxes, but it didn't change anything.

What strikes me as odd is the fact that when I type "users" into terminal, it tells me there are at least two of me smile Is that normal?

Just to be thorough, I also get this error, when I leave my laptop alone and it is supposed to go into hibernation mode:

GDBus.Error:org.freedesktop.DBus.Error.NoReply: Method call timed out

…and I am asked for my password, details show:
org.freedesktop.login1.hibernate

I already found out that this is a known bug, though, so i don't suppose one thing is related to the other.

Thanks for your answer.

Last edited by tok (2016-09-10 21:53:41)

Offline

#4 2016-09-11 02:04:15

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [Solved] Setting up permissions

tok wrote:

What strikes me as odd is the fact that when I type "users" into terminal, it tells me there are at least two of me smile Is that normal?

That's normal. The same user can log in to the system multiple times, so every time you open a terminal window a new you will appear. Try

w

to see a list.

Just to be thorough, I also get this error, when I leave my laptop alone and it is supposed to go into hibernation mode:

GDBus.Error:org.freedesktop.DBus.Error.NoReply: Method call timed out

I'm not a hardware/mounting expert, but if there is a problem with the way dbus was launched then auto-mounting might be broken. Is this a standard BunsenLabs system? Have you modified anything?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#5 2016-09-11 11:11:02

tok
Member
Registered: 2016-08-10
Posts: 15

Re: [Solved] Setting up permissions

Well, it is standard as far as I can tell, meaning, I am not able to modify anything, but able to break stuff tongue . Although I don't know what I could have done to mess this up. I had a problem before:

https://forums.bunsenlabs.org/viewtopic.php?id=2565

… but iirc I had mounting problems before, so I don't think it is the cause.

Offline

#6 2016-09-11 14:40:49

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Solved] Setting up permissions

tok wrote:

When I plug in a USB stick (mounting point usb0)

I presume then that you followed the (rather vague) advice of @Horizon_Brave in this post?

If this is the case, please post the full content of /etc/fstab

For the record, the line should look something like this to allow any user to mount/unmount & write to the device:

/dev/sdb1 /mnt vfat user,rw,umask=000,nofail,noauto 0 0

The "user" option allows access for all users, the "umask=000" option prevents executables from being, er, executed and the "nofail,noauto" options prevent systemd from throwing a hissy fit at bootup if the device is not permanently plugged in.

See https://wiki.archlinux.org/index.php/Fs … ormal_User for more on this.

To mount the USB stick, run `mount /dev/sdb1` (as your normal user); to unmount, use `umount -R /mnt` -- replace /mnt with the actual mountpoint used, of course.

Alternatively, write a udev rule to automate this.

If the "noauto" option is removed then the stick will mount automatically but you will still have to `unmount -R` before removing the device and there will be a (brief) error message about the mountpoint during bootup and in the jounal.

I should note that the officially recommend method of automounting USB sticks in BunsenLabs is to use thunar-volman and the GNOME virtual filesystem (gvfs) but apparently version 1.6.3 of thunar has a bug which prevents normal users from copying data to an automounted USB stick:
https://bugs.launchpad.net/ubuntu/+sour … ug/1332623

Just to confirm the particulars of that (Ubuntu-reported) bug, can you create new folders and files under /media/$USER (the USB stick mountpoint used by gvfs)?

It should also be possible to copy files over as a normal user with the terminal, at least it is on my system.

You will have to comment out the added fstab line and reboot to re-enable thunar's native automounting.

Sorry for the trouble and thanks for reporting this!

Offline

#7 2016-09-11 17:20:40

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [Solved] Setting up permissions

Head_on_a_Stick wrote:
tok wrote:

When I plug in a USB stick (mounting point usb0)

I presume then that you followed the (rather vague) advice of @Horizon_Brave in this post?

If this is the case, please post the full content of /etc/fstab


I apologize if anything I said or suggested caused you any issues tok. Thanks HoaS for pointing this out. My mistake and my responsibility...


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#8 2016-09-11 17:27:19

tok
Member
Registered: 2016-08-10
Posts: 15

Re: [Solved] Setting up permissions

Wow, this a lot to process for me, so I'll keep it short and get back at it later.

fstab says this:

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

#Entry for /dev/sda1 :
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx       /       ext4    errors=remount-ro  $
#Entry for /dev/sda5 :
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx       none    swap    sw      0       0

(I hid the UUIDs (probably doesn't matter, but still…), but I suppose this information is of no significance, right?)

I don't remember 100%, but I guess the reason why there is no line about sdb or sdb1 is this:

Wow, this thing is more complicated than I thought… Booted up the whole thing without external HDD, told me "start Job is running" (or something along those lines). My best bet is, that it's because I copied the swap file as well. Needed to plug in the HDD to get it running.
I did a rather cruel thing and removed the Information about the HDD from the fstab file. Booted ok afterwards. Let's hope it stays that way (and that I didn't remove critical parts of the system…).

Can I copy/paste this line in fstab:

For the record, the line should look something like this to allow any user to mount/unmount & write to the device:

/dev/sdb1 /mnt vfat user,rw,umask=000,nofail,noauto 0 0

… or do I have to format it somehow? The other lines look very different.

Just to confirm the particulars of that (Ubuntu-reported) bug, can you create new folders and files under /media/$USER (the USB stick mountpoint used by gvfs)?

No, I can't.

Sorry for the trouble and thanks for reporting this!

No reason to be sorry at all smile Thanks for your help, I feel like I'm getting closer wink

Last edited by tok (2016-09-11 17:28:06)

Offline

#9 2016-09-11 18:39:20

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Solved] Setting up permissions

tok wrote:

Can I copy/paste this line in fstab:

[...]

… or do I have to format it somehow? The other lines look very different.

The line should work if copied directly, the space character is the field delimiter so the format is the same as you see in your fstab; "/dev/sdb1" is preferred over the UUID as the latter will change if the USB stick is formatted or if more than one USB stick is used.

Just to confirm the particulars of that (Ubuntu-reported) bug, can you create new folders and files under /media/$USER (the USB stick mountpoint used by gvfs)?

No, I can't.

Just to be absolutely clear here, this is what I find in my BunsenLabs system with no /etc/fstab present at all:

If a USB stick (MS-DOS partition table, single FAT32 partition) is inserted, thunar will mount the device under media/$USER/ (/media/empty/ in my case) and it is not possible to drag and drop files from $HOME to the folder created within when the stick is mounted.

However, in my system it is possible to navigate to the USB stick folder (in thunar) and right-click on the empty tab and "Create file"; it is also possible to edit this file using the right-click option.

Can you do this in your system?

Also, can you use this to copy a file to the mountpoint as a normal user:

touch test
cp test /media/$USER/*

Use tab completion to replace "*" with the actual name of the folder.

Offline

#10 2016-09-11 23:00:20

tok
Member
Registered: 2016-08-10
Posts: 15

Re: [Solved] Setting up permissions

@Horizon_Brave, sorry, I completely overlooked that you posted a response. No need to apologize, really. You guys are so nice over here, I'm not used to it smile In other forums, I'd have like five people screaming at me for my ignorance…

If a USB stick (MS-DOS partition table, single FAT32 partition) is inserted, thunar will mount the device under media/$USER/ (/media/empty/ in my case) and it is not possible to drag and drop files from $HOME to the folder created within when the stick is mounted.

In thunar, in the top line it says "media usb0" when I go to the usb stick.
I can navigate to /media/user$, but it doesn't seem to be the stick. I copied files there (I had to use sudo to do so), which are not copied to the stick. I can see them using ls, even if the stick is not plugged in, though. That sounds like a quite normal concept I am not familiar with.

Also, can you use this to copy a file to the mountpoint as a normal user:

touch test
cp test /media/$USER/*

Use tab completion to replace "*" with the actual name of the folder.

Nope, had to use sudo to do so.

EDIT: I pasted the line into fstab and rebooted, now thunar doesn't show the stick at all. I can still see it using fdisk -l, though.

Last edited by tok (2016-09-11 23:30:52)

Offline

#11 2016-09-12 00:56:41

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [Solved] Setting up permissions

Riding two horses at the same time is only for the extremely skilled, so you've got the "Arch" (or generic Linux?) way using a line in /etc/fstab or the "officially recommended BunsenLabs" way using Thunar-volman.

I have never had any issues with usb permissions using a default BL install, and have just confirmed that a vfat formatted usb stick was correctly mountable via Thunar, and gave me permission to create a directory, create a new file, and copy in .profile. (reported to fail in that Ubuntu bug report) Also sending .profile to the wastebastket went fine. No problems at all.

My Thunar is version 1.6.3, I have no mention of usb sticks in /etc/fstab:

john@bunsen1:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/linux-bunsen /               ext4    errors=remount-ro 0       1
/dev/mapper/linux-data /data           ext4    defaults        0       2
/dev/mapper/linux-swap none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0

(I am using an LVM setup, but that should make no difference, should it?)

With the usb stick plugged in, here's the output of 'mount' (the usb stick appears right at the bottom):

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=487214,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,relatime,size=784120k,mode=755)
/dev/mapper/linux-bunsen on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
tmpfs on /etc/machine-id type tmpfs (ro,relatime,size=784120k,mode=755)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/mapper/linux-data on /data type ext4 (rw,relatime,data=ordered)
tmpfs on /run/user/108 type tmpfs (rw,nosuid,nodev,relatime,size=392060k,mode=700,uid=108,gid=116)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=392060k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/sdf on /media/john/SP UFD U3 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

So, what I'm getting at is that on a standard BL system there should be no need for a new user to be learning (yet) about fstab entries etc etc - Thunar-Volman should be doing it all automatically, and if it isn't the solution is to find out why.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#12 2016-09-12 01:04:42

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [Solved] Setting up permissions

tok wrote:

If a USB stick (MS-DOS partition table, single FAT32 partition) is inserted, thunar will mount the device under media/$USER/ (/media/empty/ in my case) and it is not possible to drag and drop files from $HOME to the folder created within when the stick is mounted.

In thunar, in the top line it says "media usb0" when I go to the usb stick.
I can navigate to /media/user$, but it doesn't seem to be the stick. I copied files there (I had to use sudo to do so), which are not copied to the stick.

/media/username doesn't belong to username! That's why you would have to be root to put things there. But the mounted usb drive will be a sub-directory, like /media/username/usb0, which does (or should) belong to username. You should have read and write permission there.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#13 2016-09-12 06:49:27

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Solved] Setting up permissions

@johnraff: when the USB stick is mounted, can you drag and drop files into it using thunar?

This is the main issue here -- I cannot do this on an almost stock BunsenLabs system but I should be able to.

@tok: I think there may be some confusion over my use of $USER in the file paths -- you should replace $USER with your actual username (ie, the name under which you log in).

If your username is "tok" (for example), then the stick would be mounted by thunar under /media/tok/ in a folder with a random alphanumeric string as the name, for example:

/media/tok/1GF457DB

If you open that randomly-named folder in thunar then you should be able to create new folders & files there using the right-click menu; I can do this in my system.

This will only happen if the /dev/sdb1 line in /etc/fstab is removed (or commented out) and the system rebooted afterwards.

As johnraff notes, the "fstab method" and the "thunar method" should *not* be used together and thunar will ignore USB sticks if they are listed in /etc/fstab

The "fstab method" is strictly a workaround for the automounting bug to which I linked earlier in the thread; the "thunar method" is the one we should be using.

Offline

#14 2016-09-12 07:36:04

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [Solved] Setting up permissions

Head_on_a_Stick wrote:

@johnraff: when the USB stick is mounted, can you drag and drop files into it using thunar?

Yes.
No one has reported this kind of mounting issue in BL to date as far as I know. I'm not sure why it doesn't work for you.

(btw if the usb device has a 'label' set then Thunar will use that as an identifier and directory name instead of the random number.)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#15 2016-09-12 09:55:05

tok
Member
Registered: 2016-08-10
Posts: 15

Re: [Solved] Setting up permissions

Ok, I'm afraid this is getting way over my head.

When I mount the stick and go to media/tok/, either in thunar or terminal, there is no stick there, at least not in a way that I can see it (no folder with a random number either). The path it is mounted is media/usb or media/usb0.

EDIT: Ok, I think, I got a little closer, at least I got a solution now. When I unmount the stick (I don't run Bunsenlabs in english, so I'm not sure about the right terminology, I mean the way you can still see it, but it's greyed out) and then remount it in thunar, I can access it the way it's supposed to, with the path being media/tok/stick. So, the problem seems to be that it automounts at a weird point, where I have no access.

Last edited by tok (2016-09-12 10:41:59)

Offline

#16 2016-09-12 13:03:05

tok
Member
Registered: 2016-08-10
Posts: 15

Re: [Solved] Setting up permissions

… Ok, follow-up: I modified fstab like this:

/dev/sdb1 /media/tok vfat user,rw,umask=000,nofail,noauto 0 0

I can use the stick in thunar just fine now and since I am the only user of this computer, it's going to work ok, I guess. It still asks for my password when I want to remove it, but i can live with that. So, for me, the problem is solved.

Small follow-up question: is there a kind of placeholder for user ($USER?) I can use instead of a particular user name, in case I have more than one user, i.e. the active user is the place where the stick is mounted?

Last edited by tok (2016-09-12 13:07:58)

Offline

#17 2016-09-12 13:35:53

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: [Solved] Setting up permissions

^ See all the mount descriptions and options with

man mount

This section might be relevant for you:

Only the user that mounted a filesystem can unmount it again. 
If any user should be able to unmount, then use users instead of user in the fstab line. 
The owner option is similar to the user option, with the restriction that the user must be the owner of the special file. 
This may be useful e.g. for /dev/fd if a login script makes the console user owner of this device. 
The group option is similar, with the restriction that the user must be member of the group of the special file. 

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#18 2016-09-12 17:01:17

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Solved] Setting up permissions

johnraff wrote:

I'm not sure why it doesn't work for you.

It now works for me, I have no idea why it failed last night hmm

Sorry for the noise.

@OP: all I can say is that the automounting (now) works as expected on my BL system and I can drag and drop files normally, sorry for the confusion.

If you load up the BunsenLabs ISO image and select the "Live session", can you drag and drop files to the stick normally on that desktop?

If you can then that would suggest a configuration problem with your installed system.

What exactly that problem might be is a mystery to me at the moment though sad

Offline

#19 2016-09-12 18:00:07

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [Solved] Setting up permissions

I do not want to derail the thread with any questions, but I think it may help for later referencing.  As JohnRaff states, two main methods exist for dealing with mounting here. With using the Thunar gui, which is the preferred method for us un-experienced, is it normal behavior that it won't see any changes manually made to the /etc/fstab? Or is this a bug with Thunar?

Also, I assume this isn't an issue when running a non-gui non-openbox install? If this were the case, you'd have no other option than to use and edit /etc/fatab..

Last edited by Horizon_Brave (2016-09-12 18:06:05)


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#20 2016-09-12 18:10:38

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Solved] Setting up permissions

Horizon_Brave wrote:

Or is this a bug with Thunar?

I though that perhaps that was the case but I cannot now reproduce this problem with my system so it looks like it was a configuration issue of some sort.

Can you drag & drop files to an automounted USB stick as a normal user in thunar?

For the record, users are strongly advised to leave /etc/fstab well alone until they have read and understood

man fstab

&

man mount

gvfs and thunar-volman are the officially supported automounting methods in BunsenLabs.

Offline

Board footer

Powered by FluxBB