1

I have a NTFS format hard disk connected by usb to router livebox,

I have a raspberry pi with Raspbian installed.

I try to mount a folder from HD to folder inside raspberry pi

create local folder in user home /home/pi

mkdir mySharedFolder

drwxr-xr-x 2 pi   pi   4096 Oct 31 17:10 mySharedFolder

mount the folder

sudo mount -t cifs -o vers=1.0,_netdev,username=pi,password=mypassword,uid=1000,gid=1000,file_mode=0777,dir_mode=0777 //192.168.1.1/discosUSB/WDElements_10B8/Elements/hdFolder /home/pi/mySharedFolder

ls -la
drwxrwxrwx 2 pi   pi      0 Oct 31 17:20 mySharedFolder

It mounts correctly because I can see the files and directories

ls -la mySharedFolder/

-rwxrwxrwx 1 pi pi    5 Oct 31 17:17 file.txt
drwxrwxrwx 2 pi pi    0 Oct 31 17:18 folder1

df -h
Filesystem                                                 Size  Used Avail Use% Mounted on
/dev/root                                                   14G  1.4G   12G  11% /
devtmpfs                                                   213M     0  213M   0% /dev
tmpfs                                                      217M  3.1M  214M   2% /run
tmpfs                                                      217M     0  217M   0% /sys/fs/cgroup
tmpfs                                                       44M     0   44M   0% /run/user/1000
//192.168.1.1/discosUSB/WDElements_10B8/Elements/hdFolder  8.0G  2.5G  5.5G  32% /home/pi/mySharedFolder

Too I can open file.txt

cat mySharedFolder/file.txt
Hello

But I can't copy files to the directory:

 sudo cp a.jpg mySharedFolder/
 cp: error writing 'mySharedFolder/a.jpg': Permission denied

If I list content directory, I can see a.jpg file created whith 0 bytes

ls -la mySharedFolder/

-rwxrwxrwx 1 pi pi    0 Oct 31 17:32 a.jpg
-rwxrwxrwx 1 pi pi    5 Oct 31 17:17 file.txt
drwxrwxrwx 2 pi pi    0 Oct 31 17:18 folder1

Using Android ES File Explorer I can see the folder and I can copy, delete, create files in hard disk share folder without problems

Additional info

sudo smbclient -L //192.168.1.1

        Sharename       Type      Comment
        ---------       ----      -------
cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe srvsvc failed with error NT_STATUS_BUFFER_TOO_SMALL
        discosUSB       Disk      Share Folder
        IPC$            IPC       Remote Inter Process Communication
Reconnecting with SMB1 for workgroup listing.

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------

What am I doing wrong?

Thanks

enraged
  • 111
  • 1
    can you post the permissions of the a.jpg file. While you are using sudo (no password proimpt?) maybe It is somehow possible that you do not have read permissions on that file. Just checked by creating an a1.jpg file with execute permissions only with : touch a1.jpg && chmod 111 a1.jpg && chown user1 user1 a1.jpg as root in user1 directory, and then trying to copy it as that user1 within the user tree and got the same permission denied error, even though user1 is set as the owner of the file (he can change permissions himself if needed but can't copy the file without doing so first). – NetIceCat Oct 31 '19 at 19:49
  • Also, one simple test would be to enter that specific folder and trying to create a new file within it with something as simple as cat 123 > test123.txt and see if you get a permission error. Also, you should try mounting the filesystem with uid=$(id -u),gid=$(id -g),forceuid,forcegid just to be safe, because ntfs mounts force root as default user. Also check the actual mount in cat /etc/mstab – NetIceCat Oct 31 '19 at 20:37
  • Thanks BarBar1234. The permissions of a.jpg are -rwxrwxrwx 1 pi pi 0 Oct 31 17:32 a.jpg – enraged Nov 04 '19 at 14:55
  • Is it possible for you to create a new file within the remote folder itself from the terminal? – NetIceCat Nov 05 '19 at 01:05
  • Hi, I testing create a file inside folder cd mySharedFolder/ sudo echo 123 > test123.txt and the result is echo write error: Permission denied

    Also I test mount with uid=$(id -u),gid=$(id -g),forceuid,forcegid with the same result, Permission denied when copy and creating file Thanks a lot for your help

    – enraged Nov 06 '19 at 20:22

1 Answers1

0

I trie to mount a hard drive shared by samba and connected to an Android TV box.

I have been able to mount it and it allows me to copy, create files without problems. I guess it's a livebox router permissions issue

enraged
  • 111