In this video, Kevin Dankwardt solves the challenges and demonstrates how to configure NFS in sync mode and to test its behavior with processes sharing an open file. He then shows how to compare the performance and convenience of scp and SSHFS.
- [Instructor] All right, let's try those challenges. The first one was make the export have sync in it. So let's check that out. I added the sync keyword in there and I made sure that I restarted nfs. And now we want to mount that twice. There we go. And let's mount it again to a second directory.
Let's make sure that the file is empty. And let's run our program twice We'll have this guy print an A and he'll go to sdir1. And we'll have this guy go through sdir2, and he'll print a B and they'll both run in the background. So they should be both running here at the same time, printing A's and B's.
And let's look at what's happening to our file. Let's see if we're getting 'em nicely interleaved. So far nothing. What's going on? Why aren't we seeing anything? Look at that, curious. Oh, finally something showed up. NFS server finally wrote something. Wrote a B and now it's writing lots of A's. Curious. Alright, so we can't really depend on exactly how those things are going to get updated.
So something to keep in mind, be careful with nfs. Let's look at sshfs, and let's do a quick little experiment of timing something. So we can copy. Now let's make sure I don't have it, okay. So we're going to copy that file over and time it from a different computer on the network here. It's also timing how long it took me to type in the password but that's just a couple of seconds.
Okay, so we can see the estimate there is just over a minute to use scp. And this iso is, I think it's like seven and a half gig. So it does take a little while. So it's a reasonable test for such a simple little benchmark here. There we go. It took a minute and eight seconds or so. So let's remove that again.
Now the interesting part, let's use sshfs. Sshfs guest at that computer. We'll mount guest home directory on bhome and we go into bhome and we're going to time copying that iso to tmp just like we did before. I didn't have to type the password in again so it saved a couple of seconds there. And maybe that's convenient.
Once you've mounted it you can work with all the files without having to do an ssh or an sap command again and type your password in again. If I'd set it up so I didn't require a password, then I would've saved that little bit of time and convenience. It's a little more mysterious now, we're not getting the feedback. There we go. It took about the same amount of time. And maybe it's easier. In general, sshfs is really pretty convenient.
- Partitioning storage
- Creating, mounting, and unmounting file systems
- Formatting file systems
- Making volumes with LVM
- Adding storage security
- Managing swap spaces
- Backing up and recovering Linux storage systems
- Working with networked file systems like NFS and SSHFS