Skip to main content
Topic: non-standard partition set ups (Read 585 times) previous topic - next topic
0 Members and 4 Guests are viewing this topic.

non-standard partition set ups

Is it possible to set up

/home/ruben/images - for example

as a separate partition?  As far as I am reading, anything in fstab gets changed to root.root ownership on automatic mounting.
That would kill the ownership for the  directory within home.

Is it possible to make an /etc/fstab entry which the ownership being other than root?

Or even a home directory /home/ruben

even if I set up fstab rw I still can't remove or add a file without the execute bit turned on... which is a bummer for a home directory.

Re: non-standard partition set ups

Reply #1
AFAIK you just need to change ownership of mountpoint before mounting.

Re: non-standard partition set ups

Reply #2
AFAIK you just need to change ownership of mountpoint before mounting.

on mounting it converts to root

Code: [Select]
flatbush:[ruben]:~$ ls -al|grep mnt
drwxr-xr-x    2 ruben ruben           6 Feb  1 02:32 mnt

Code: [Select]
grep mnt /etc/fstab

UUID=e07bed3b-dd06-4bda-98d3-2b31a866093f /home/ruben/mnt       xfs     user,rw,exec,noauto

Code: [Select]
flatbush:[ruben]:~$ mount /home/ruben/mnt
flatbush:[ruben]:~$ ls -al|grep mnt
drwxr-xr-x  135 ruben root        20480 Feb  1 03:19 mnt

actually that seems too be working

Re: non-standard partition set ups

Reply #3
It certainly works in my case.
Code: [Select]
└─➤ grep "1500" /etc/fstab
UUID=esfgsgssd-dsfsa-s5gsg-345-fdg346hfglo8 /media/1500 ext4 nofail,nodev,nosuid,relatime,user_xattr,acl 0 2

└─➤ ls /media | grep "1500"
drwxr-xr-x  2 ambie   ambie 4,0K may  1  2023 1500/

openrc.

Re: non-standard partition set ups

Reply #4
It certainly works in my case.
Code: [Select]
└─➤ grep "1500" /etc/fstab
UUID=esfgsgssd-dsfsa-s5gsg-345-fdg346hfglo8 /media/1500 ext4 nofail,nodev,nosuid,relatime,user_xattr,acl 0 2

└─➤ ls /media | grep "1500"
drwxr-xr-x  2 ambie   ambie 4,0K may  1  2023 1500/

openrc.

no it is doing something weird.  FWIW what is acl?


Re: non-standard partition set ups

Reply #6
Code: [Select]
flatbush:[ruben]:~$ grep mnt /etc/fstab 
UUID=e07bed3b-dd06-4bda-98d3-2b31a866093f /home/ruben/mnt       xfs     user,rw,exec,noauto
UUID=ba67ca27-1557-46b2-867f-660bd8579a3a /home/ruben/mnt2      ext4    user,rw,exec,noauto
UUID=1c2481db-93c1-4021-84c1-dafb2670efcb /home/ruben/mnt3      xfs     user,rw,exec,noauto
UUID=7f87608b-b782-4b39-89c4-ca8353de7134 /home/ruben/mnt5      xfs     user,rw,exec,noauto

They look identical to me accept for the file systems

File system permissions prior to mounting

Code: [Select]
drwxr-xr-x  135 ruben ruben       20480 Feb  1 03:19 mnt
drwxr-xr-x    2 ruben ruben           6 Jun 26  2016 mnt2
drwxr-xr-x    2 ruben ruben           6 Mar  8  2022 mnt3
drwxrwxrwx    1 ruben daemon      20480 Jan 20 22:46 mnt4
drwxr-xr-x    2 ruben ruben           6 Jun  9  2017 mnt5
drwxrwxrwx    2 ruben ruben           6 Sep 23  2018 mnt6
drwxrwxrwx    2 ruben ruben           6 Sep 23  2018 mnt7
drwxrwxrwx    2 ruben ruben          72 Feb 23  2020 mnt_fathom
drwxrwxrwx    2 ruben ruben           6 Sep  3  2017 mnt_flash
drwxrwxrwx    2 ruben ruben           6 May 14  2021 mnt_oyen
drwxr-xr-x    2 ruben ruben           6 Mar 27  2022 mnt_oyen2

mounting

