Fedora Linux Support Community & Resources Center
Old 5th March 2012, 04:44 PM
bobatlcpmbdx Offline
Registered User
Join Date: Nov 2004
Posts: 19
NFS - can't read usb hard drives attached to server

Here is the setup:-

Desktop - fred4 - ip address with 2 x USB expansion hard drives:-

500Gbdrive - /dev/sdb mounted automatically at /media/500Gbdrive

2Tbdrive - /dev/sdc mounted automatically at /media/2Tbdrive

fred4 - /etc/hosts file:- fred4 localhost.localdomain localhost4 localhost4.localdomain4
::1 fred4 localhost.localdomain localhost6 localhost6.localdomain6
::0 fred4 fred4.workgroup fred4.workgroup6 workgroup6 router router.workgroup HPD9D3DE fred3 fred3.workgroup fred4 fred4.workgroup

fred4 - /etc/exports
/home/bob fred3(rw,insecure,sync,no_wdelay,no_subtree_check, insecure_locks,nohide,no_root_squash)
/media/2Tbdrive fred3 (rw,insecure,sync,no_wdelay,no_subtree_check,insec ure_locks,nohide,no_root_squash)
/media/500Gbdrive fred3 (rw,insecure,sync,no_wdelay,no_subtree_check,insec ure_locks,nohide,no_root_squash)

laptop - fred3 - ip address
fred3 - /etc/hosts:- fred3 localhost.localdomain localhost4 localhost4.localdomain4
::1 fred3 localhost.localdomain localhost6 localhost6.localdomain6
::0 fred3 fred3.workgroup fred3.workgroup6 workgroup6 router router.workgroup HPD9D3DE fred3 fred3.workgroup fred4 fred4.workgroup

fred3 - /etc/exports :-
/home/bob fred4 (rw,insecure,sync,no_wdelay,no_subtree_check,insec ure_locks,nohide,no_root_squash)

I can mount fred4:/home/bob using command :- "sudo mount -t nfs4 fred4:/home/bob /mnt/fred4" and it works fine.

