You are not logged in.

#1 2023-10-28 03:32:23

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Permission denied when moving a folder from a ntfs flash drive

Hello

I'm facing this issue on two computers running Arch.
I mount ntfs partitions with ntfs3 driver on my systems. When I try to move a folder from a ntfs flash drive, I get permission denied (no problem when copying). However, I can move a folder if the flash drive is formatted with fat32 or exfat file systems.

How can I fix the permissions when using ntfs3?

Thanks.

Last edited by Strangiato (2023-10-28 12:14:12)

Offline

#2 2023-10-28 06:33:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,073

Re: Permission denied when moving a folder from a ntfs flash drive

By mounting it w/ appropriate UID/GID - unless it's mouted ro for some reason.

And inb4:
Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
http://www.catb.org/~esr/faqs/smart-questions.html

mount

Offline

#3 2023-10-28 11:41:43

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Permission denied when moving a folder from a ntfs flash drive

$ mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=4006408k,nr_inodes=1001602,mode=755,inode64)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755,inode64)
/dev/sda1 on / type ext4 (rw,relatime,discard)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=15570)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,nosuid,nodev,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,size=4017136k,nr_inodes=1048576,inode64)
/dev/sda1 on /var/lib/snapd/snap type ext4 (rw,relatime,discard)
/var/lib/snapd/snaps/core20_1581.snap on /var/lib/snapd/snap/core20/1581 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/core20_1581.snap on /var/lib/snapd/snap/core20/1581 type squashfs (ro,nodev,relatime,errors=continue,threads=single)
/var/lib/snapd/snaps/core20_1587.snap on /var/lib/snapd/snap/core20/1587 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/core20_1587.snap on /var/lib/snapd/snap/core20/1587 type squashfs (ro,nodev,relatime,errors=continue,threads=single)
/var/lib/snapd/snaps/snapd_15534.snap on /var/lib/snapd/snap/snapd/15534 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/snapd_15534.snap on /var/lib/snapd/snap/snapd/15534 type squashfs (ro,nodev,relatime,errors=continue,threads=single)
/var/lib/snapd/snaps/snapd_16292.snap on /var/lib/snapd/snap/snapd/16292 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/snapd_16292.snap on /var/lib/snapd/snap/snapd/16292 type squashfs (ro,nodev,relatime,errors=continue,threads=single)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
/dev/sda2 on /mnt/NEON type ext4 (rw,nosuid,nodev,relatime,x-gvfs-show)
/dev/sda3 on /mnt/DADOS type ntfs3 (rw,nosuid,nodev,noexec,relatime,uid=1000,gid=0,iocharset=utf8,user,x-gvfs-show)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=803424k,nr_inodes=200856,mode=700,uid=1000,gid=1000,inode64)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/sdb1 on /run/media/stalker/6290E7032CFA46F0 type ntfs3 (rw,nosuid,nodev,relatime,uid=1000,gid=1000,iocharset=utf8,uhelper=udisks2)

Offline

#4 2023-10-28 11:58:54

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,073

Re: Permission denied when moving a folder from a ntfs flash drive

/dev/sda3 on /mnt/DADOS type ntfs3 (rw,nosuid,nodev,noexec,relatime,uid=1000,gid=0,iocharset=utf8,user,x-gvfs-show)
/dev/sdb1 on /run/media/stalker/6290E7032CFA46F0 type ntfs3 (rw,nosuid,nodev,relatime,uid=1000,gid=1000,iocharset=utf8,uhelper=udisks2)

Both are mounted RW for UID 1000 so you might want to elaborate on the actual error you get.

Offline

#5 2023-10-28 12:11:42

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Permission denied when moving a folder from a ntfs flash drive

I get this error with Nautilus file manager.

b2fydz7.png

Offline

#6 2023-10-28 12:16:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,073

Re: Permission denied when moving a folder from a ntfs flash drive

stat /run/media/stalker/6290E7032CFA46F0/teste/appstyle.webm
getfactl /run/media/stalker/6290E7032CFA46F0/teste/appstyle.webm

Offline

#7 2023-10-28 12:20:17

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Permission denied when moving a folder from a ntfs flash drive

$ stat /run/media/stalker/6290E7032CFA46F0/teste/appstyle.webm
  File: /run/media/stalker/6290E7032CFA46F0/teste/appstyle.webm
  Size: 1987783   	Blocks: 3888       IO Block: 4096   regular file
Device: 8,17	Inode: 28          Links: 1
Access: (0666/-rw-rw-rw-)  Uid: ( 1003/ UNKNOWN)   Gid: (  996/    utmp)
Access: 2023-10-27 23:49:48.951025500 -0300
Modify: 2022-02-14 17:06:58.636000000 -0300
Change: 2023-10-27 23:49:48.887691700 -0300
 Birth: 2023-10-27 23:49:48.871024900 -0300
