So I recently build a simple NAS running Freenas. On my Linux devices, I am able to mount the nfs share directory and gain access to it, but I have to manually mount via CLI every time.
To have it mount the NAS automatically on boot, I added the following line entry in /etc/fstab:
192.168.0.147:/mnt/Pool1/nfs_share1 /media/freenas nfs x-systemd.automount,noauto 0 0
But when I try to access the nfs share directory it returns the following message:
An error occurred while accessing 'mnt/Pool1/nfs_share1 on 192.168.0.147', the system responded: mount: /media/freenas: operation permitted for root only.
I’m not sure what to do or what I need to change permissions of. Running Manjaro 18 and Mint 19 on client devices. Thanks in advance for any help/suggestions.
Here’s what I do 'cause I’m lazy :
as root (e.g. “sudo -i”) :
mount NAS:/mnt/SHARE /mnt/MOUNTPOINT
Then verify it’s in /etc/mtab (temporary file shows mounted filesystems in /etc/fstab format) :
tail -1 /etc/mtab
Then I concat that to the end of /etc/fstab (hint don’t mount anything else in between!)
tail -1 /etc/mtab >> /etc/fstab
(I use FreeNAS too - love it - been using it 10+ years + love ZFS - latest version kicks arse - it installs zsh and git by default - so my shell in FreeNAS is running zsh with oh-my-zsh!)
It’s Unix, nfs share.
It worked!!! THANK YOU!!!
For those interested, there are two things I see that I did wrong in my previous attempts:
- I wasn’t editing /etc/fstab as root, only sudo.
- I didn’t have the correct entry format/parameters in the line I initially added to /etc/fstab
It’s one thing to find a solution to an issue, it’s another to understand what happened and what fixed it. Thanks again, @daniel.m.tripp
Editing /etc/fstab using sudo should work - I don’t see a reason why it shouldn’t…
sudo vi /etc/fstab
works everytime I’ve ever tried it…
One thing that doesn’t work :
sudo tail -1 /etc/mtab >> /etc/fstab
(because the redirect “>>” doesn’t inherit permissions from sudo - using “tee” might do the trick - but again, 'cause I’m lazy, “sudo -i” mostly does the trick for me)
Also - I’d like to stress to those less familiar with NIX - ALWAYS double check you’re appending with “>>” - and NOT overwriting with “>” (I know - 'cause I’ve done this before - one time I even used “>” instead of “|” and overwrote the “mailx” binary [Solaris - many years ago]). Probably always a good idea to make a backup copy to be on the safe side - e.g. :
cp /etc/fstab /etc/fstab.$(date '+%Y%m%d')
tail -1 /etc/mtab >> /etc/fstab
A good way to prevent this and other similar errors is to backup the destination file, if it is important, beforehand, just to be extra sure. Works for me since ever.
Ok, so I’ve encountered a new problem that I’m having a hard time figuring out…
On my Pinebook (running Manjaro ARM KDE 19), when I try to manually mount the nfs as I did on my laptop, it acts like it’s doing tome thing, but then gives the following message:
mount.nfs: No route to host
Currently searching for solutions, but not having much luck thus far. Found something that says it has to do with iptables?
Last time I had this error, the DNS solution on this site solved it.
Maybe this can be helpful, as well.
If there’s still no luck in sight, search the error in conjunction with SSH, because there are way more discussions about that regarding SSH connections.
Mike : I suspect this is because the Pine 64 uses code from the Android kernel - and - this is REALLY annoying - that kernel wasn’t built with NFS support…
Not quite the same thing - but - with my Nexus 5 running MaruOS (I’ve used 3 builds on there - Android 5, 6 and now 8) - and cannot mount NFS (inside the Debian chroot) on any of those builds because it’s using the Android kernel…
The Pine64 “folks” used work from the Android kernel - pretty sure all the Pine64 using the A64 ARM chip are running some form of kernel 3.10x from Android… and no NFS support at compile time of the kernel… From memory - Armbian did have a “not quite ready” Kernel 4.x for Pine64, but I think they’ve gone back to 3.10.x
You may have to build your own kernel from scratch (not a task to be embarked on lightly)… Last time this happened to me - I gave up and used scp/sftp to talk to my NAS (I’ve got 2 x Pine64 boards - but never use them 'cause they’re really flaky)…
The Manjaro ARM build I’m running on the Pinebook is actually running Kernel 5.0, surprisingly.
I might make a post and ask about this over on the Pine64 forums, if trying a few of the solutions Akito posted don’t work out.
Wow! Kernel 5.x? It’s my birthday this week (yeah - I’m old : 57 ) and I might try and get on the Pinebook “waitlist” thing-a-ma-wotsit again and see if I can get one of the hi-res (1080p) ones… even though I distrust everything about the Pine “folks” (whole thing left a bad taste in my mouth - especially had a few run ins with one of their “community” admins on the Pine64 forums - never got reliable power to it, fudged MAC addresses on Gbit NICs, dodgy LiPo battery circuit etc)…
My new OrangePi Win Plus was supposed to have arrived by now (“yeah good luck with that” : AliExpress )
Let me know if this turns out to be just a name lookup problem or if it’s kernel related… I really can’t see it being a name lookup issue, NFS is usually perfectly okay with just using IP address in mount…
It was a nice surprise to find upon arrival that my 11" Pinebook was upgraded to a 1080p display (for free). Now, I believe all of them are 1080p.
As cool as this device is, it was nearly unusable for me, running the KDE Neon it shipped with. Somewhat glitchy and just overall slow. I know its not a powerful machine by any stretch, but I expected a bit more out of it. It wasn’t until I installed Manjaro ARM KDE that it became fast enough to actually use. Just thought I’d share some of my experience before you order.
Also, I don’t know where you live, but here in Canada, with the exchange rate and shipping costs/import fees etc, it ended up closer to $200 (CAD). Considering you can get a much more powerful used laptop these days for less than $100, the cost was a bit steep for what you get, IMO.
BUT, it is a well-designed device and there are some things I do like about it; like the battery life, it’s weight and size, and the very nice 1080p display. It’s been a great tool for me for learning many things Linux-related and in that regard, it’s a fun device. It’s definitely not a desktop or mainstream laptop replacement though.
Support on the Pine64 forums is a bit dry as there aren’t many people out there with these things. I’m surprised, but grateful that the folks over at Manjaro took the time to create a distro for this device.
Indeed, will keep you posted.
And happy birthday!
root@maru:/mnt# mount IP.OF.MY.NAS:/mnt/NASSHARE /mnt/NASSHARE
mount.nfs: No such device
Above is what happens on my Nexus 5 running MaruOS (Debian Stretch chroot)
root@maru:/mnt# uname -a
Linux maru 3.4.0-g5de735ce #1 SMP PREEMPT Tue Feb 19 05:29:54 UTC 2019 armv7l GNU/Linux
This is because that kernel, at compile time, wasn’t built with NFS support. Now that is something I really hate, 'cause I kinda love NFS…
Confirmed - no “nfs” object in filesystems listed in proc :
root@maru:/mnt# cat /proc/filesystems
Note : debian package “nfs-common” is installed - but it makes no difference if there’s no kernel object…
Thanks. I’ll take a nother look at Manjaro on the Pinebok and see. It’s probably as you say and doesn’t have NFS support in the Kernel.
My next question though would be; can it be added?