[opensuse] Cannot write to USB drives as $USER? - openSUSE12.1/KDE4.8.4
I've been puzzling over this one... it has to be simple/obvious, but I'm having a senior moment and can't seem to find the "right" way to make this work. The situation is, a new Linux user has a new openSUSE 12.1 x86_64 install and has updated it to KDE4.8.4. No other tweaks etc., and a default software lineup (other than the KDE4 update). He has an external 1 TB USB drive. He used YaST > Partioner to reformat the drive as ext4. This all went fine. Unplug the drive and plug it back in and it's automounted as expected... .except, $USER cannot write to the disk, only root has write permissions. Now on my own aged system I don't run into that issue.... but I can't remember if I changed something or what needs to be changed. I could say.. just open up a terminal and change the permissions on the mount point then plug in the drive (but that only works around the problem for that one drive)... or manually mount the drive with a different mask... but neither of these "solutions" should be necessary in a default setup should they? So... is there a configuration issue here? Or something else? What is the correct way for this to be handled? C. -- openSUSE 12.1 x86_64, KDE 4.8.4 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-06-17 17:13, C wrote:
He has an external 1 TB USB drive. He used YaST > Partioner to reformat the drive as ext4. This all went fine. Unplug the drive and plug it back in and it's automounted as expected... .except, $USER cannot write to the disk, only root has write permissions.
Of course :-) (It is absolutely correct)
I could say.. just open up a terminal and change the permissions on the mount point then plug in the drive
:-) No, mount the drive then change the permissions of the mount point. However, as the /media/* mount points are temporary, you have two solutions: a) Mount to a fixed point in /mnt via fstab, and change the permissions of that path after mounting b) Mount automatically, but create a directory in it, and change its owner to be of the user you want to write there.
(but that only works around the problem for that one drive)... or manually mount the drive with a different mask...
Mount masks will not work. Remember, it is an ext4, *nix permissions apply. - -- Cheers / Saludos, Carlos E. R. (from 11.4 x86_64 "Celadon" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/eA7kACgkQIvFNjefEBxqDZwCdF88rcorNv5+w8akWkN0KyIRs jTsAoLdorsCi6H3xXV3IktEwMDzD9o47 =z4xP -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, Jun 17, 2012 at 6:20 PM, Carlos E. R. <robin.listas@telefonica.net> wrote:
He has an external 1 TB USB drive. He used YaST > Partioner to reformat the drive as ext4. This all went fine. Unplug the drive and plug it back in and it's automounted as expected... .except, $USER cannot write to the disk, only root has write permissions.
No, mount the drive then change the permissions of the mount point. However, as the /media/* mount points are temporary, you have two solutions:
Aha.. but.. as I discovered with a little tinkering (which reminded me what I did so very long ago) you can plug in the ext4 formatted USB drive, do a chown -R $USER:$GROUP /media/USBLabel and it will remember that ownership for next time the device is connected to that computer. You can unmount and remount and it'll retain the tweaked permissions. So, in effect... it's solved I guess... the solution was what I thought... either create a directory on the drive and assign rights, or change the ownership of the mount point. Another alternative? Set the group to a common group for root and $USER for these actions?
a) Mount to a fixed point in /mnt via fstab, and change the permissions of that path after mounting
I wanted to avoid this. New user... getting him to futz in his fstab is not a good idea... he wants to try out Linux, but the connection to this new (to him) OS is tenuous at best.... several times this weekend he's been milliseconds from wiping it all and installing Windows due to high levels of frustration over little things... like formatting a drive and then discovering he cannot write to it without some silly tweaking. He expected to be able to write to the drive after formatting the exact same as he can from Windows or OSX
Mount masks will not work. Remember, it is an ext4, *nix permissions apply.
Right.. I was thinking of NTFS as we were fighting with an NTFS formatted drive just before that... and again, he couldn't write to the drive, and there a mask change I walked him through in fstab sorted that out. C -- openSUSE 12.1 x86_64, KDE 4.8.4 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-06-17 18:58, C wrote:
On Sun, Jun 17, 2012 at 6:20 PM, Carlos E. R. <> wrote:
No, mount the drive then change the permissions of the mount point. However, as the /media/* mount points are temporary, you have two solutions:
Aha.. but.. as I discovered with a little tinkering (which reminded me what I did so very long ago) you can plug in the ext4 formatted USB drive, do a chown -R $USER:$GROUP /media/USBLabel and it will remember that ownership for next time the device is connected to that computer. You can unmount and remount and it'll retain the tweaked permissions.
Ahá! That's must be a new feature. Nice.
So, in effect... it's solved I guess... the solution was what I thought... either create a directory on the drive and assign rights, or change the ownership of the mount point.
After it is mounted, yes.
Another alternative? Set the group to a common group for root and $USER for these actions?
Well, if it remembers the group... that is, if they did that feature, I don't know.
a) Mount to a fixed point in /mnt via fstab, and change the permissions of that path after mounting
I wanted to avoid this. New user... getting him to futz in his fstab is not a good idea... he wants to try out Linux, but the connection to this new (to him) OS is tenuous at best.... several times this weekend he's been milliseconds from wiping it all and installing Windows due to high levels of frustration over little things... like formatting a drive and then discovering he cannot write to it without some silly tweaking. He expected to be able to write to the drive after formatting the exact same as he can from Windows or OSX
Well, Linux is not easy at first. It needs time to get used to, specially if one is used to Windows. To me, Windows is not that easy either. - -- Cheers / Saludos, Carlos E. R. (from 11.4 x86_64 "Celadon" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/eXrAACgkQIvFNjefEBxpowQCeImkf5n3ELO+TrZwqafHCIOGv yFYAoLa8z2vTJK8r4SMgFlc6+O0lKa1K =Y9jw -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
C wrote:
Aha.. but.. as I discovered with a little tinkering (which reminded me what I did so very long ago) you can plug in the ext4 formatted USB drive, do a chown -R $USER:$GROUP /media/USBLabel and it will remember that ownership for next time the device is connected to that computer. You can unmount and remount and it'll retain the tweaked permissions.
However, that will only work on the computer you issued that command on. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 18/06/12 11:12, James Knott wrote:
C wrote:
Aha.. but.. as I discovered with a little tinkering (which reminded me what I did so very long ago) you can plug in the ext4 formatted USB drive, do a chown -R $USER:$GROUP /media/USBLabel and it will remember that ownership for next time the device is connected to that computer. You can unmount and remount and it'll retain the tweaked permissions.
However, that will only work on the computer you issued that command on.
Sorry, but my personal experience is otherwise. I have a number of USB memory sticks which were formatted on my old 32-bit computer. They are formatted in ext4. I use these same sticks on my wife's computer to backup her /.mozilla and /.thunderbird directories - of course she has a totally different username etc. End of April I built my new 64-bit computer and I use these same sticks on it - no reformatting, no nothing. For it all to work, after formatting the USB stick run the appropriate 'chown -R.....' and the 'chmod -R....' commands on it. BC -- Using openSUSE 12.1 x86_64 KDE 4.8.3 and kernel 3.4.2 on a system with- AMD FX 8-core 3.6/4.2GHz processor 16GB PC14900/1866MHz Quad Channel Corsair "Vengeance" RAM Gigabyte AMD3+ m/board; Gigabyte nVidia GTX550Ti 1GB DDR5 GPU -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Basil Chupin wrote:
On 18/06/12 11:12, James Knott wrote:
C wrote:
Aha.. but.. as I discovered with a little tinkering (which reminded me what I did so very long ago) you can plug in the ext4 formatted USB drive, do a chown -R $USER:$GROUP /media/USBLabel and it will remember that ownership for next time the device is connected to that computer. You can unmount and remount and it'll retain the tweaked permissions.
However, that will only work on the computer you issued that command on.
Sorry, but my personal experience is otherwise.
I have a number of USB memory sticks which were formatted on my old 32-bit computer. They are formatted in ext4.
I use these same sticks on my wife's computer to backup her /.mozilla and /.thunderbird directories - of course she has a totally different username etc.
End of April I built my new 64-bit computer and I use these same sticks on it - no reformatting, no nothing.
For it all to work, after formatting the USB stick run the appropriate 'chown -R.....' and the 'chmod -R....' commands on it.
BC
I just tried that and it does work. You can also use chmod to set permissions. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am Sonntag, 17. Juni 2012, 21:12:19 schrieb James Knott:
C wrote:
Aha.. but.. as I discovered with a little tinkering (which reminded me what I did so very long ago) you can plug in the ext4 formatted USB drive, do a chown -R $USER:$GROUP /media/USBLabel and it will remember that ownership for next time the device is connected to that computer.
You can unmount and remount and it'll retain the tweaked permissions.
However, that will only work on the computer you issued that command on.
That depends. It will work on every unix computer for every user that has the same numerical(!) uid and gid. When making the file system world writable with restricted deletion, like temp, every user, regardless of their uid/gid, can write to it. However, the protection of the restricted deletion bit is futile if the user of another computer chooses the same uid/gid. Nonetheless, everyone who has physical access to the drive can read it unless encryption is used. Gruß Jan -- No man's life, liberty or possessions are safe while the legislature is in session. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am Sonntag, 17. Juni 2012, 17:13:32 schrieb C:
[...] I could say.. just open up a terminal and change the permissions on the mount point then plug in the drive
No. That will not help. When you use ext4, regard the external disk as an internal one. Consider your own "/" or "/home". As a user, you cannot write to them. This is because of the ownership/permissions of the file system itself, not because of the mount point and its ownership/permissions before mounting. In contrast, take a look at "/tmp". There, anyone could create files and directories, it is word-writable. In addition, it has the restricted deletion bit set. That is, this flag "prevents unprivileged users from removing or renaming a file in the directory unless they own the file or the directory" (man chmod). If this is the desired behavior, you, as root, could do a "chmod a=rwxt" on the mounted file system or use dolphin in root mode.
(but that only works around the problem for that one drive)...
Correct. But then on every unix computer forever. :)
or manually mount the drive with a different mask...
Masks are useful for file systems that do not support unix permissions, e.g., NTFS and FAT.
but neither of these "solutions" should be necessary in a default setup should they? [...]
For internal hard disks the default permissions are reasonable. In case of external ones, it depends. Sometimes you want "/home" permissions and sometimes "/tmp" permissions. Gruß Jan -- Nothing happens to you that hasn't happened to someone else. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
C wrote:
So... is there a configuration issue here? Or something else? What is the correct way for this to be handled?
I just create a folder on the drive with the user as owner. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (5)
-
Basil Chupin
-
C
-
Carlos E. R.
-
James Knott
-
Jan Ritzerfeld