$ stat getfactl /run/media/stalker/6290E7032CFA46F0/teste/appstyle.webm
stat: cannot statx 'getfactl': No such file or directory
  File: /run/media/stalker/6290E7032CFA46F0/teste/appstyle.webm
  Size: 1987783   	Blocks: 3888       IO Block: 4096   regular file
Device: 8,17	Inode: 28          Links: 1
Access: (0666/-rw-rw-rw-)  Uid: ( 1003/ UNKNOWN)   Gid: (  996/    utmp)
Access: 2023-10-27 23:49:48.951025500 -0300
Modify: 2022-02-14 17:06:58.636000000 -0300
Change: 2023-10-27 23:49:48.887691700 -0300
 Birth: 2023-10-27 23:49:48.871024900 -0300

Offline

#8 2023-10-28 12:27:51

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,073

Re: Permission denied when moving a folder from a ntfs flash drive

Not "stat getfactl", just "getfacl" (I typo'd a "t" in there…)
However, the file belongs to 1003:996

stat /run/media/stalker/6290E7032CFA46F0/teste

Offline

#9 2023-10-28 12:34:07

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Permission denied when moving a folder from a ntfs flash drive

$ stat getfacl /run/media/stalker/6290E7032CFA46F0/teste/appstyle.webm
stat: cannot statx 'getfacl': No such file or directory
  File: /run/media/stalker/6290E7032CFA46F0/teste/appstyle.webm
  Size: 1987783   	Blocks: 3888       IO Block: 4096   regular file
Device: 8,17	Inode: 28          Links: 1
Access: (0666/-rw-rw-rw-)  Uid: ( 1003/ UNKNOWN)   Gid: (  996/    utmp)
Access: 2023-10-27 23:49:48.951025500 -0300
Modify: 2022-02-14 17:06:58.636000000 -0300
Change: 2023-10-27 23:49:48.887691700 -0300
 Birth: 2023-10-27 23:49:48.871024900 -0300
$ stat /run/media/stalker/6290E7032CFA46F0/teste
  File: /run/media/stalker/6290E7032CFA46F0/teste
  Size: 0         	Blocks: 0          IO Block: 4096   directory
Device: 8,17	Inode: 27          Links: 1
Access: (0775/drwxrwxr-x)  Uid: ( 1003/ UNKNOWN)   Gid: ( 1003/ UNKNOWN)
Access: 2023-10-27 23:49:45.671000300 -0300
Modify: 2023-10-27 23:49:48.904358500 -0300
Change: 2023-10-27 23:49:48.904358500 -0300
 Birth: 2023-10-27 23:49:45.671000300 -0300

Offline

#10 2023-10-28 13:40:42

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,073

Re: Permission denied when moving a folder from a ntfs flash drive

stat: cannot statx 'getfacl

wtf is wrong with you?

The directory belongs to 1003:1003 and there're no global write permissions so you can't delete files inside - this has nothing to do w/ ntfs.

Offline

#11 2023-10-28 13:49:24

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Permission denied when moving a folder from a ntfs flash drive

seth wrote:

stat: cannot statx 'getfacl

The directory belongs to 1003:1003 and there're no global write permissions so you can't delete files inside - this has nothing to do w/ ntfs.

Then I do not understand why I'm able to move the same folder when the flash drive is formatted with fat32 or exfat.

Offline

#12 2023-10-28 13:55:10

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,073

Re: Permission denied when moving a folder from a ntfs flash drive

Because FAT has no permission/rights management like pretty much every posix system and ntfs.
Every file or directory will be equipped w/ the exact same permissions on FAT - it's not a FileSystem but a FileAllocationTable

Offline

#13 2023-10-28 14:14:09

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Permission denied when moving a folder from a ntfs flash drive

Thanks for clarifying, seth.

I need to change the permissions manually every time I want to move a folder from a ntfs flash drive then?
If I'm not mistaken, this permission issue never occured on my systems when using the ntfs-3g driver.
But I prefer ntfs3 due to the bad performance of ntfs-3g.

Offline

#14 2023-10-28 14:30:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,073

Re: Permission denied when moving a folder from a ntfs flash drive

https://man.archlinux.org/man/ntfs-3g.8 … d_Security
ntfs-3g supports proper permissions, but doesn't default to it - I don't see such option for ntfs3, https://docs.kernel.org/filesystems/ntfs3.html

The original problem is that the paths in question were created by/for some UID 1003 where yours is 1000 (by the mount UID/GID), most likely on a different system.
You could align those UIDs

Offline

#15 2023-10-28 14:58:55

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Permission denied when moving a folder from a ntfs flash drive

Yes, I copied the folder to the ntfs flash drive using Arch installed on my desktop computer, then I tried to move the copied folder to the Home of Arch installed on my laptop. The id of my user on the desktop computer is 1003, and 1000 on the laptop.

Offline

Board footer

Powered by FluxBB