ownership of NTFS
-
- Warlord
- Posts: 622
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
ownership of NTFS
I've just realized that all (*) of my NTFS and FAT32 partitions are mounted under "guest" ownership (guest:root). Is it okay to change it to root, and where do I do it? I guess I should specify uid=value at mount as chown command has no effect.
(*) except one NTFS USB plugged in later which is mounted as root:root! So something else is probably going on. NTFS inherently doesn't carry any "guest" or "root" ownership, so it must be Porteus that (arbitrary?) decides the owner when mounting?
(*) except one NTFS USB plugged in later which is mounted as root:root! So something else is probably going on. NTFS inherently doesn't carry any "guest" or "root" ownership, so it must be Porteus that (arbitrary?) decides the owner when mounting?
- ncmprhnsbl
- DEV Team
- Posts: 3941
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
ownership of NTFS
good question. . it'd be somewhere between udisks and our /sbin/udev-fstab-update script, i think.
but as you say, any such ownership pretty meaningless
but as you say, any such ownership pretty meaningless
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
- babam
- Warlord
- Posts: 528
- Joined: 16 Nov 2016, 10:30
- Distribution: Porteus 5.0rc3 Xfce K6.1.1
- Location: Rainy city
ownership of NTFS
In my experience if ownership is root:root then "Move to trash" doesn't work.
NTFS3 is great, as is the linux filesystem that supports permissions, ownership and ACLs.
NTFS3 is great, as is the linux filesystem that supports permissions, ownership and ACLs.
Sorry, my English is bad.
- ncmprhnsbl
- DEV Team
- Posts: 3941
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
ownership of NTFS
ok, i see there's some inconsistency .. ntfs and vfat mounted at boot (covered by the finit script in initrd.xz) has a uid=1000 flag (i think this was done to accommodate trash usage) .. whereas udev-fstab-update doesn't.. hence the difference for mounts after boot..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
-
- Warlord
- Posts: 622
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
ownership of NTFS
ncmprhnsbl, indeed /sbin/udev-fstab-update applies different options:
resulting in:
partitions sda1, sda3, sda4, oddly sdb1, and sdb3 are mounted under ownership of guest:root.
I don't ever use guest, and yet it appears to be a rather special, privileged account on my system as whole (windows) partitions are owned by it. I wonder why, and what do I change to make mounted file systems owned by root:root (except /home/guest) -- when I log in as root at least?
But there is more.
All that was about mounting at boot. Now, if I hotplug an NTFS USB I get and e.g. /mnt/sdc1 above, it's mounted as root:root, by SpaceFM I guess, so it picked up the correct current user (root)?
Is it possible that mounting command during boot for windows partitions is executed on behalf of the guest user?! And I suspect we need to look into initrd (linuxrc and/or finit) and the fstab above is irrelevant (too late) during boot?
Code: Select all
[ $MOPT ] || MOPT="users,noatime,nodiratime,suid,dev,exec,async"
[ $NMOPT ] || NMOPT="noatime,nodiratime,group,nodev,exec,async"
Code: Select all
root@porteus:~# cat /etc/fstab
# Do not edit this file as fstab is recreated automatically during every boot.
# Please use /etc/rc.d/rc.local or sysvinit scripts if you want to mount/unmount
# drive, filesystem or network share.
# System mounts:
aufs / aufs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devtmpfs /dev devtmpfs defaults 0 0
devpts /dev/pts devpts rw,mode=0620,gid=5 0 0
# Device partitions:
# Hotplugged devices:
/dev/sda3 /mnt/sda3 ntfs-3g noatime,nodiratime,group,nodev,exec,async,comment=x-gvfs-show 0 0
/dev/sda1 /mnt/sda1 vfat users,noatime,nodiratime,suid,dev,exec,async,comment=x-gvfs-show,umask=0,check=s,utf8 0 0
/dev/sda4 /mnt/sda4 ntfs-3g noatime,nodiratime,group,nodev,exec,async,comment=x-gvfs-show 0 0
/dev/sdb1 /mnt/sdb1 vfat users,noatime,nodiratime,suid,dev,exec,async,comment=x-gvfs-show,umask=0,check=s,utf8 0 0
/dev/sdb3 /mnt/sdb3 ntfs-3g noatime,nodiratime,group,nodev,exec,async,comment=x-gvfs-show 0 0
/dev/sdb2 /mnt/sdb2 ext4 users,noatime,nodiratime,suid,dev,exec,async,comment=x-gvfs-show 0 0
/dev/sdc2 /mnt/sdc2 ext4 users,noatime,nodiratime,suid,dev,exec,async,comment=x-gvfs-show 0 0
/dev/sdc1 /mnt/sdc1 ntfs-3g noatime,nodiratime,group,nodev,exec,async,comment=x-gvfs-show 0 0
I don't ever use guest, and yet it appears to be a rather special, privileged account on my system as whole (windows) partitions are owned by it. I wonder why, and what do I change to make mounted file systems owned by root:root (except /home/guest) -- when I log in as root at least?
But there is more.
All that was about mounting at boot. Now, if I hotplug an NTFS USB I get and e.g. /mnt/sdc1 above, it's mounted as root:root, by SpaceFM I guess, so it picked up the correct current user (root)?
Is it possible that mounting command during boot for windows partitions is executed on behalf of the guest user?! And I suspect we need to look into initrd (linuxrc and/or finit) and the fstab above is irrelevant (too late) during boot?
- ncmprhnsbl
- DEV Team
- Posts: 3941
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
ownership of NTFS
to summarize:rych wrote: ↑30 Oct 2022, 13:56All that was about mounting at boot. Now, if I hotplug an NTFS USB I get and e.g. /mnt/sdc1 above, it's mounted as root:root, by SpaceFM I guess, so it picked up the correct current user (root)?
Is it possible that mounting command during boot for windows partitions is executed on behalf of the guest user?! And I suspect we need to look into initrd (linuxrc and/or finit) and the fstab above is irrelevant (too late) during boot?
vfat and ntfs mounted at boot are mounted guest:root (defined by finit using uid=1000 (1000=guest)) (needed for guest trash users)
vfat and ntfs mounted after boot are mounted root:root (defined by udev-fstab-update)
probably the solution will be to make the finit uid=1000 conditional, checking for login=root cheatcode and using uid=0 in that case (or leaving it out altogether)
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
-
- Warlord
- Posts: 622
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
ownership of NTFS
Thanks for your attention to this rather academic* issue. I guess initrd doesn't know who's going to login and assumes the most democratic choice: guest. But then, if it really doesn't matter* it could as well mount those under root:root.ncmprhnsbl wrote: ↑31 Oct 2022, 01:10probably the solution will be to make the finit uid=1000 conditional, checking for login=root
(*) One scenario where it could matter, one of my syncing solutions may be considering files with different ownership as different files. I'm tracking down that issue and hope to solve it there without digging into initrd. Hope it never matters who owns what as long as root has all permissions it needs?
Last edited by rych on 31 Oct 2022, 08:07, edited 1 time in total.
- Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
ownership of NTFS
I don't understand the problem of drives mounted as guest when you login in as root. Root has access to all drives. If the drives are mounted as root, a guest login would not be able to access them and most users log in as guest.
Ed
-
- Warlord
- Posts: 622
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
ownership of NTFS
Indeed finit inside initrd mounts ntfs and vfat with uid=1000. What are the ways to confirm this a posteriori, I've found one:
Suppose I wanted to modify initrd how would I unpack and pack it back? Are the old instructions in Re: Fixed mount paths for other partitions than root (Post by Gele #27281) still valid?
Also, how would I check for the presence of login=root cheatcode?
Code: Select all
root@porteus:~# pgrep -a ntfs-3g
233 ntfs-3g /dev/nvme0n1p3 /mnt/nvme0n1p3 -o noatime,nodiratime,suid,dev,exec,async,uid=1000,big_writes
256 ntfs-3g /dev/sda3 /mnt/sda3 -o noatime,nodiratime,suid,dev,exec,async,uid=1000,big_writes
Also, how would I check for the presence of login=root cheatcode?
Last edited by rych on 01 Nov 2022, 08:12, edited 1 time in total.
- ncmprhnsbl
- DEV Team
- Posts: 3941
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
ownership of NTFS
looks okay
there's the function in finit (although it's defined at the end, so might not work in finit? i forget how bash functions are parsed)
Code: Select all
# Check for a boot param
chk_bootcfg(){ grep "^$1" /union/etc/bootcmd.cfg; }
so
chk_bootcfg login=root
Code: Select all
grep "^login=root" /union/etc/bootcmd.cfg
Code: Select all
grep "^login=root" /proc/cmdline
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44