-----Oprindelig meddelelse-----
Fra: [email protected] 
[mailto:[email protected]] På vegne af Ken Moffat
Sendt: 4. april 2013 22:36
Til: BLFS Support List
Emne: Re: [blfs-support] Automount of NFS fails

On Thu, Apr 04, 2013 at 08:48:22PM +0200, Niels Terp wrote:
> I have a NAS with a NFS server, and I want to access it from my LFS machine.
> 
> I have followed the instructions in BLFS Version 2013-03-27:
> 
> -I configured the kernel
> - I installed NFS Utilities 1.2.6
> -I modified my /etc/fstab to:
> 
> /dev/sda1     /            ext3    defaults,acl,user_xattr            1
> 1
> /dev/sda2     swap         swap     pri=1               0     0
> proc           /proc        proc     nosuid,noexec,nodev 0     0
> sysfs          /sys         sysfs    nosuid,noexec,nodev 0     0
> devpts         /dev/pts     devpts   gid=5,mode=620      0     0
> tmpfs          /run         tmpfs    defaults            0     0
> devtmpfs       /dev         devtmpfs mode=0755,nosuid    0     0
> 192.168.0.17:/Data  /mnt/DiskStationData nfs
> rw,_netdev,rsize=8192,wsize=8192 0 0
> 
> -I installed the two bootscripts: make install-nfs-server and make 
> install-netfs.

 You don't need the server bootscript on your nfs machine to use an export from 
a different box, your LFS machine will be a client.

 You probably do want a bootscript for rpcbind - I see that the current scripts 
have renamed that to 'rpcbind' - something else _I_ need to update, my older 
bootscripts call it nfs-client.

> 
> When I boot, I get these errors:
> 
> Starting NFS nfsd...[   15.958616] Installing knfsd Copyright .....
> svc: failed to register nfsdv2 RPC service (errno 111.
> svc: failed to register nfsaclv2 service (errno 111).
> Rpc.nfsd: writing fd to kernel failed: errno 111(Conection refused).
> Rpc.nsfd: unable to set any sockets for nfsd

 This is the nfs *server* (knfsd) in the kernel of your LFS machine.
Try chmod -x for the nfs-server bootscript because you don't need it in the 
setup you have described.

 The mount from 192.168.0.17 (nfs v2 ? really ? linux has allowed nfs
v3 over tcp for many years) should be reported when the netfs script runs.  
'mount -a' _might_ also retry this if /mnt/DiskStationData is really not 
mounted.

> 
> My NAS expects a username and a password, and I guess that is the 
> cause. How can I pass those to the NAS ?

 According to google, root can do this using commands like mount -t nfs -o 
username=David,password=DSint669 192.168.5.21:/home/MEDIA /home/david/MEDIA 
[pasted  - change ALL the details to suit your setup].

 I've no idea if those options can go in your fstab, but putting a password 
there seems like a bad idea.  Do you need to _always_ mount this ?  In my own 
case, /sources (r/w, as me) and /data/av (ro) get mounted from fstab using

milliways:/home/sources /sources nfs rw,hard,intr,_netdev,tcp,vers=3  0  0 
milliways:/data/av /mnt/av nfs ro,hard,intr,_netdev,tcp,vers=3 0 0

 I've also got my notes and docs on the server - again those don't need a 
password other than my login to the desktop.  I have them in fstab so that a 
user can mount them:

milliways:/home/ken/docs /home/ken/docs nfs rw,hard,intr,noauto,tcp,user,vers=3 
0 0 milliways:/home/ken/notes /home/ken/notes nfs 
rw,hard,intr,noauto,tcp,user,vers=3 0 0

 but the mounting is done from ~/.bashrc when I login.  I *guess* you could 
write a script in ~/ to pass the username and password, and keep it only 
visible to yourself and root.

 Unfortunately, nfs doesn't get a lot of use among BLFS users.

ĸen
--
das eine Mal als Tragödie, das andere Mal als Farce
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Thank you very much Ken, that solved my problem.

I had already installed rpcbind, but the remote partition was NOT mounted. But 
I could mount it manually.

So I removed the server startup script, you are absolutely right, I don't want 
to use my LFS machine as a NFS server. The only reason I installed the script 
was that the book says that you then don't have to install the client 
bootscript. 

With that removed, I double-checked the rpcbind installation and my fstab, 
rebooted - and it worked, even without username/password ! But now that I 
recall, I think that part of my NAS setup was to allow certain users access via 
NFS.

So now I can access my NAS with no problems at all.

Niels

-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to