Code: [Select]
flatbush:[ruben]:~$ mount mnt
flatbush:[ruben]:~$ mount mnt2
flatbush:[ruben]:~$ mount mnt3
flatbush:[ruben]:~$ mount mnt5
flatbush:[ruben]:~$ mount mnt6
mount: /home/ruben/mnt6: can't find in /etc/fstab.

They ALL did different things

Code: [Select]
flatbush:[ruben]:~$ ls -al /home/ruben/|grep mnt
drwxr-xr-x  135 ruben ruben       20480 Feb  1 03:19 mnt
drwxrwxrwx    5 ruben    100       4096 Jan 26  2018 mnt2
drwxr-xr-x   17 root  root          245 Mar 23  2022 mnt3
drwxrwxrwx    1 ruben daemon      20480 Jan 20 22:46 mnt4
drwxr-xr-x   16 root  root          211 Feb  1 01:41 mnt5

FWIW mnt4 is mounts with sshfs and not in /etc/fstab

mnt3 is a complete mystery but was the default behavior I saw last night for all of them


Re: non-standard partition set ups

Reply #7
Well, your permissions and ownership of actual roots of mounted filesystems should be in agreement with mountpoint. Actually, from ’man mount’: The previous contents (if any) and owner and mode of dir become invisible, and as long as this filesystem remains mounted, the pathname dir refers to the root of the filesystem on device.

Re: non-standard partition set ups

Reply #8
FWIW what is acl?
Enable POSIX Access Control Lists. See the acl(5) manual page.

I can read the man page.  Unfortunately, like many of these man pages, it can only be understood by the programmer who wrote it.

Quote

ACL ENTRIES
       An ACL consists of a set of ACL entries. An ACL entry specifies the access permissions on the associated object for an in‐
       dividual user or a group of users as a combination of read, write and search/execute permissions.

       An ACL entry contains an entry tag type, an optional entry tag qualifier, and a set of permissions.  We use the term qual‐
       ifier to denote the entry tag qualifier of an ACL entry.

       The  qualifier  denotes  the identifier of a user or a group, for entries with tag types of ACL_USER or ACL_GROUP, respec‐
       tively. Entries with tag types other than ACL_USER or ACL_GROUP have no defined qualifiers.


this badly needs an edit because it is not comprehensible without a blackboard, and some chalk, and some footnotes.

Re: non-standard partition set ups

Reply #9
Well, your permissions and ownership of actual roots of mounted filesystems should be in agreement with mountpoint. Actually, from ’man mount’: The previous contents (if any) and owner and mode of dir become invisible, and as long as this filesystem remains mounted, the pathname dir refers to the root of the filesystem on device.

mnt3 and mnt5 where changed upon being used as mount points from ruben.ruben to root.root by the system/command .. and I don't know why.

If I chown ruben:ruben them WHILE MOUNTED, and then umount them and mount them, the system seems to remember that previous setting and remounts with the permissions as they were set after mount, to ruben:ruben.  I don't know why or where it is storing that information, nor do I know that it will do that when I reboot the system.
I don't see this behavior documented either.

Re: non-standard partition set ups

Reply #10
If you don't know what acl is - most probably you don't need it.

When you change ownership of mountpoint when filesystem is mounted then you are changing ownership of root directory of actual filesystem.

Re: non-standard partition set ups

Reply #11
If you don't know what acl is - most probably you don't need it.

When you change ownership of mountpoint when filesystem is mounted then you are changing ownership of root directory of actual filesystem.

either I am not understanding you, or it is not accurate as you can see in the above post.

Before mounting, those mount  point directories were ruben:ruben and then changed to root:root on mounting the partition.

But the underline filesystem entries never changed to anything else. They seem to remain ruben.ruben .

Those permissions seemed to be just ignored once the partition is mounted and then you see it  as root.root (like a stack).   The ownership after mounting the partition changes to  root:root  for the mounted partition.  It doesn't seem, however, to  do anything  the underlining file system.  It mounts and turns root.root.  umount and it is still ruben.ruben.  mount and it turns back to root.root again.  Now once one runs chown on the mounted partition,   chown to ruben:ruben,  now the mounted directory  is transformed from the mount point owned root.root to ruben.ruben (now in agreement with the underlining file system of the mount point).

 Now umount and mount again and the system remounts it with ruben.ruben ownership instead of the expected root.root. It became a permanent change and there is no need to re chown it again.


 

Re: non-standard partition set ups

Reply #12
My first suggestion was wrong I guess. The ownership of mountpoint directory is really doesn't matter since it replaces with ownership of mounted filesystem. 'man mount' rules,