1

So, I'm trying to programmatically share and unshare mount points via NFS. (I realize this may not be the best approach, but I'm working in someone else's code.) On my server, I'm exporting the mount point by invoking

exportfs -o ro,no-root-squash :/mnt/usb

which seems to work correctly; my clients can mount server:/mnt/usb, view the files, etc. The problem is that my corresponding attempt to unexport

exportfs -u :/mnt/usb

does nothing. (This is with no clients actually trying to access that mount at any point.) Based on my reading of the documentation, that should work. Am I misreading something?

/mnt/usb is not in my /etc/exports file.

Here's my uname -a:

Linux somehost 2.6.30.9 #1 SMP Wed Aug 10 12:09:51 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

And here's a copy-paste of an example sequence. After the "exportfs -u", I'd expect /mnt/usb to not be in the list of exported entries.

[root@somehost ~]# exportfs -r
[root@somehost ~]# exportfs -iv
/mnt/ipl        <world>(ro,wdelay,root_squash,no_subtree_check,anonuid=-1,anongid=65534)
[root@somehost ~]# exportfs -v -o ro,no_root_squash :/mnt/usb
exporting :/mnt/usb
[root@somehost ~]# exportfs -iv
exportfs: No host name given with /mnt/usb (ro,sync,wdelay,hide,nocrossmnt,secure,no_root_squash,no_all_squash,no_subtree_check,secure_locks,acl,mapping=identity,anonuid=65534,anongid=65534), suggest *(ro,sync,wdelay,hide,nocrossmnt,secure,no_root_squash,no_all_squash,no_subtree_check,secure_locks,acl,mapping=identity,anonuid=65534,anongid=65534) to avoid warning
/mnt/ipl        <world>(ro,wdelay,root_squash,no_subtree_check,anonuid=-1,anongid=65534)
/mnt/usb        <world>(ro,wdelay,no_root_squash,no_subtree_check,anonuid=65534,anongid=65534)
[root@somehost ~]# exportfs -u :/mnt/usb
exportfs: No host name given with /mnt/usb (ro,sync,wdelay,hide,nocrossmnt,secure,no_root_squash,no_all_squash,no_subtree_check,secure_locks,acl,mapping=identity,anonuid=65534,anongid=65534), suggest *(ro,sync,wdelay,hide,nocrossmnt,secure,no_root_squash,no_all_squash,no_subtree_check,secure_locks,acl,mapping=identity,anonuid=65534,anongid=65534) to avoid warning
[root@somehost ~]# exportfs -iv
/mnt/ipl        <world>(ro,wdelay,root_squash,no_subtree_check,anonuid=-1,anongid=65534)
/mnt/usb        <world>(ro,wdelay,no_root_squash,no_subtree_check,anonuid=65534,anongid=65534)
[root@somehost ~]# 

Thanks!

2

Figured out my own problem. The unexport needed to be

exportfs -u *:/mnt/usb

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.