Ntfs linux permission denied

Linux cp Permission denied on ntfs file system

Could someone kindly explain why I get this Permission Denied error? I personally am user g and as ls shows I have read and write permission for both source and destination. My system is slackware 14, and the device being written to is my ereader, an ntfs-3g file system . I have other ntfs file systems, thumb drives, external HDDs etc to which I can write to as user. There is no perceptible difference in the permissions setup for any of them. Being ntfs, all of them are owned by root of group root. It is only with this ereader that I have this problem (though I can write to it as root). So I believe the problem is specific to this device, but I have no clue what it might be.

~ $ cp /home/g/MyBooks/Wyndham-TheMidwichCuckoos.txt /500gb/database/media/ cp: cannot create regular file '/500gb/database/media/Wyndham-TheMidwichCuckoos.txt': Permission denied ~ $ ls -l /home/g/MyBooks/Wyndham-TheMidwichCuckoos.txt -rw-r--r-- 1 g users 380183 Aug 10 11:04 /home/g/MyBooks/Wyndham-TheMidwichCuckoos.txt ~ $ ls -l /500gb/database/ total 32 drwxr-xr-x 2 root root 8192 Aug 10 11:23 cache/ drwxr-xr-x 3 root root 8192 Aug 5 13:26 layout/ drwxr-xr-x 2 root root 8192 Aug 9 14:07 media/ drwxr-xr-x 2 root root 8192 Aug 5 17:28 sync/ ~ $ 

