Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Permissions (and/or owner) on USB drive cannot be changed - unable to access it in Write mode

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
de_se_77
Posts: 11
Joined: 2017-11-25 15:48

Permissions (and/or owner) on USB drive cannot be changed - unable to access it in Write mode

#1 Post by de_se_77 »

Hi All,

I have an USB drive (almost 750GB) and cannot access in Write mode (I mean create folders, cutting files etc..) with the standard user (the sole existing in addition to root).
I tried to change the permissions and the owner of the drive (since I formatted it as root, hope this wasn't a mistake...):

su
chmod 770 -R -f -v /media/Verbatim [/media/Verbatim it's the mount point of the USB drive, sdc1]
and also
chmod 770 -R -f -v /media/Verbatim/*

With no result: the drive Verbatim (sdc1) cannot be accessed in write mode by the standard user (using Dolphin, GUI files manager).

Then I tried to change the owner with (since it's owned by root):

su
chown -R standardUser /media/Verbatim/*

Still no result: the standard user cannot access the drive (with Dolphin) in write mode.

I think this task should be very simple but (I don't know why) it seems it isn't.
My system is Debian 9.13 with KDE.

Once fixed, I would like to edit the fstab in order to have the permissions fixed every time I switch on the PC.

Thanks to anyone can help!

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: Permissions (and/or owner) on USB drive cannot be changed - unable to access it in Write mode

#2 Post by kedaha »

Hi,
Try using su - (with the hyphen) instead of just su.
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

arzgi
Posts: 1183
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 31 times

Re: Permissions (and/or owner) on USB drive cannot be changed - unable to access it in Write mode

#3 Post by arzgi »

de_se_77 wrote: 2021-08-29 20:13
su
chown -R standardUser /media/Verbatim/*
I would do that

Code: Select all

chown -R standardUser:starntardUser ...
so it would change the onwer group also.

And what kedaha told abou su.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Permissions (and/or owner) on USB drive cannot be changed - unable to access it in Write mode

#4 Post by p.H »

de_se_77 wrote: 2021-08-29 20:13 chmod 770 -R -f -v /media/Verbatim/*
This command is redundant with the previous one.

What filesystem type is it ? Ext*, FAT, NTFS... ? Setting per-file permissions on non-Unix filesystem types does not work, you can only set global permissions at mount time.

Please show the current ownership and permissions.
ls -la /media/Verbatim
de_se_77 wrote: 2021-08-29 20:13 the standard user cannot access the drive (with Dolphin) in write mode.
This statement does not provide any useful information.
Please show exactly what you do and what happens. This is easier if you do it in command line.
de_se_77 wrote: 2021-08-29 20:13 I would like to edit the fstab in order to have the permissions fixed every time I switch on the PC
This is possible only for non-Unix filesystem types.
kedaha wrote: 2021-08-29 20:30 Try using su - (with the hyphen) instead of just su.
Irrelevant. chown and chmod are in the user's $PATH.
arzgi wrote: 2021-08-30 15:01 chown -R standardUser:starntardUser ...
Irrelevant. Mode 777 gives the same permissions to the owner and the group. If the user does not have permission, the group will not either.

de_se_77
Posts: 11
Joined: 2017-11-25 15:48

Re: Permissions (and/or owner) on USB drive cannot be changed - unable to access it in Write mode

#5 Post by de_se_77 »

First thanks for your replies.

I've tried the "su -" instead of simple "su" and "chown -R standardUser:starntardUser ..." but it didn't work: it responds "not allowed".

Here the results of

ls -la /media/Verbatim

...
drwxr-xr-x 13 root root 32768 ago 28 19:02 EPSON
...


I show just one folder ("EPSON") because all the folders have the same result in terms of permissions owner/group.
As already said the drive belongs to root.

And now the filesystem by typing:

df -T

...
/dev/sdc1 vfat 732391616 150806016 581585600 21% /media/Verbatim
...


So I think what stated by p.H about non-Unix fs can help: I don't know how to set "global permissions at mount time".
Once known the right command I can edit the fstab with "nano /etc/fstab".
At the moment I've tried this two entries in the fstab (and didn't work):

UUID=19E8-2432 /media/Verbatim vfat defaults 0 0

UUID=45FD-E86C /media/Verbatim vfat users 0 0

de_se_77
Posts: 11
Joined: 2017-11-25 15:48

Re: Permissions (and/or owner) on USB drive cannot be changed - unable to access it in Write mode

#6 Post by de_se_77 »

Note: the UUID is different because I formatted the drive, I tried both "defaults" and "users" with no result

Marie SWE
Posts: 241
Joined: 2021-04-06 22:14
Location: Sweden / Linköping
Has thanked: 7 times
Been thanked: 9 times

Re: Permissions (and/or owner) on USB drive cannot be changed - unable to access it in Write mode

#7 Post by Marie SWE »

de_se_77 wrote: 2021-08-30 20:45 Note: the UUID is different because I formatted the drive, I tried both "defaults" and "users" with no result
just a small question.. how did you formatted the drive? and did you do it on this computer you can't get write access on?
Why make things complicated in life, if you can make it easier for yourself... Do it. ;o)
You only have one life, so make the most of it and enjoy it while you can.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Permissions (and/or owner) on USB drive cannot be changed - unable to access it in Write mode

#8 Post by p.H »

From man mount :

Code: Select all

   Mount options for fat
       (Note:  fat  is  not  a  separate filesystem, but a common part of the
       msdos, umsdos and vfat filesystems.)

       uid=value and gid=value
              Set the owner and group of all files.  (Default:  the  UID  and
              GID of the current process.)

       umask=value
              Set  the  umask  (the  bitmask  of the permissions that are not
              present).  The default is the umask  of  the  current  process.
              The value is given in octal.
PS: Any reason for using FAT instead of a filesystem which natively supports Unix permissions ?

User avatar
sunrat
Administrator
Administrator
Posts: 6382
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 115 times
Been thanked: 456 times

Re: Permissions (and/or owner) on USB drive cannot be changed - unable to access it in Write mode

#9 Post by sunrat »

de_se_77 wrote: 2021-08-30 20:39...
/dev/sdc1 vfat 732391616 150806016 581585600 21% /media/Verbatim
...


So I think what stated by p.H about non-Unix fs can help: I don't know how to set "global permissions at mount time".
Once known the right command I can edit the fstab with "nano /etc/fstab".
At the moment I've tried this two entries in the fstab (and didn't work):

UUID=19E8-2432 /media/Verbatim vfat defaults 0 0

UUID=45FD-E86C /media/Verbatim vfat users 0 0
VFAT/FAT32 does not support Linux file permissions. For setting the drive permissions at mount time, try:

Code: Select all

UUID=45FD-E86C /media/Verbatim vfat dmask=000,user 0 0
And please use "<code>" tags when posting text output from a terminal. It is difficult to read otherwise.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

de_se_77
Posts: 11
Joined: 2017-11-25 15:48

Re: Permissions (and/or owner) on USB drive cannot be changed - unable to access it in Write mode

#10 Post by de_se_77 »

As suggested by sunrat I typed in fstab:

Code: Select all

UUID=45FD-E86C /media/Verbatim vfat dmask=000,user 0 0
and it WORKED!

Then I noticed that deleting the above mount line (simply commenting it with a # before) the result was the same: I tried it simply because with another pendrive I could access it with all permissions. It is simply slower, so I think it's better to keep the above mount line in fstab (the drive is almost 90% of the time plugged).

@Marie SWE: I formatted it with "parted" and then "mkfs.vfat /dev/sdc1"; yes the same PC

@p.H: I used FAT in order to plug the usb drive also on Windows system (access in rwx on both OS). I don't know if there is a better fs that can do that

Thank you all for your help and thanks to sunrat for the solution!

Post Reply