2

On my system, I have a large NTFS-formatted data partition, which is shared between Linux (Debian 8) and Windows (2012 Server). When I created a user-mapping file, as described in the NTFS-3G documentation, most file permissions worked as expected, only any new files created by me on Linux on the NTFS partition are owned by root and uneditable by my normal user account:

$ pwd
/mnt/data/src
$ ls -l 
total 0
$ touch file
touch: setting times of ‘file’: Permission denied
$ ls -l
total 0
-rw-r--r-- 1 root root 0 Apr 28 10:41 file
$ ls -ld .
drwxr-xr-x 1 ##### root 144 Apr 28 10:41 .
$ id
uid=1000(#####) gid=1(daemon) groups=1(daemon),4(adm),20(dialout),21(fax),24(cdrom),25(floppy),26(tape),27(sudo),29(audio),30(dip),44(video),46(plugdev),108(netdev),110(lpadmin),113(scanner)

How should I set it that files are created as normally, with ownership set to my unprivileged user account? I tried setting the inherit mount option, but then I ran into another problem, namely that I couldn't write into root-owned directories and neither chmod or chown as root had any effect at all

Relevant files:

$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdf1 during installation
UUID=eab88331-a1c7-4f18-b971-ad5f58c6d08c /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sde2 during installation
UUID=188C-66A1  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sdf2 during installation
UUID=1d82108c-20bb-4df2-8df4-2ca145cca01f /home           ext4    defaults        0       2
# swap was on /dev/sdf5 during installation
UUID=8e94b87a-e170-4a34-88fe-2100e8db0ae6 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0

UUID=592AF2FB029E1E67 /mnt/data ntfs-3g

.

$ sudo cat /mnt/data/.NTFS-3G/UserMapping
[sudo] password for #####: 
# Generated by usermap for Linux, v 1.1.6
:#####:S-1-5-21-742487409-2243251135-2122958030-513
:#####:S-1-5-21-1202660629-1788223648-1801674531-513
:#####:S-1-5-21-343818398-1004336348-725345543-513
:#####:S-1-5-21-1801674531-1614895754-1417001333-513
:#####:S-1-5-21-117609710-2025429265-839522115-513
#####:#####:S-1-5-21-742487409-2243251135-2122958030-1003
#####:#####:S-1-5-21-1202660629-1788223648-1801674531-1004
#####:#####:S-1-5-21-343818398-1004336348-725345543-1004
#####:#####:S-1-5-21-1801674531-1614895754-1417001333-1004
#####:#####:S-1-5-21-117609710-2025429265-839522115-1004
#####:#####:S-1-5-21-117609710-2025429265-839522115-1005
1

We just ran into this issue on my girlfriend's computer, though we went in with some more information: my user on the same machine could create files without issue.

After trying more than a few things we finally figured out what was wrong on her machine; her primary group was set to sudo, where mine was set to users

$ id y

uid=1001(y) gid=100(users)

groups=100(users),7(lp),91(video),92(audio),1000(sudo)

$ id x

uid=1000(x) gid=1000(sudo)

groups=1000(sudo),7(lp),91(video),92(audio),100(users)

We followed the instructions here to change her default group to users unmounted the drive, logged out, logged back in, remounted the drive and everything started behaving correctly.

0

I think you need to mount your data partition with the permissions option. Then you can change the owner of your files.

However, I think new files will not be mapped to the Windows user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.