-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2018-03-01 at 17:13 +0100, Roger Oberholtzer wrote:
On Thu, Mar 1, 2018 at 5:00 PM, Dave Howorth <dave@howorth.org.uk> wrote:
On Thu, 1 Mar 2018 15:49:15 +0100 Roger Oberholtzer <> wrote:
On Thu, Mar 1, 2018 at 3:24 PM, Andrei Borzenkov <> wrote:
On Thu, Mar 1, 2018 at 5:16 PM, Roger Oberholtzer <> wrote:
If the directory before the mount has 0777 (all rwx), after the mount those will be the permissions for the root of the mounted volume.
No.
localhost:~ # ls -ld /mnt drwxrwxrwx 1 root root 0 Dec 6 03:16 /mnt localhost:~ # mount /dev/sdb1 /mnt localhost:~ # ls -ld /mnt drwx------ 1 test root 8 Feb 28 10:08 /mnt
As expected.
# ls -ld /backup/ drwxrwxrwx 2 root root 4096 Mar 1 15:37 /backup/ # mount /dev/sdb1 /backup/ # ls -ld /backup/ drwxrwxrwx 2 root root 4096 Mar 1 15:37 /backup/
This is a newly formatted ext4 volume.
If this happens and /backup is not a LINUX filesystem, something changed them.
So whilst it is mounted, change its permissions (i.e. chmod whatever /backup) and its owner if you wish. Then unmount it. Check again what the permissions of the mount point are. Then mount it again and check what the permissions of its top-level directory are again.
This did not seem to do as I expected on an ext4 partition:
mount /backup cd /backup chmod a+rwx .
After a remount, the permissions are not a+rw
Initial state: the mount point does not exist. Telcontar:~ # l /media total 8 drwxr-xr-x 2 root root 4096 Mar 1 11:57 ./ drwxr-xr-x 38 root root 4096 Feb 4 13:44 ../ - -rw-r--r-- 1 root root 0 Jun 16 2013 not_mounted I insert the stick, and mount it via desktop: Telcontar:~ # l /media total 12 drwxr-xr-x 3 root root 4096 Mar 1 18:34 ./ drwxr-xr-x 38 root root 4096 Feb 4 13:44 ../ drwxr-xr-x 4 cer cer 4096 Jul 25 2017 Ext4Flash/ <==== - -rw-r--r-- 1 root root 0 Jun 16 2013 not_mounted I change its permissions: Telcontar:~ # chmod g-r-x /media/Ext4Flash/ Telcontar:~ # umount /media/Ext4Flash/ Telcontar:~ # l /media total 8 drwxr-xr-x 2 root root 4096 Mar 1 18:35 ./ drwxr-xr-x 38 root root 4096 Feb 4 13:44 ../ - -rw-r--r-- 1 root root 0 Jun 16 2013 not_mounted I mount it again: Telcontar:~ # l /media total 12 drwxr-xr-x 3 root root 4096 Mar 1 18:35 ./ drwxr-xr-x 38 root root 4096 Feb 4 13:44 ../ drwx---r-x 4 cer cer 4096 Jul 25 2017 Ext4Flash/ - -rw-r--r-- 1 root root 0 Jun 16 2013 not_mounted Telcontar:~ # The permissions are those I changed. They keep, on newly created mount point. Stick removed: Telcontar:~ # l /media total 8 drwxr-xr-x 2 root root 4096 Mar 1 18:42 ./ drwxr-xr-x 38 root root 4096 Feb 4 13:44 ../ - -rw-r--r-- 1 root root 0 Jun 16 2013 not_mounted I create mount point: Telcontar:~ # md /media/Ext4Flash/ Telcontar:~ # l /media total 12 drwxr-xr-x 3 root root 4096 Mar 1 18:43 ./ drwxr-xr-x 38 root root 4096 Feb 4 13:44 ../ drwxr-xr-x 2 root root 4096 Mar 1 18:43 Ext4Flash/ - -rw-r--r-- 1 root root 0 Jun 16 2013 not_mounted Change permissions of mountpoint: Telcontar:~ # chmod g-r-x,o-r-x /media/Ext4Flash/ Telcontar:~ # l /media total 12 drwxr-xr-x 3 root root 4096 Mar 1 18:43 ./ drwxr-xr-x 38 root root 4096 Feb 4 13:44 ../ drwx------ 2 root root 4096 Mar 1 18:43 Ext4Flash/ - -rw-r--r-- 1 root root 0 Jun 16 2013 not_mounted Telcontar:~ # mount it via desktop: Telcontar:~ # l /media total 16 drwxr-xr-x 4 root root 4096 Mar 1 18:45 ./ drwxr-xr-x 38 root root 4096 Feb 4 13:44 ../ drwx------ 2 root root 4096 Mar 1 18:43 Ext4Flash/ drwxr-xr-x 4 cer cer 4096 Jul 25 2017 Ext4Flash1/ - -rw-r--r-- 1 root root 0 Jun 16 2013 not_mounted Telcontar:~ # Ah, ok, it created a new mountpoint. Try manually. Telcontar:~ # mount | grep Ext4Flash /dev/sdf1 on /media/Ext4Flash1 type ext4 (rw,nosuid,nodev,relatime,block_validity,delalloc,barrier,user_xattr,acl,uhelper=udisks2) Telcontar:~ # Telcontar:~ # umount /media/Ext4Flash1 Telcontar:~ # mount -v /dev/sdf1 /media/Ext4Flash mount: /dev/sdf1 mounted on /media/Ext4Flash. Telcontar:~ # l /media total 12 drwxr-xr-x 3 root root 4096 Mar 1 18:46 ./ drwxr-xr-x 38 root root 4096 Feb 4 13:44 ../ drwxr-xr-x 4 cer cer 4096 Jul 25 2017 Ext4Flash/ - -rw-r--r-- 1 root root 0 Jun 16 2013 not_mounted Telcontar:~ # See? the mount point permissions get changed the instant I mount something on it to those of the something. They override what the mountpoint has. Also, notice the date, here and on Ext4Flash1/ above. Now I umount: Telcontar:~ # l /media total 12 drwxr-xr-x 3 root root 4096 Mar 1 18:46 ./ drwxr-xr-x 38 root root 4096 Feb 4 13:44 ../ drwx------ 2 root root 4096 Mar 1 18:43 Ext4Flash/ - -rw-r--r-- 1 root root 0 Jun 16 2013 not_mounted Telcontar:~ # They recover their previous status. Even the date. I try to force an uid: Telcontar:~ # mount -v -o uid=2000 /dev/sdf1 /media/Ext4Flash mount: wrong fs type, bad option, bad superblock on /dev/sdf1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. Telcontar:~ # mount -v -o uid=1000 /dev/sdf1 /media/Ext4Flash mount: wrong fs type, bad option, bad superblock on /dev/sdf1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. Telcontar:~ # Lets see the log: Telcontar:~ # tail /var/log/messages <1.4> 2018-03-01 18:45:18 Telcontar org.gtk.vfs.UDisks2VolumeMonitor 5731 - - disc.c:424: error opening file BDMV/index.bdmv <1.4> 2018-03-01 18:45:18 Telcontar org.gtk.vfs.UDisks2VolumeMonitor 5731 - - disc.c:424: error opening file BDMV/BACKUP/index.bdmv <3.6> 2018-03-01 18:46:04 Telcontar smartd 1542 - - Device: /dev/sdc [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 105 to 107 <3.5> 2018-03-01 18:46:29 Telcontar udisksd 5297 - - Cleaning up mount point /media/Ext4Flash1 (device 8:81 is not mounted) <0.4> 2018-03-01 18:46:41 Telcontar kernel - - - [139827.580395] EXT4-fs (sdf1): warning: mounting unchecked fs, running e2fsck is recommended <0.6> 2018-03-01 18:46:41 Telcontar kernel - - - [139827.584482] EXT4-fs (sdf1): mounted filesystem without journal. Opts: (null) <1.4> 2018-03-01 18:46:41 Telcontar org.gtk.vfs.UDisks2VolumeMonitor 5731 - - disc.c:424: error opening file BDMV/index.bdmv <1.4> 2018-03-01 18:46:41 Telcontar org.gtk.vfs.UDisks2VolumeMonitor 5731 - - disc.c:424: error opening file BDMV/BACKUP/index.bdmv <0.3> 2018-03-01 18:48:33 Telcontar kernel - - - [139939.297469] EXT4-fs (sdf1): Unrecognized mount option "uid=2000" or missing value <0.3> 2018-03-01 18:48:39 Telcontar kernel - - - [139944.977119] EXT4-fs (sdf1): Unrecognized mount option "uid=1000" or missing value Telcontar:~ # Telcontar:~ # mount -v -o fmask=0117 /dev/sdf1 /media/Ext4Flash mount: wrong fs type, bad option, bad superblock on /dev/sdf1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. Telcontar:~ # <0.3> 2018-03-01 18:51:06 Telcontar kernel - - - [140092.124212] EXT4-fs (sdf1): Unrecognized mount option "fmask=0117" or missing value Lets say it again: no mount option will modify the mount permissions of the root directory of an ext4 filesystem. This is the intended behaviour. You can only change it by script that runs chmod on mount. It is possible that KDE has a format program that when it formats a stick as ext4 from the user, it sets appropriate permissions for that user. - -- Cheers, Carlos E. R. (from openSUSE 42.3 x86_64 "Malachite" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlqYQFIACgkQtTMYHG2NR9UwGgCfRFPi5+MaOxH9MegNdR6HtzU6 CkQAn3cnl3QSlf7H2H3IW8JXYFRnHyUl =/baR -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org