BERTRAND Joël <joel.bertr...@systella.fr> writes: > I'm trying to configure swap over NFS (on a diskless workstation). > > I have created a swapfile on nfsserver:/srv/schwarz/ (swapfile.0) and > added in client /etc/fstab : > > nfsserver:/srv/schwarz/swapfile.0 none swap sw,nfsmntpt=/swap > > nfs server seems to run as expected as client can mount > nfsserver:/srv/schwarz in / > > But when I try to mount swap, sysctl returns an error : > > schwarz# swapctl -A > mount_nfs: can't access /srv/schwarz/swapfile.0: Permission denied > swapctl: 192.168.10.128:/srv/schwarz/swapfile.0: mount failed
I haven't used diskless for a really long time, so this question may be off. If you have a single root exported partition that you have /swap in, why don't you just put swapfile.0 in swap in the first place, and use a swap line that adds the file, not trying to mount it? Do the mount command that swapctl -A will do manually. It could be that trying to mount your root within your root is not working. Use ktrace on swapctl to see what it does. Check that after mounting by hand that root can access the swapfile. Use dd to read and to write it. I see that you have maproot, but check every step you can explicitly. Use tcpdump to watch the traffic. Use -s1500 -w to record it. Look at it all with -vv carefully.