The ereader is fat32, I had assumed it to be ntfs,
~ $ mount
/dev/sda3 on / type ext2 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
/dev/sda4 on /home type ext2 (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /winxp type fuseblk (rw,allow_other,blksize=4096,default_permissions)
/dev/sdb on /500gb type vfat (rw)
/dev/sdd1 on /3tb type fuseblk (rw,allow_other,blksize=4096)
~ $ cp /home/g/MyBooks/Wyndham-TheMidwichCuckoos.txt /3tb
~ $ cp /home/g/MyBooks/Wyndham-TheMidwichCuckoos.txt /500gb
cp: cannot create regular file ‘/500gb/Wyndham-TheMidwichCuckoos.txt’: Permission denied
~ $ I am not able to change the permissions on this ereader, neither as root, nor as user
As root, it appears to work, but nothing changes
/home/g # chmod 777 -R /500gb/database
/home/g # ls -l /500gb/database
total 32
drwxr-xr-x 2 root root 8192 Aug 10 11:23 cache
drwxr-xr-x 3 root root 8192 Aug 5 13:26 layout
drwxr-xr-x 2 root root 8192 Aug 9 14:07 media
drwxr-xr-x 2 root root 8192 Aug 5 17:28 sync As user, the chmod is rejected thus
~ $ chmod 777 -R /500gb/database
chmod: changing permissions of ‘/500gb/database’: Operation not permitted
chmod: changing permissions of ‘/500gb/database/cache’: Operation not permitted
chmod: changing permissions of ‘/500gb/database/cache/cacheExt.xml’: Operation not permitted
chmod: changing permissions of ‘/500gb/database/cache/media.xml’: Operation not permitted
chmod: changing permissions of ‘/500gb/database/cache/cacheExtSchema_1.1.xsb’: Operation not permitted
chmod: changing permissions of ‘/500gb/database/media’: Operation not permitted
chmod: changing permissions of ‘/500gb/database/media/Stevenson-TreasureIsland.txt’: Operation not permitted
chmod: changing permissions of ‘/500gb/database/media/Rendell-WolftotheSlaughter.txt’: Operation not permitted This process did the trick for me, thanks to Miroslav Koskar
/home/g # mount | grep sdb
/home/g # mount /dev/sdb -o uid=1000,gid=100 /500gb
/home/g # mount | grep sdb
/dev/sdb on /500gb type vfat (rw,uid=1000,gid=100)
/home/g # ls -l /500gb/database
total 32
drwxr-xr-x 2 g users 8192 Aug 10 11:23 cache
drwxr-xr-x 3 g users 8192 Aug 5 13:26 layout
drwxr-xr-x 2 g users 8192 Aug 10 12:51 media
drwxr-xr-x 2 g users 8192 Aug 5 17:28 sync
/home/g #
~ $ cp /home/g/MyBooks/Wyndham-TheMidwichCuckoos.txt /500gb/database/media
~ $

Читайте также:  Linux автозагрузка системы добавить

Источник

Permission denied when writing on NTFS mount, even as root

To create an offsite backup, I plugged an external hard drive via USB to my home NAS server. The external hdd has one partition and is formatted with NTFS (to allow create some backups from Windows hosts, too).

I mounted the partition to /mnt2 and wanted to sync the data from NAS, but it failed:

# rsync -rtuP /mnt/data/Movies/ /mnt2/Movies/
sending incremental file list
Test1.mp4
1,956,669,762 100% 108.73MB/s 0:00:17 (xfr#1, to-chk=1040/1042)
Test2.mp4
436,338,688 20% 104.03MB/s 0:00:16 ^C
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(638) [sender=3.1.1]
rsync: mkstemp «/mnt2/Movies/.Test1.mp4.mwuEtR» failed: Permission denied (13)
rsync: mkstemp «/mnt2/Movies/.Test2.mp4.ialsVx» failed: Permission denied (13)
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at io.c(504) [generator=3.1.1]

Permissions were correct, at least that root was able to write:

# ls -l /mnt2
total 20M
drwx—— 1 root root 0 Jan 2 2018 Family
drwsr-sr-x 1 root root 232K Oct 14 20:00 Movies
drwx—— 1 root root 24K Dec 30 2017 Movies-Kids
drwx—— 1 root root 0 May 6 2017 Pictures

But when I tried to manually create a file, permission denied again:

# touch /mnt2/bla
touch: cannot touch ‘bla’: Permission denied

I checked dmesg and saw the following:

[12867539.697380] ntfs: (device sde1): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring.
[12867539.697386] ntfs: (device sde1): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring.
[12867539.697392] ntfs: (device sde1): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring.

I checked how the partition was mounted:

# mount | grep sde1
/dev/sde1 on /mnt2 type ntfs (rw,relatime,uid=0,gid=0,fmask=0177,dmask=077,nls=utf8,errors=continue,mft_zone_multiplier=1)

«rw is there so it should work», would be my first guess. But I remembered that NTFS mounts are a little bit special on Linux.

In order to «really» mount a NTFS drive and write on it, one needs the ntfs-3g package, which uses fuse in the background.
Note: I wrote a similar article but for MAC OS X back in 2011: How to read and write an NTFS external disk on a MAC OS X.

I installed the package which installed fuse as a dependency:

Читайте также:  Системный киоск astra linux

# apt-get install ntfs-3g
Reading package lists. Done
Building dependency tree
Reading state information. Done
The following extra packages will be installed:
fuse
The following NEW packages will be installed:
fuse ntfs-3g

Now I just needed to unmount the external hdd and mount it with ntfs-3g:

# mount -t ntfs-3g /dev/sde1 /mnt2

Checking mount again, the partition is now mounted as type fuseblk:

# mount | grep sde1
/dev/sde1 on /mnt2 type fuseblk (rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

And voilà, I can now write to the NTFS partition:

# touch /mnt2/bla && stat /mnt2/bla
File: ‘/mnt2/bla’
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 841h/2113d Inode: 16406 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2018-10-18 20:29:45.914775500 +0200
Modify: 2018-10-18 20:29:45.914775500 +0200
Change: 2018-10-18 20:29:45.914775500 +0200
Birth: —

Add a comment

Comments (newest first)

Bukowa from wrote on Oct 28th, 2022:

Источник

Permission denied on mounted devices

I have checked many similar questions but the solutions didn’t work for me. On my previous Debian wheezy installation I could mount devices from GUI with no permission problem and also after upgrading to jessie. But on my new Debian jessie installation devices mount in a read-only state whether ntfs partitions on the same HDD as my Debian installation or external USB devices, for both root user and normal user, I can’t write and modify data on mounted devices. I have found these lines in syslog that seems to be related.

udisksd[1281]: Mounted /dev/sda4 at /media// on behalf of uid 1000 udisksd[1281]: Cleaning up mount point /media// (device 8:4 is not mounted) udisksd[1281]: Unmounted /dev/sda4 on behalf of uid 1000 kernel: [ 125.190099] ntfs: volume version 3.1. udisksd[1281]: Mounted /dev/sda4 at /media// on behalf of uid 1000 org.gtk.Private.UDisks2VolumeMonitor[1224]: index_parse.c:191: indx_parse(): error opening /media///BDMV/index.bdmv org.gtk.Private.UDisks2VolumeMonitor[1224]: index_parse.c:191: indx_parse(): error opening /media///BDMV/BACKUP/index.bdmv org.gnome.Nautilus[1224]: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged. kernel: [ 137.739543] ntfs: (device sda4): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring. kernel: [ 137.739579] ntfs: (device sda4): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring. kernel: [ 137.739655] ntfs: (device sda4): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring. kernel: [ 137.739678] ntfs: (device sda4): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring. kernel: [ 137.739702] ntfs: (device sda4): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring. kernel: [ 137.739767] ntfs: (device sda4): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring. kernel: [ 137.739791] ntfs: (device sda4): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring. kernel: [ 137.739814] ntfs: (device sda4): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring. kernel: [ 137.739894] ntfs: (device sda4): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring. kernel: [ 137.739921] ntfs: (device sda4): ntfs_setattr(): Changes in user/group/mode are not supported yet, ignoring. 

I’m trying to figure out what makes the difference between two installations. In my new installation, unlike the previous one, I didn’t install gnome task completely but only the minimal gnome packages. And the other difference is that the first time I created a fresh partition table and formatted all the partitions, ext4 and ntfs, then installed windows and then Debian, but second time I used the same partition table and only formatted ext4 partitions. Both times dual-boot with windows. The output of cat /etc/mtab for two internal and external mounted devices reads as follows:

/dev/sdb1 /media// ntfs rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0177,dmask=077,nls=utf8,errors=continue,mft_zone_multiplier=1 0 0 /dev/sda4 /media// ntfs rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0177,dmask=077,nls=utf8,errors=continue,mft_zone_multiplier=1 0 0 

Источник

Читайте также:  Oracle linux network interface

bash: ./configure: Permission denied on NTFS partition [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.

At first I want to apologize for my poor english. Is there any way to use bash-scripts like configure on NTFS partitions? Today I reinstalled my dualboot-system (win7 & mint 13), because my old sys-partitions were to big and I wasted to much space, so I decided today to format disk, with two small sys-partitions and two bigger data partitions. (40G[NTFS] for Win, 40G for Mint (35G[Ext4] + 5G Swap), 2* ~200G[NTFS]). Ok I guess that’S enough for the preface. So here comes my prob: So I loaded the wine-git repo and stored it onto one of my data-partitions. So here comes my first prob, couldn’t run ./configure because there weren’t any execute permissions for that file (I already solved the prob for setting the file permissions, with usermapping to use the ntfs acl). So after setting the execute permissions I’m still not able to run ./configure, I just get the error msg: bash: ./configure: Permission denied (Just for record, Ya I try to run it as root). So, does anybody know how I can run a configure script on a NFTS-Partition?

Источник

Оцените статью
Adblock
detector