relevant part of the result of the "mount" command :-
fred4:/home/bob on /mnt/fred4 type nfs4 (rw,relatime,vers=4,rsize=262144,wsize=262144,naml en=255,hard,proto=tcp,port=0,timeo=600,retrans=2,s ec=sys,clientaddr=,minorversion=0,local _lock=none,addr=

If I try to mount the USB drives using commands "sudo mount -t nfs4 fred4:/media/500Gbdrive /mnt/500Gbdrive"
or "sudo mount -t nfs4 fred4:/media/2Tbdrive /mnt/2Tbdrive" it just times out

With F14 I was able to mount the usb hard drives as above without problems.

Any ideas would be gratefully received

Reply With Quote
Old 5th March 2012, 05:01 PM
jpollard Offline
Registered User
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 7,346
Re: NFS - can't read usb hard drives attached to server

Exports are setup once, a drive plugged in afterwards (and mounted) cannot be exported without another exportfs command to update the table.

The directory exported has nothing to do with the mount command.

Next, in Fedora 15/16 /media is intended for removable media such as USB devices. The mountpoints are generated automatically by udev when they are mounted.

Manually mounting something will not create the mountpoint. And mountpoints in /media are not carried across reboots as /media is a tmpfs, and as such is always cleared.

If you want to mount things manually, you would be better off creating your mountpoint in /mnt, and doing the manual mounts in /mnt as well. You could put the parameters for the mount in the /etc/fstab (option "noauto") so simplify the mount commands. You will still have to issue the exportfs command to add the exported directory.

You can also investigate using the "nohide" option to the NFS exports file entry for /mnt/<whatever> as that MAY allow NFS to ignore the non-mounted filesystem, and still access it after the mount. I'm not sure it will work directly, but if it doesn't you can try making the mountpoint one level down (/mnt/something/whatever) and make the exports file entry /mnt/something. The "nohide" is to allow submounted filesystems to be exported via NFS, but I'm not sure it will work as the export list is setup only when the exports command is used, and mounting after the fact might not work.

Last edited by jpollard; 5th March 2012 at 05:15 PM.
Reply With Quote
Old 7th March 2012, 10:27 AM
bobatlcpmbdx Offline
Registered User
Join Date: Nov 2004
Posts: 19
Re: NFS - can't read usb hard drives attached to server

Thanks for the quick reply. I don't fully understand everything so I'll go through it in order.

The usb drives are permanantly connected and are mounted at startup.
I presume the exportfs command is carried out by the daemon when I log on to make the exported filesystems available to nfs. Are you saying that the export of /media... cannot work in those circumstances?

I gave the result of the mount command to show how the successful nfs mount was configured in case there was a clue there.

Mount points for all file systems are already created in /mnt (/mnt/fred4, /mnt/2Tbdrive and /mnt/500Gbdrive) - should I be in some way stopping udev from mounting the usb drives on the server in /media and doing it manually or using fstab in /mnt?

I tried issuing the command exportfs as root on fred4 and it returned the three exports as:-
/home/bob fred3
/media/500Gbdrive fred3
/media/2Tbdrive fred3

The nohide option in exports looks interesting. I tried opening the parent of the nfs mounted fred4/home/bob on fred3 and it just takes me back to the mnt/fred4 directory. I thaught that in an earlier version of Fedora It took me back to the file system on the server
I did this in nautilus as I don't know how to do it at the command line in a terminal. I'll dig out the books and see if there is a way to go back along the tree in the server.

Thanks again for the help
Reply With Quote
Old 7th March 2012, 01:20 PM
jpollard Offline
Registered User
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 7,346
Re: NFS - can't read usb hard drives attached to server

/media is tmpfs - and tmpfs is recreated at boot.

Therefore mountpoint not created by udev will not exist, causing mounts (via /etc/fstab) to fail.

NFS exports are created when the NFS server starts - if the filesystem isn't mounted at that time, then it won't be exported.
Reply With Quote
Old 26th March 2012, 02:49 PM
bobatlcpmbdx Offline
Registered User
Join Date: Nov 2004
Posts: 19
Re: NFS - can't read usb hard drives attached to server

In conclusion
I think I've got my head around the /media and tmpfs concept so I've manually unmounted the usb drive and mounted it at /mnt/500Gbdrive.
I edited the /etc/exports file to add the usb drive and I can now connect to it from the laptop.

I needed to make it all happen for both drives automatically at start up now.

I had a look at the /etc/fstab file. I found that things have moved on since my last dealings with this file but I found this link that shows how to add the lines to /etc/fstab,


See the reply from user "fdrake"

So I edited my /etc/fstab file to have the drives mount at /mnt/2Tbdrive and /mnt/500Gbdrive respectively.

I was not sure if the fstab entries would overide udev but there seems to be no problem there when I rebooted and the drives were only mounted once in the /mnt directory and not in /media

I can now mount the drives over the network using nfs.

Only thing is I'm not sure yet if there will be problems with persitant naming of the devices in /dev but I mounted them using uuid number so I hope not.

I'll close the thread now as solved untill I discover any problems

Thanks to jpollard for your advice.

Last edited by bobatlcpmbdx; 26th March 2012 at 02:52 PM.
Reply With Quote
Old 12th August 2012, 02:50 PM
barrowsr Offline
Registered User
Join Date: Aug 2012
Location: USA
Posts: 1
Re: NFS - can't read usb hard drives attached to server

Just wanted to chime in that I had a alternative solution.
I hate when one system I am working with (NFS) ends up requiring changes in another (fstab).

I like when things are mounted in /media cause they play nice with gnome, and that is where the developers intended them to be. My fix was to simply add fsid=0 to my exports file.

/media/normalmountpoint *(rw,async,insecure,no_subtree_check,fsid=0)

And now all is well.
I am sharing this information in hopes that someone else doesn't have to spend as much time as I did geting a windows 7 machine to map a network drive from fedora 17, that is a nfs share of windows drive (ntfs) that is mounted in /media (tmpfs).

Now my only issue is that windows shows a red x on the drive because it's name is longer than 26 chars, but I can still access it and so all is well. (if someone knows how to get rid of that red x let me know).

For clarification I do have a fstab entry
/dev/sdb2 /media/normalmountpoint ntfs defaults,umask=000,uid=1000,gid=1000,windows_names 0 0

So I don't actually know that it will work for automount as I haven't tried outside of my setup, all I know is that it wouldn't work for me until I added the fsid=0 to /etc/exports.

Last edited by barrowsr; 12th August 2012 at 03:13 PM.
Reply With Quote

attached, drives, hard, hard drive, nfs, read, server, usb

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
(thundebird)When i read mail it's not shown as read on server ubunturk Using Fedora 2 18th November 2010 01:26 PM
Fedora 9 installation on SAS (Serial Attached SCSI) drives problem erickwellem Installation, Upgrades and Live Media 11 5th April 2009 11:10 PM
Samba server multiple hard drives xjoker Servers & Networking 2 6th September 2006 09:36 PM
Sharing hard-drives and mapping network hard-drives twn_onizuka Servers & Networking 0 14th June 2005 04:19 PM

Current GMT-time: 05:38 (Saturday, 23-09-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat