2

I have mounted a shared network drive. See below output of df -h command.

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             550G  362G  161G  70% /
tmpfs                 1.9G   80K  1.9G   1% /dev/shm
//10.143.19.121/myfolder/
                      1.1T  678G  438G  61% /mnt/extstorage

//10.143.19.121/myfolder/ is the mounted folder from network. I have mounted it by adding the below line under the /etc/fstab/

//10.143.19.121/myfolder/ /mnt/extstorage cifs uid=root,rw,umask=0000,directio,username=MyUser,password=MyPassword123! 0 0

I can access the folder.

[root@caresurvey /]# cd /mnt/extstorage/
[root@caresurvey extstorage]#

But I cannot do operations inside it. Error shown below. It says permission denied.

[root@caresurvey extstorage]# mkdir TestDir
mkdir: cannot create directory `TestDir': Permission denied

The permissions on //10.143.19.121/myfolder/ are properly set to read and write for all users within the network. I'm not sure though about the File Format of the said shared folder but as far as I read, it doesn't matter as long as it is shared.

My server is running on CentOS release 6.4 (Final). Am I missing something?

I have also edited the /etc/ssh/sshd_config to un-comment/enable the PermitRootLogin yes because I have read a thread that by doing it, a user was able to fix his issue.

Any help will be greatly appreciated. Below is the output of mount command.

/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/tmp on /tmp type none (rw,bind)
/var/tmp on /var/tmp type none (rw,bind)
/home on /home type none (rw,bind)
none on /sys/kernel/config type configfs (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
//10.143.19.121/myfolder/ on /mnt/extstorage type cifs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)

EDIT (09-22-2015@02:42PM - GMT+8):

Here is the output of ls -ld /mnt/extstorage.

drwxr-xr-x 1 root root 0 Jul 10 15:26 /mnt/extstorage

Note that I am running as root.

  • I bet that there is a problem with the options you are using in your /etc/fstab. Try commenting out that line from your /etc/fstab and mounting like so ... # mount -t nfs /10.143.19.121/myfolder /mnt/extstorage. Also find out if the exported fs is "root squashed" or not. – Red Cricket Sep 22 '15 at 7:00
  • PermitRootLogin has nothing to do with mounting CIFS, so you can safely get rid of it again. Have a look again at the directory permissions of the shared directory. Is this a Windows shared directory or samba? In case of samba, update the question with the shared directory directives from smb.conf – Lambert Sep 22 '15 at 7:08
  • Thank you guys. I'm trying out your suggestions. Will give you feedback. Currently, I am having this error in the command mount -t nfs 10.143.19.121:myfolder /mnt/extstorage. Error message: mount.nfs: Connection timed out but the server was ping-able. – Erick Sep 22 '15 at 7:16
  • @Lambert it is a Windows shared directory. – Erick Sep 22 '15 at 7:20
  • Then have a look at both the shared directory permissions (by default Everyone: Read Only) vs the NTFS permissions. You might have modify access to the directory and files at filesystem (NTFS) level but the share might prevent you from writing data. The least privilege will be honored in Microsoft terms. – Lambert Sep 22 '15 at 7:22
2

Thanks for your replies. I have found out that the NTFS level permission was not set correctly that is why I cannot write in the said folder. After asking the Network Administrator to set the permission correctly, file operations has been permitted.

Also, I have tried sharing a folder using nfs via CentOS (separate server). I was able to replicate and prove my network administrator that there is a problem with his NTFS-level permission. I created a shared folder using NFS. Mounted it on my server, then made the permission to the default one (not 0777). I was able to mount the folder, but cannot do file operations. I have changed it to 0777 (chmod 0777), then the file operations has been allowed.

Cheers!

-1

my results:

/etc/ssh$ ls -ld /mnt/test/
drwxr-xr-x 2 root root 4096 Jul 14 18:18 /mnt/test/

I also performed chmod -R 777 to this share folder but I am unable to create folder on shared drive through command line but I am able to create through explorer in Linux

Note: if i am using sudo mkdir it is allowing me to create folder through terminal

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.