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
~ $
mount
, and post the output from that. Also, please verify that, on the other devices, you (as a non-root user) can create new files in directories that are owned byroot
and are mode 755 (rwxr-xr-x
).