Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


cannot write files to a mounted nfs partition

Posted on 2014-08-21
Medium Priority
Last Modified: 2014-08-21
I mounted an nfs partition from a remote server to this host (thea). I wrote this line to /etc/fstab file and mounted with -a option. all things looks ok except when I tried to write file to this partition. it doesn't let me create file to this partition even with "root" permission, please help.  

[root@thea titanbackup]# touch testfile
touch: cannot touch `testfile': Permission denied

[root@thea mnt]# ls -alt
total 20
dr-xr-xr-x. 28 root root 4096 Aug 21 08:48 ..
drwxr-xr-x   2 root root    6 Jun 17 14:31 titanbackup
drwxr-xr-x.  6 root root 4096 Jun 14 21:07 .
drwxr-xr-x.  2 root root 4096 Feb 11  2014 hgfs
drwxr-xr-x.  2 root root 4096 Feb 10  2014 cdrom
drwxr-xr-x.  2 root root 4096 Feb  5  2014 ExternalHD
[root@thea mnt]#

[root@thea titanbackup]# mount
/dev/sda3 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)
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_OS-home on /home type ext4 (rw)
/dev/mapper/vg_OS-tmp on /tmp type ext4 (rw)
/dev/mapper/vg_Gentran-LogVol00 on /u1 type ext4 (rw)
/dev/mapper/vg_OS-usr on /usr type ext4 (rw)
/dev/mapper/vg_OS-var on /var type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
titan.minkagroup.net:/u1/backup/thea/nfsbackup on /u1/nfsbackup type nfs (rw,vers=4,addr=,clientaddr=
titan.minkagroup.net:/u1/backup/thea/nfsbackup on /mnt/titanbackup type nfs (rw,vers=4,addr=,clientaddr=
[root@thea titanbackup]# cat /etc/*-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@thea titanbackup]#

root@thea titanbackup]# cat /etc/fstab

# /etc/fstab
# Created by anaconda on Mon Feb  3 23:20:58 2014
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
UUID=011240a7-1286-43ef-9e77-889eada1b760 /                       ext4    defaults        1 1
UUID=8678f3c4-d9a0-44fe-96ea-f292b022c84e /boot                   ext4    defaults        1 2
/dev/mapper/vg_OS-home  /home                   ext4    defaults        1 2
/dev/mapper/vg_OS-tmp   /tmp                    ext4    defaults        1 2
/dev/mapper/vg_Gentran-LogVol00 /u1                     ext4    defaults        1 2
/dev/mapper/vg_OS-usr   /usr                    ext4    defaults        1 2
/dev/mapper/vg_OS-var   /var                    ext4    defaults        1 2
UUID=969cf12d-482f-4b54-a6e0-79a8600509aa swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
#titan.minkagroup.net:/u1/backup/thea/nfsbackup   /u1/nfsbackup nfs     _netdev         0 0
titan:/u1/backup/thea/nfsbackup   /mnt/titanbackup nfs    _netdev         0 0
[root@thea titanbackup]#
Question by:Jason Yu
  • 4
  • 2
LVL 36

Accepted Solution

Seth Simmons earned 2000 total points
ID: 40278199
on the titan server, what is the output of /etc/exports?
for that export (titanbackup) does it have the option no_root_squash?
if not, that is your problem since by default root over an nfs share will be like nobody
adding no_root_squash to your export options will allow root access over nfs

example: /u1/backup/thea/nfsbackup *(no_root_squash)
you want to add that option there with whatever other options you already have

Author Comment

by:Jason Yu
ID: 40278211
I just added the no_root_sqush to this titan server but it's still not working, could you check?

[root@titan ~]# cat /etc/exports
/u1/backup/jupiter    ,sync)
/u1/backup/halo                 halobk(rw,sync)
/u1/backup/ora9igl    ,sync)
/u1/centos                      *(rw,sync)
/u1/centos/centos-6_32          *(rw,sync)
/u3/appsperi          ,sync),sync) elysium(rw,sync) phobos(rw,sync)
/u1/centos/rhel64_5.5           *(rw,sync)
/u2/backup/luna       ,sync)
/u1/backup/thea       ,sync,no_root_squash)
[root@titan ~]#

[root@thea titanbackup]# mount titan:/u1/backup/thea/nfsbackup   /mnt/titanbackup
mount.nfs: /mnt/titanbackup is busy or already mounted
[root@thea titanbackup]# umount -f /u1/nfsbackup
umount2: Invalid argument
umount: /u1/nfsbackup: not mounted
[root@thea titanbackup]# cd ..
[root@thea mnt]# umount -f /mnt/titanbackup/
[root@thea mnt]# mount -a
[root@thea mnt]# cd titanbackup/
[root@thea titanbackup]# touch test
touch: cannot touch `test': Permission denied
[root@thea titanbackup]#
LVL 36

Assisted Solution

by:Seth Simmons
Seth Simmons earned 2000 total points
ID: 40278214
after you change the exports file, you need to run exportfs -a on titan for the nfs server to refresh the export list
remove the mount on thea and mount again
the syntax you added in exports is correct
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

by:Jason Yu
ID: 40278233
It's working now, wonderful job.

[root@thea titanbackup]# touch test
[root@thea titanbackup]# ls -alt
total 4
-rw-r--r--  1 root root    0 Aug 21  2014 test
drwxr-xr-x  2 root root   17 Aug 21  2014 .
drwxr-xr-x. 6 root root 4096 Jun 14 21:07 ..
[root@thea titanbackup]# rm -rf test
[root@thea titanbackup]#

Author Comment

by:Jason Yu
ID: 40278235
what is exportfs command for? and option -a -r?

Author Comment

by:Jason Yu
ID: 40278266
thanks, I figured it out by google. have a nice night.

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question