Switched fully from WIndows to Linux Mint last march, and everyday I'm learning how awesome Linux is. Great video. NFS is so much neater than my previous network share setup.
This is so awesome. I tried looking up this int he Ubuntu Server 4th edition. Couldn't find much in the book, but this video was awesome. I ran into a snag when I initially set it up where I kept getting no such file every time I navigated into the /mnt/nfs folder. Turns out I typed the nfs4 option in the fstype in the auto.fs file. Good old fumble fingers. Been playing around with this for a day now. This is so, so slick. (and fast). Thanks for introducing this. Now if we can get a video on how to configure security and permission for this bad boy, we'd me in for a treat! Whoohoo, you rock!
I used this to setup AutoFS with a ZFS pool on a local server. The ZFS setup part had extra special sauce, but the autofs was verbatim and extremely useful. Thanks for the video!
Great video! I run TrueNAS Scale as my file server and was able to get it connected to my Debian docker client. One minor hiccup I had was that AutoFS was not automatically mounting my NFS shares upon access. The solution for this was to change nfs4 to just nfs in the auto.nfs file. It works wonderfully after those changes. I hope this helps someone! :)
This tutorial came just in time for me, as I was struggling with setting up mpd (music player deamon) to work properly here. I can easily follow and enjoy your way of explaining, although I'm not a native speaker. You're just extremely good at explaining/teaching, please keep it up and many, many thanks!
Jay. This was an excellent video and tutorial blog! I already had NFS working from my OMV server to my Debian client, but I was bewildered trying to get autofs to work (I tried afuse as well). Your walk-through explained it clearly. A big THANK-YOU!
I watched several videos before this one, to move my shares from Samba to NFS and non of them was so complete. I need to remember to find tutorial here, at your channel first, before anywhere else. I set up all from the first try following your video. Thanks you =)
can I ask you why you changed from SMB to NFS? I've been debating both: my default position is to go for SMB although I find the client side on Linux to be more difficult than the other way around. I believe I can use NFS from Windows 11 Pro as a client at least. I ideally want bidirectional peer-to-peer file sharing. Windows is very good for this but Linux less so, or at least that's my experience so far. Thanks.
@@treyquattro NFS is generally considered to be easier to configure, only a few lines in a config file as you saw in the video. It's also generally faster than SMB. However NFS has no concept of user and group management, so when improperly configured it can be very insecure with regards to your data. Also when you throw Windows into the mix I would generally recommend using SMB. NFS usually is the best choice when you're only dealing with Linux machines and perhaps the occasional Mac.
@@RudyBleeker " It's also generally faster than SMB". Hmm, I'm skeptical of that claim. Got any links to comparison tests? At any rate it would be an insignificant different over a 1Gb LAN or faster. Maybe if as you imply data is not being encrypted that would obviously account for some performance difference, but again it shouldn't be an issue on modern equipment (like 2022/3 era computers). I don't want to be chopping and changing, just use one protocol to share files between Linux, Mac and Windows.
@@treyquattro you're probably right, on modern equipement with modern implementations (Samba has improved a lot in recent years) the difference is probably negligible. If your needs are sharing files between different operating systems, especially if that includes Windows as you did, then go with SMB for sure.
Hello Jay! I must say your content is so good and this video is another great example. I have learnt so much about Linux from you. I sincerely thank you.
@Jay I hit the LIKE button on nearly every one of your vids that come out. I even have them in a 'Linux' playlist on my channel just in case ppl stumble into my channel and are looking to learn things. Or they don't know they want to learn it until they watch the vid/s and then become interested (hopefully!)
This is exactly what I needed to get an NFS share auto-mounted on my database server so I can set up backups. Thanks! One oddity on Proxmox's Debian 12 LXC template: After I installed AutoFS, tweaked the config files, and restarted the service, I was getting an odd error/warning from systemctl status about not being able to load the "autofs.service" key. I'm not sure if that was before I set up the config files or not, but rebooting the client system made it go away and everything worked perfectly.
Thanks Very nice and easy to follow. Triggered some memories (not all good) from end last century and the early days of autfs. What was sunny on Sun had slight overcast on Linux.
actually it's good practice to copy config files instead of moving them, and maybe truncating the m afterwards (depending on how many comments are in there). By doing so, you ensure, that the permissions and ownerships are preserved correctly without even thinking about this. while it may not be a huge problem with /etc/exports, it certainly is on many other config files e.g. within /etc.
I think I'm going to keep coming back to this video. I always seem to have trouble setting up NFS shares every time I need to do it. I usually end up falling back to "whatever works", aka "allow everything", which is usually okay in my closed network, with a short-lived need for a share .... but definitely not ideal.
@LearnLinuxTV Thanks for another great and useful video. Though I don't know if I either missed or misunderstood something because I had to change (chmod) the directories (and files) on the "server", in order to be able to not only read the files, but also write/change files "to the server side". Best regards.
I had the same issue. On the client side not even root was able to write. I used 'chmod o+w /exports/backup' on the server and then it worked. I also tried a second approach and changed ownership of '/exports/backup' (chown) on the server to the same user, that would access the folder/files on the client side. That worked too.
You should have put the map file in the autofs drop in directory /etc/auto.master.d/. It even tells you in the file you were editing. It’s best practice and makes managing it with ansible easier.
I've been playing around with Linux and servers for the last few years now. My question is I've setup a couple of servers with both Ubuntu and RH (rocky) and use manjaro and fedora for clients. The question is how do you configure multiple users on a server to use nfs and samba shares. I know how to add users and groups but is it better to use a database with ldap? I have a zfs share but haven't tried ldap yet. I did run into a weird issue with RH and their use of SELinux. I am completely lost by that service.
NFS has no concept of user and group management or permissions. It only enforces the read-only or read-write configuration options as set on the server or client, with obviously the server taking precedent so an export configured on the NFS server as being read-only can never be written to from any NFS client, even if they mounted the share read-write. NFS relies entirely on the local system for access rights. For example, say you have an NFS server with a share */exports/documents* like in the video. NFS client A mounts this share and the first user that was created on that system writes a file to the share. By default on Ubuntu and most other Linux distributions these days, this first user has UID number 1000, which you can see with the 'id' command. Now NFS client B comes along which was installed by another user, who also has UID 1000 on their system. If they can mount the same */exports/documents* share because they are in the subnet that is configured in the exports file, they can now read, write and delete the file that was put there by the user on NFS client A. They will even see their own username as the owner of that file when using the 'ls -l' command, as if the file was theirs. This is why it's recommended that if you use NFS in any serious capacity, for example in a corporate environment, you also use centralized user management like an Active Directory or FreeIPA. In fact I think it would be nice if this channel made a video with a rudimentary tutorial on how to set up FreeIPA and connect a client to it.
Nice tutorial! The next question that comes to my mind is, how are (advanced) permissions being configured for NFS? for example permissions per user. The NFS server needs to know a username in advance (from a connecting client) to set and enforce permissions right?
excellent video thank you! If your following this video using RHEL8/9. run these commands on NFS machine before you run the showmount command on remote machine. # dnf install nfs-utils # firewall-cmd --permanent --add-service=nfs # firewall-cmd --permanent --add-service=mountd # firewall-cmd --permanent --add-service=rpc-bind these commands will fix the permission denied error and rpc error on client machine
Having a problem with autofs. I spent an hour + trying to troubleshoot. When running the ls command, I get "ls: cannot access '/mnt/nfs/myFolder': No such file or directory". I tried with and without ghost; I tried direct vs indirect mapping ( auto.master /- instead of /mnt/nfs ). The only solution I have found that works in all cases above is to have only 2 fields in my auto.nfs: clientFolder remoteAddr:SharedFolder thus skipping the options field.
Do you know of any way to make this work with the *minimal* Ubuntu cloud image you used in your cloud-init template video? I couldn't get the NFS service to start correctly because of *I think* some kernel dependencies. I'm curious if you've been able to get NFS functioning correctly on the same image you used for the cloud-init video or if you also encounter the same error. Thanks!
I got as far as @12:15 but got a failure message on the "ExecStartPre" with or without the IP details in the exports file. Can I check if the /exports/documents should be under ~ or somewhere else? @12:44 you type "cd /exports", I get no such directory, I have to use "cd ~/exports" The only way I can get the status success is to use /home/bob/exports/documents etc in the exports file. If it makes a difference, I'm using a VM under Proxmox but very new to all this.
Jay, quit reading my mind. I am redoing my freeipa setup and when I was setting up automount, I created a test VM just for NFS home shares. But now when I log into a machine, I feel like automount makes login hang because of the fact that everything is virtualized. But I dug into autofs hard during setting that up.
One question regarding your book; I have the third edition right here (good job on it by the way). Are there significant changes to the 4th edition that would, in your opinion, justify getting it as well?
The main difference is that it was updated to 22.04, so it depends on how much that may be important to you. If that's not too important, than the 3rd edition is totally fine.
I need nfs for my kubernetes cluster for persistant storage. Do I need to install the client on all nodes? Do I need a client to be able to use the nfs server in general? Please share your thoughts.
hey Jay, this was extremely helpful and made the process easy. I had one hiccup earlier in testing that led me to learn a lot more about nfs than I realized. In one of the upcoming videos or in a comment can you discuss what someone has to do with root squashing inputs? I did the nfs on synology and ended up setting Map Root to Admin (root_squash anonuid=1024) which was the universal security suggestion. Only, the nfs 3 write over on the id's and permissions ownership got incredibly dense to understand what to do to both ensure security in the best method vs. ease of use. I ended up rebuilding the nfs client and reset permissions on the nfs synology server to map all users to admin which is an "all_squash and anonuid=1024" and then everything was fine for the user I set up in ubuntu 22.04 if I kept the original root_squash, how would I have securely mapped to the user to get access? Or am I misunderstanding squash still a bit? Thank you!
thanks for video. i dont' understand how you set permissions for user to wright in shared folders, because by default shared folders are created with root:root did you chown?
I set both sides in rw, but the test file is read only same with all the new files i create. Should I chown to me and my group? Or should everything stay root.
As always - this is great info; only root-owned files covered here though - can we change ownership of the Documents or backup to enable access by my user?
Yes you can, that's obviously a valid use-case. However be aware that NFS has no concept of user and group management or permissions, as I've explained in my comment here: ruclips.net/video/Na_jKeVWzrc/видео.html&lc=UgwlAI2lK7VNGJmO-hB4AaABAg.9lU5IGfVW8g9lWMY-Tvb6w So be very mindful of how you want to do your user management when using NFS for user data, especially home directories. Make sure that all users on all of your NFS client machines have a unique UID number.
hello, I was able to mount a file system to the /mnt/htb but when I go to move a file I get a "permission denied". I tried chown 775 for the directory . what would I need to do?
@justin oleary that's where I feel I'm at. This video makes sense and I have been able to configure a similar setup but looking at more advanced setups of I worked at a place that had multiple users and credentials is confusing. That and SELinux make no sense
each time I get: rpc.statd not running but is required for remote locking, either use '-o nolock' to keep locks local, or start statd, Operation not permitted while monting
Hi Jay, thanks for this. It's very timely for me: I'm trying to figure a file sharing strategy principally between Linux and Windows but also Mac. My initial preference is for SMB. I feel file sharing is one area in which Windows is very logical and seamless: having drive letters implicitly identifies what you're connecting to as a device, including a network fileserver which connotes remoteness, or at least separateness from the local file hierarchy. With *nix you have to figure out where the remote device should be represented in the local file hierarchy and it ends up being more verbose, and you can't tell at a glance where the end point of the file/directory/URI is. This points out something else that occurred to me: I automatically expected that you'd be putting the shared directories under /mnt on the NFS server, after all you're mounting a network file system? According to the Linux File System Hierarchy document, we're not supposed to create directories in the root (this is something I've been guilty of for shared files amongst different users on the same machine and I've had to change my ideas). I find this subject one of the more confusing aspects of Linux: just where you're supposed to put private binaries, libraries, and include files for example, and also local applications (they tend to go in /opt, but they could go under /usr/bin!) I presume it's legitimate to use host names (or FQDN) for the server in the mount.nfs file? It'd also be useful (for me anyway) to know if the steps are the same on Fedora using dnf as they were on Ubuntu/Debian (and I dare say others would say similar for Manjaro/Arch/Gentoo etc. e.g.)
I have something to add. I've setup a server and a client, with users and permisions, everything just fine. But when a tried to test de file transfer in the client mount point, i used 'fallocate --length 300M file300' it says "fallocate: fallocate failed: Operation not supported". Anybody knows about this? is not a problem really, is just a test. great video.
autofs with it's many configuration options is considered more flexible, systemd's automount feature is simpler. Personally I like to keep my setups as simple as possible so x-systemd.automount has so far taken care of all my needs.
You forgot to add client side caching of the NFS share. CacheFS. Huge (read) performance boost if you have a few hundred GB unused on your NVMe drive and you access the NFS server over WiFi. Or even remote over a slow VPN.
I followed the video through-and-through except the connection is to a Windows server NFS share. I have no problem connecting to the share but I need sudo to list the share with "df -h" and likewise, I need sudo to list the content of the NFS share. This is the case for both mount and aufofs. Anyone with the same problem? Is this related to the permission on the NFS shared folder on Windows?
nfs and samba is different server, nfs is for linux to linux type servers and samba is for linux to linux and others like windows mac os and some others different also
If you're 100% sure it's not a firewall issue I suggest looking at selinux to assign blame. Try it with selinux turned off on both sides and see how far you get by re-enabling selinux one machine at a time.
I noticed that file permisions for both testfiles where root only. Not very practical 😊 what is the best solution for that? And …. Which ports should be open in my firewall on the nfs server?
You can simply change the file ownership with 'chown'. Do keep in mind though that NFS has no concept of user and group management or permissions, so every NFS client that has access to the share and has a user with the same UID as another client has full access to the file with that UID as it's owner. This means that you want to make sure that all users on all your clients have a unique UID. The best way to enforce this is to use an Active Directory or FreeIPA server for centralized user management. NFS4 uses TCP on port 2049. NFS versions 2 and 3 are more complex, they use mainly UDP and require several services on the server to be accessible. For a simple NFS setup as shown in the video I would always recommand using NFS4.
@@stautonel you're welcome. Another word of warning: due to its simplified nature NFSv4 does not support ACLs, you get POSIX file permissions only. If you rely on ACLs for complex file access (e.g. multiple users and groups with access) you need to properly set up NFSv3. I personally have never done that because I've never had a use case for it.
Very good tutorial. But this is overkill for me. I don't need a dedicated file sharing server, I just need an alternative to Samba, which is a complete mess that always ends up not working at all. And it's not that easy to reinstall it. In short, Samba is a waste of time. Anybody got a good alternative that will make sharing folders between two computers easy?
This video makes me so mad I can't see straight. showmount doesn't work. autofs doesn't work. And the client doesn't have permission to write anything to the folder. I hate Linux, and I HATE people like this who perpertuate Linux crap that doesn't actually work but tries to make it seem like things actually do work. I am so tired of computers being so shitty and dysfunctional.
Good tutorial Jay, but you need to cut the guff out man. Your not getting into the subject until 5 mins in. Plug your book in the middle and cut the Linode stuff at the end, I know they're a sponsor, but every video is feeling like a 3 min ad for them and I just want to see what you've done.
While I appreciate your comment, there's time codes in the description that bypass the intro, so this shouldn't be a problem. Everything I mention needs to be mentioned (for one reason or another). 🙂
I try to set an NFS server to use with Proxmox, but unfortunately i keep getting errors on Proxmox, like "create storage failed: mkdir /mnt/pve/selini/dump: Permission denied at /usr/share/perl5/PVE/Storage/Plugin.pm line 1408. (500)". Any help with that ?
Switched fully from WIndows to Linux Mint last march, and everyday I'm learning how awesome Linux is. Great video. NFS is so much neater than my previous network share setup.
This is so awesome. I tried looking up this int he Ubuntu Server 4th edition. Couldn't find much in the book, but this video was awesome. I ran into a snag when I initially set it up where I kept getting no such file every time I navigated into the /mnt/nfs folder. Turns out I typed the nfs4 option in the fstype in the auto.fs file. Good old fumble fingers.
Been playing around with this for a day now. This is so, so slick. (and fast). Thanks for introducing this. Now if we can get a video on how to configure security and permission for this bad boy, we'd me in for a treat! Whoohoo, you rock!
Great video Jay as always! Please continue with the nfs security in the next one. Thanks!
Agree, would also like to see a video about that from Jay.
I always learn something from your videos. Thank you! I have been using NFS4 and autofs for years, but today I learned about the --ghost option.
I used this to setup AutoFS with a ZFS pool on a local server. The ZFS setup part had extra special sauce, but the autofs was verbatim and extremely useful. Thanks for the video!
I've referred to this guide on a couple of occasions now. Simple and straight to the point. Saves me from through digging through the docs. Thanks
Great video! I run TrueNAS Scale as my file server and was able to get it connected to my Debian docker client. One minor hiccup I had was that AutoFS was not automatically mounting my NFS shares upon access. The solution for this was to change nfs4 to just nfs in the auto.nfs file. It works wonderfully after those changes.
I hope this helps someone! :)
This tutorial came just in time for me, as I was struggling with setting up mpd (music player deamon) to work properly here. I can easily follow and enjoy your way of explaining, although I'm not a native speaker. You're just extremely good at explaining/teaching, please keep it up and many, many thanks!
Glad it helped!
@@LearnLinuxTV And it really did!
I struggles to understand Autofs, your video, explained it all. The latest kind of explanation 👑👑👑👑👑👑
Jay. This was an excellent video and tutorial blog! I already had NFS working from my OMV server to my Debian client, but I was bewildered trying to get autofs to work (I tried afuse as well). Your walk-through explained it clearly. A big THANK-YOU!
My best source to learn Linux content! Thank you for sharing your knowledge. You're the best!!
I watched several videos before this one, to move my shares from Samba to NFS and non of them was so complete.
I need to remember to find tutorial here, at your channel first, before anywhere else.
I set up all from the first try following your video.
Thanks you =)
Perfect timing! Rebuilding my Truenas and Proxmox servers swapping from smb to nfs for the Ubuntu servers. Thank you
can I ask you why you changed from SMB to NFS? I've been debating both: my default position is to go for SMB although I find the client side on Linux to be more difficult than the other way around. I believe I can use NFS from Windows 11 Pro as a client at least. I ideally want bidirectional peer-to-peer file sharing. Windows is very good for this but Linux less so, or at least that's my experience so far. Thanks.
Would also like to know.
@@treyquattro NFS is generally considered to be easier to configure, only a few lines in a config file as you saw in the video. It's also generally faster than SMB. However NFS has no concept of user and group management, so when improperly configured it can be very insecure with regards to your data. Also when you throw Windows into the mix I would generally recommend using SMB. NFS usually is the best choice when you're only dealing with Linux machines and perhaps the occasional Mac.
@@RudyBleeker " It's also generally faster than SMB". Hmm, I'm skeptical of that claim. Got any links to comparison tests? At any rate it would be an insignificant different over a 1Gb LAN or faster. Maybe if as you imply data is not being encrypted that would obviously account for some performance difference, but again it shouldn't be an issue on modern equipment (like 2022/3 era computers). I don't want to be chopping and changing, just use one protocol to share files between Linux, Mac and Windows.
@@treyquattro you're probably right, on modern equipement with modern implementations (Samba has improved a lot in recent years) the difference is probably negligible. If your needs are sharing files between different operating systems, especially if that includes Windows as you did, then go with SMB for sure.
nice work..... I always find autofs confusing when I touch it once every 10 years. You did a great job! great trainer!
Thank you! This made this so simple. I appreciate you making these videos.
Your channel is the place i go to when i need to learn some Linux stuff as i go. Cheers.
Hello Jay! I must say your content is so good and this video is another great example. I have learnt so much about Linux from you. I sincerely thank you.
This is awesome content Jay! Well done sir.
Jesus.. is there a topic on linux you don't cover??? I have been GOGGBLING UP THIS CONTENT! Damn this is tasty helpful content dude.
@Jay
I hit the LIKE button on nearly every one of your vids that come out. I even have them in a 'Linux' playlist on my channel just in case ppl stumble into my channel and are looking to learn things. Or they don't know they want to learn it until they watch the vid/s and then become interested (hopefully!)
This is exactly what I needed to get an NFS share auto-mounted on my database server so I can set up backups. Thanks!
One oddity on Proxmox's Debian 12 LXC template: After I installed AutoFS, tweaked the config files, and restarted the service, I was getting an odd error/warning from systemctl status about not being able to load the "autofs.service" key.
I'm not sure if that was before I set up the config files or not, but rebooting the client system made it go away and everything worked perfectly.
Thanks Very nice and easy to follow. Triggered some memories (not all good) from end last century and the early days of autfs. What was sunny on Sun had slight overcast on Linux.
The content you put out is so valuable 👌
Thank you!
This was a really well made video. Thanks for taking the time to explain this :)
actually it's good practice to copy config files instead of moving them, and maybe truncating the m afterwards (depending on how many comments are in there). By doing so, you ensure, that the permissions and ownerships are preserved correctly without even thinking about this. while it may not be a huge problem with /etc/exports, it certainly is on many other config files e.g. within /etc.
Good video, however definitely need to talk about the security considerations needs to be done before implementing nfs
I think I'm going to keep coming back to this video. I always seem to have trouble setting up NFS shares every time I need to do it. I usually end up falling back to "whatever works", aka "allow everything", which is usually okay in my closed network, with a short-lived need for a share .... but definitely not ideal.
As always, great video. Thank you Jay.
@LearnLinuxTV
Thanks for another great and useful video.
Though I don't know if I either missed or misunderstood something because I had to change (chmod) the directories (and files) on the "server", in order to be able to not only read the files, but also write/change files "to the server side".
Best regards.
I had the same issue. On the client side not even root was able to write. I used 'chmod o+w /exports/backup' on the server and then it worked. I also tried a second approach and changed ownership of '/exports/backup' (chown) on the server to the same user, that would access the folder/files on the client side. That worked too.
Well! I never knew about automount, so thank you so much
This is awesome content, thanks you sir 😍
Excellent explanations ! Thank you Jay.
ps: Thank's for the showmount command tips. I didn't know this command ;-)
Glad to help!
Woo, hyped for this one, thanks!
Edit: I learned a good deal, tyvm!
Glad to hear!
Awesome tutorial! Thanks for this.
The best doing it!!!Thank you!!!🏆
You should have put the map file in the autofs drop in directory /etc/auto.master.d/. It even tells you in the file you were editing. It’s best practice and makes managing it with ansible easier.
People should be using systemd with fstab now, autofs is no longer on the arch repos because of it
Great video. Very informative and I will try this.
Thanks. Super clear & helpful - as always.
I've been playing around with Linux and servers for the last few years now. My question is I've setup a couple of servers with both Ubuntu and RH (rocky) and use manjaro and fedora for clients. The question is how do you configure multiple users on a server to use nfs and samba shares. I know how to add users and groups but is it better to use a database with ldap? I have a zfs share but haven't tried ldap yet. I did run into a weird issue with RH and their use of SELinux. I am completely lost by that service.
I would appreciate more information on user permissions and groups within NFS.
NFS has no concept of user and group management or permissions. It only enforces the read-only or read-write configuration options as set on the server or client, with obviously the server taking precedent so an export configured on the NFS server as being read-only can never be written to from any NFS client, even if they mounted the share read-write.
NFS relies entirely on the local system for access rights. For example, say you have an NFS server with a share */exports/documents* like in the video. NFS client A mounts this share and the first user that was created on that system writes a file to the share. By default on Ubuntu and most other Linux distributions these days, this first user has UID number 1000, which you can see with the 'id' command. Now NFS client B comes along which was installed by another user, who also has UID 1000 on their system. If they can mount the same */exports/documents* share because they are in the subnet that is configured in the exports file, they can now read, write and delete the file that was put there by the user on NFS client A. They will even see their own username as the owner of that file when using the 'ls -l' command, as if the file was theirs.
This is why it's recommended that if you use NFS in any serious capacity, for example in a corporate environment, you also use centralized user management like an Active Directory or FreeIPA. In fact I think it would be nice if this channel made a video with a rudimentary tutorial on how to set up FreeIPA and connect a client to it.
Nice tutorial! The next question that comes to my mind is, how are (advanced) permissions being configured for NFS? for example permissions per user. The NFS server needs to know a username in advance (from a connecting client) to set and enforce permissions right?
Yea I've trying to figure out how has works as well.
Do users have to have the same UID OR GUID. Aldi
excellent video thank you! If your following this video using RHEL8/9. run these commands on NFS machine before you run the showmount command on remote machine.
# dnf install nfs-utils
# firewall-cmd --permanent --add-service=nfs
# firewall-cmd --permanent --add-service=mountd
# firewall-cmd --permanent --add-service=rpc-bind
these commands will fix the permission denied error and rpc error on client machine
Great video, thank you. 👍
Thank you Jay.
Great video thank you very much for sharing this was extremely helpful.? Do you have a video that shows NFS storage with DRBD?
Very helpful thanks
Great Vid, do you also have tutorial on how to access this NFS on a Windows client?
Having a problem with autofs. I spent an hour + trying to troubleshoot. When running the ls command, I get "ls: cannot access '/mnt/nfs/myFolder': No such file or directory". I tried with and without ghost; I tried direct vs indirect mapping ( auto.master /- instead of /mnt/nfs ).
The only solution I have found that works in all cases above is to have only 2 fields in my auto.nfs: clientFolder remoteAddr:SharedFolder thus skipping the options field.
Thanks for sharing
Jay my brother, can you please make a video on RAID setup, crash and recovery ?
Thank you
Do you know of any way to make this work with the *minimal* Ubuntu cloud image you used in your cloud-init template video? I couldn't get the NFS service to start correctly because of *I think* some kernel dependencies. I'm curious if you've been able to get NFS functioning correctly on the same image you used for the cloud-init video or if you also encounter the same error. Thanks!
please create an other video on NFS mounts with krb5 security
yOU ARE GREAT!!
I got as far as @12:15 but got a failure message on the "ExecStartPre" with or without the IP details in the exports file.
Can I check if the /exports/documents should be under ~ or somewhere else?
@12:44 you type "cd /exports", I get no such directory, I have to use "cd ~/exports"
The only way I can get the status success is to use /home/bob/exports/documents etc in the exports file.
If it makes a difference, I'm using a VM under Proxmox but very new to all this.
Thank you for your video
Thanks!
Jay, quit reading my mind. I am redoing my freeipa setup and when I was setting up automount, I created a test VM just for NFS home shares. But now when I log into a machine, I feel like automount makes login hang because of the fact that everything is virtualized. But I dug into autofs hard during setting that up.
One question regarding your book; I have the third edition right here (good job on it by the way). Are there significant changes to the 4th edition that would, in your opinion, justify getting it as well?
The main difference is that it was updated to 22.04, so it depends on how much that may be important to you. If that's not too important, than the 3rd edition is totally fine.
@@LearnLinuxTV Thanks for the honest response.
I need nfs for my kubernetes cluster for persistant storage.
Do I need to install the client on all nodes? Do I need a client to be able to use the nfs server in general?
Please share your thoughts.
hey Jay, this was extremely helpful and made the process easy. I had one hiccup earlier in testing that led me to learn a lot more about nfs than I realized. In one of the upcoming videos or in a comment can you discuss what someone has to do with root squashing inputs? I did the nfs on synology and ended up setting Map Root to Admin (root_squash anonuid=1024) which was the universal security suggestion. Only, the nfs 3 write over on the id's and permissions ownership got incredibly dense to understand what to do to both ensure security in the best method vs. ease of use. I ended up rebuilding the nfs client and reset permissions on the nfs synology server to map all users to admin which is an "all_squash and anonuid=1024" and then everything was fine for the user I set up in ubuntu 22.04
if I kept the original root_squash, how would I have securely mapped to the user to get access? Or am I misunderstanding squash still a bit? Thank you!
thanks for video. i dont' understand how you set permissions for user to wright in shared folders, because by default shared folders are created with root:root
did you chown?
I set both sides in rw, but the test file is read only same with all the new files i create. Should I chown to me and my group? Or should everything stay root.
As always - this is great info; only root-owned files covered here though - can we change ownership of the Documents or backup to enable access by my user?
Yes you can, that's obviously a valid use-case. However be aware that NFS has no concept of user and group management or permissions, as I've explained in my comment here: ruclips.net/video/Na_jKeVWzrc/видео.html&lc=UgwlAI2lK7VNGJmO-hB4AaABAg.9lU5IGfVW8g9lWMY-Tvb6w
So be very mindful of how you want to do your user management when using NFS for user data, especially home directories. Make sure that all users on all of your NFS client machines have a unique UID number.
after installing autofs. If you can see the directories but cant access them try updating. trying to save you guys some time
hello, I was able to mount a file system to the /mnt/htb but when I go to move a file I get a "permission denied". I tried chown 775 for the directory . what would I need to do?
Can you do an advanced nfsv4 setup with Kerberos encryption and other advanced features?
Very possible! I'm not sure (yet) where something like that may land on my list but it's a great idea!
@@LearnLinuxTV thanks that would be awesome also nfsv4 acls are complicated as hell
@justin oleary that's where I feel I'm at. This video makes sense and I have been able to configure a similar setup but looking at more advanced setups of I worked at a place that had multiple users and credentials is confusing. That and SELinux make no sense
each time I get: rpc.statd not running but is required for remote locking, either use '-o nolock' to keep locks local, or start statd, Operation not permitted while monting
Hi Jay, thanks for this. It's very timely for me: I'm trying to figure a file sharing strategy principally between Linux and Windows but also Mac. My initial preference is for SMB. I feel file sharing is one area in which Windows is very logical and seamless: having drive letters implicitly identifies what you're connecting to as a device, including a network fileserver which connotes remoteness, or at least separateness from the local file hierarchy. With *nix you have to figure out where the remote device should be represented in the local file hierarchy and it ends up being more verbose, and you can't tell at a glance where the end point of the file/directory/URI is.
This points out something else that occurred to me: I automatically expected that you'd be putting the shared directories under /mnt on the NFS server, after all you're mounting a network file system? According to the Linux File System Hierarchy document, we're not supposed to create directories in the root (this is something I've been guilty of for shared files amongst different users on the same machine and I've had to change my ideas). I find this subject one of the more confusing aspects of Linux: just where you're supposed to put private binaries, libraries, and include files for example, and also local applications (they tend to go in /opt, but they could go under /usr/bin!)
I presume it's legitimate to use host names (or FQDN) for the server in the mount.nfs file? It'd also be useful (for me anyway) to know if the steps are the same on Fedora using dnf as they were on Ubuntu/Debian (and I dare say others would say similar for Manjaro/Arch/Gentoo etc. e.g.)
I have something to add.
I've setup a server and a client, with users and permisions, everything just fine.
But when a tried to test de file transfer in the client mount point, i used 'fallocate --length 300M file300' it says "fallocate: fallocate failed: Operation not supported". Anybody knows about this? is not a problem really, is just a test.
great video.
Would love to see High availability with something like this
Can you explain what the difference is with autofs vs using x-systemd.automount?
autofs with it's many configuration options is considered more flexible, systemd's automount feature is simpler. Personally I like to keep my setups as simple as possible so x-systemd.automount has so far taken care of all my needs.
Great response to the question, thank you! I'll also go a step further and mention that AutoFS will work on non-systemd distributions as well.
everytime i run the command 'sudo apt install nfs-kernel-server' it gives me an error and says theres also no installation candidate. any suggestions?
I'm trying to automount my ~/Documents directory but what happens is that my whole home directoy is then empty...
You forgot to add client side caching of the NFS share. CacheFS. Huge (read) performance boost if you have a few hundred GB unused on your NVMe drive and you access the NFS server over WiFi. Or even remote over a slow VPN.
I followed the video through-and-through except the connection is to a Windows server NFS share. I have no problem connecting to the share but I need sudo to list the share with "df -h" and likewise, I need sudo to list the content of the NFS share. This is the case for both mount and aufofs.
Anyone with the same problem? Is this related to the permission on the NFS shared folder on Windows?
Just wondering, since NFS servers are used for clients to access data/files from the server, how is it different from a samba/smb server?
nfs and samba is different server, nfs is for linux to linux type servers and samba is for linux to linux and others like windows mac os and some others different also
Followed your steps on a Rhel machine was getting error “mount.nfs:access denied by server while mounting iP
If you're 100% sure it's not a firewall issue I suggest looking at selinux to assign blame. Try it with selinux turned off on both sides and see how far you get by re-enabling selinux one machine at a time.
I noticed that file permisions for both testfiles where root only. Not very practical 😊 what is the best solution for that? And …. Which ports should be open in my firewall on the nfs server?
You can simply change the file ownership with 'chown'. Do keep in mind though that NFS has no concept of user and group management or permissions, so every NFS client that has access to the share and has a user with the same UID as another client has full access to the file with that UID as it's owner. This means that you want to make sure that all users on all your clients have a unique UID. The best way to enforce this is to use an Active Directory or FreeIPA server for centralized user management.
NFS4 uses TCP on port 2049. NFS versions 2 and 3 are more complex, they use mainly UDP and require several services on the server to be accessible. For a simple NFS setup as shown in the video I would always recommand using NFS4.
@@RudyBleeker bedankt
@@stautonel you're welcome. Another word of warning: due to its simplified nature NFSv4 does not support ACLs, you get POSIX file permissions only. If you rely on ACLs for complex file access (e.g. multiple users and groups with access) you need to properly set up NFSv3. I personally have never done that because I've never had a use case for it.
Very good tutorial. But this is overkill for me. I don't need a dedicated file sharing server, I just need an alternative to Samba, which is a complete mess that always ends up not working at all. And it's not that easy to reinstall it. In short, Samba is a waste of time. Anybody got a good alternative that will make sharing folders between two computers easy?
This video makes me so mad I can't see straight. showmount doesn't work. autofs doesn't work. And the client doesn't have permission to write anything to the folder. I hate Linux, and I HATE people like this who perpertuate Linux crap that doesn't actually work but tries to make it seem like things actually do work. I am so tired of computers being so shitty and dysfunctional.
Good tutorial Jay, but you need to cut the guff out man. Your not getting into the subject until 5 mins in. Plug your book in the middle and cut the Linode stuff at the end, I know they're a sponsor, but every video is feeling like a 3 min ad for them and I just want to see what you've done.
While I appreciate your comment, there's time codes in the description that bypass the intro, so this shouldn't be a problem. Everything I mention needs to be mentioned (for one reason or another). 🙂
I try to set an NFS server to use with Proxmox, but unfortunately i keep getting errors on Proxmox, like "create storage failed: mkdir /mnt/pve/selini/dump: Permission denied at /usr/share/perl5/PVE/Storage/Plugin.pm line 1408. (500)". Any help with that ?