/home on a NAS and fallback options
I just bought a nice Synology NAS and I'm planning on copying my current /home partition to the NAS and mounting my home directory from the NAS. The only issues I can see would be if for some reason it doesn't mount I'd be left without a home directory. I think this isn't a real problem but I still would like to have my speculation verified if possible.
If I copy the /home to the NAS I can then remove everything under my current /home but leave .bashrc and perhaps some other dot files just in case it doesn't mount (for whatever reason) then I can login and work anyway? Does this sound correct? Also, what about having a message like echo Local login, check NAS or something like that in the .bashrc that I leave on the local filesystem? Wold that work. Is there a better way to do this. Been using Linux for years but for some reason never had to deal with this situation before. |
Quote:
----------------------------- some basic info about NAS |
Quote:
|
If you have more than one computer, mounting /home from a NAS is a terribly bad idea if you run a GUI. Imagine running KDE4.3 on one machine and KDE4.4 on the next. Or if you have certain .*rc files which need to be specific to one computer. I take the effort to create a mount point /mnt/mynas/home/myname and keep all /home directories local. I once thought it was a nice idea, did it as well, and know better now.
jlinkels |
Good point. This is exactly the kind of information I was looking for. Thanks. I only have the one computer now but that is sure to change. I like your solution and may do the same. I guess the goal is to both isolate my home directory from upgrades or re-installs but also to allow for the exact same setup on every computer I own. Of course, laptops do pose a challenge of their own. It seems more research is in order.
|
Not what I wanted to hear!
Quote:
I'm trying to figure out how to integrate my NAS into the two (or three if count by OS) computers I have. It needs to be simple since most of the household doesn't care what's running as long as they can get their e-mail and find their photos or music on the NAS drive. I thought mounting the NAS' home share over each computer's /home directory would be a brilliant solution. But I see your point and agree it would probably cause more problems (configs, caches, etc. would probably get corrupted or at least generate a lot of warnings and errors). So what's a good solution to keep per user machine specific configs separate but user content shared without requiring an advanced degree computer science?! Thanks, |
Create a mount point for the NAS and mount it there. It'll look like a part of the hard disk. You can tune most programs so they use this folder as default directory.
If you are running Windows machines (better don't), either install NFS clients on the windows machines (but that is uncommon) or install Samba on the NAS. All NASes support that. As for e-mail, Outlook don't let you store your mail folder where you want it. Use another e-mail client like Thunderbird which does, or even better use IMAP so the mail never reaches your computer. jlinkels |
I need more details...
Quote:
And what about the user's personal data from the NAS, I'm thinking that should be mounted in their home directory? Like /home/username/netdata I've looked at the FHS but it's not much help. The other question is how do I do the mounting since access to the NAS requires a username & password but I'd like those shares on the NAS to be mounted automagically whenever the user logs in. I don't think I could just put them into the /etc/fstab file so I'm thinking they need to go into some file that is run whenever the user logs in - but I don't know which one. Or is there another way of doing this? Is automount a viable solution? Quote:
Quote:
Thanks, |
I have gone ahead and done it but with only one computer. I'm using autofs with /etc/auto.home configured
* server_ip:/volume1/homes/& This will mount the home account from my NAS for the user at login. It took a little planning and backing up and I still have my old /dev/sda1 partition that was /home and I'm thinking of rsyncing it using cron with the one on the NAS (at least for now) until I see if this will be a good solution. |
I have all my networked machines running a NAS like /home. Performance with GUIs is only slightly slower, and usually unnoticeable. I'm not actually using a NAS, but rather a NFS mount to a server.
|
Maybe it is just a matter of working the kinks out but I've had quite a bit of unreliable behavior since I started mounting /home from the NAS using autofs. I do still plan to pursue this strategy but ultimately what I need is a failover /home. I"m not sure how to do it yet. What I don't want is instability. I need to be able to login consistently without problems.
I'm hoping that something like this would work: 1. create a directory off off of / called home 2. put a directory in there for my user account. /home/mark 3. add .bashrc to the home directory with basic settings. 4. use autofs to mount my real home directory from the NAS overlaid on top of the existing /home 5. on failure the /home/mark directory would still be there and would work as a emergency home directory. Perhaps I could even add a echo line to the end of .bashrc that would print something like: "NAS /home directory did not mount successfully, please check" I could also use some NFS expert advice on making sure that the occasional network restart doesn't lock up my computer or cause loss of data. Getting the right set of options for NFS seems crucial. |
Try NFS from your /etc/fstab configuration
Quote:
I dont' think autofs is the right solution for mounting your /home. I think autofs is used for those directories you only need occasionally and don't need to be mounted until you actually try to use them. For mounting /home I think it should be mounted at boot time as part of the start-up process. That may mean having to use NFS or something that can handle linux/Unix file permissions (I'm not sure if Samba/CIFS can do that properly). Do a man nfs in the terminal and it will show you how to setup your /etc/fstab file. I've never done it so I'm afraid I can't give you a working example. |
Yes, I'm using NFS exclusively. You may have a point about autofs for home even though there does seem to be support for using it in this way. The instructions for doing so are even a part of the man page (wildcard secion)
-Mark |
This is an example of mounting an NFS drive thru fstab:
Code:
smc1.rnbxxxx.com:/home /mnt/smc1/home nfs rw,user 0 0 Autofs is a bad idea anyway. It just mounts when you need to access the file system. You need a fixed connection. That having said, there are two ways to connect to NFS, UDP and TCP. TCP is unforgiving, if the server cannot be reached, your computer will hang if /home needs to be accessed until you can access it. UDP is more forgiving, but I don't know how exactly. You'll find docs about that on Google. The question is whether you really want a sloppy mount on /home. In Linux it is possible to mount critical directories into your file system because mounts are considered reliable. Not being there is not an option, therefor the system hangs when a mount fails. If you start to accept that mounts sometimes are not there as expected you might damage your system. jlinkels |
Change the XDG environment variables
Quote:
|
All times are GMT -5. The time now is 11:29 AM. |