LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 01-09-2011, 12:37 PM   #1
mfaine
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Rep: Reputation: 1
/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.
 
Old 01-09-2011, 01:02 PM   #2
yooy
Senior Member
 
Registered: Dec 2009
Posts: 1,217

Rep: Reputation: 139Reputation: 139
Quote:
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?
I assume linux would look for home at some place, not first at some place and than another. Notification about "/home unavailable" seem better solution to me.


-----------------------------
some basic info about NAS
 
Old 01-09-2011, 04:13 PM   #3
mfaine
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by yooy View Post
I assume linux would look for home at some place, not first at some place and than another. Notification about "/home unavailable" seem better solution to me.


-----------------------------
some basic info about NAS
Yes, if I mount the NAS to /home and it doesn't mount the /home directory will still exist and will still contain basic home directories and files.
 
Old 01-09-2011, 05:58 PM   #4
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
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
 
1 members found this post helpful.
Old 01-10-2011, 12:15 AM   #5
mfaine
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 1
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.
 
Old 01-13-2011, 04:18 PM   #6
schultzter
Member
 
Registered: Sep 2009
Distribution: Arch Linux
Posts: 40

Rep: Reputation: 3
Not what I wanted to hear!

Quote:
Originally Posted by jlinkels View Post
If you have more than one computer, mounting /home from a NAS is a terribly bad idea if you run a GUI.
That makes a lot of sense, unfortunately.

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,
 
Old 01-13-2011, 07:55 PM   #7
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
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
 
Old 01-13-2011, 11:22 PM   #8
schultzter
Member
 
Registered: Sep 2009
Distribution: Arch Linux
Posts: 40

Rep: Reputation: 3
I need more details...

Quote:
Originally Posted by jlinkels View Post
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.
Yeah, I get that; but is there a standard/common/recommended location to mount things like photos, videos, music, documents, etc. from a NAS? I'm thinking something like /media/pictures, ... The directories will read/write so I wouldn't put them in a tree that is typically read-only (like /usr).

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:
Originally Posted by jlinkels View Post
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.
My NAS supports CIFS (Samba), NFS, and a few others. I'm fine with using CIFS since there will occasionally be Windows machines accessing them (like my work laptop) but I could use NFS and CIFS if necessary.

Quote:
Originally Posted by jlinkels View Post
All NASes support that.
All categorical statements are false!

Thanks,
 
Old 01-14-2011, 09:47 AM   #9
mfaine
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 1
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.
 
Old 01-15-2011, 08:29 AM   #10
linuxbird
Member
 
Registered: Feb 2006
Distribution: Slackware
Posts: 316

Rep: Reputation: 20
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.
 
Old 01-16-2011, 10:06 AM   #11
mfaine
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 1
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.

Last edited by mfaine; 01-16-2011 at 10:07 AM.
 
Old 01-16-2011, 08:37 PM   #12
schultzter
Member
 
Registered: Sep 2009
Distribution: Arch Linux
Posts: 40

Rep: Reputation: 3
Try NFS from your /etc/fstab configuration

Quote:
Originally Posted by mfaine View Post
I've had quite a bit of unreliable behavior since I started mounting /home from the NAS using autofs.
I'm not the expert here, but I'm working on it.

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.
 
Old 01-17-2011, 12:24 AM   #13
mfaine
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 1
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
 
Old 01-17-2011, 10:07 AM   #14
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
This is an example of mounting an NFS drive thru fstab:

Code:
smc1.rnbxxxx.com:/home                  /mnt/smc1/home          nfs     rw,user         0       0
The mount point is /mnt/smc1/home. As you can see I do not mount my home directory, but mount it on a different location.

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
 
Old 01-20-2011, 12:27 AM   #15
schultzter
Member
 
Registered: Sep 2009
Distribution: Arch Linux
Posts: 40

Rep: Reputation: 3
Change the XDG environment variables

Quote:
Originally Posted by jlinkels View Post
If you have more than one computer, mounting /home from a NAS is a terribly bad idea if you run a GUI.
I may be totally off-base here, but I was trying to solve a totally un-related issue with Skype and I wondered if the solution to this problem might be changing the default XDG environment variables to point to somewhere different?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interpretation required for '(none) dhcpd: Sending on Socket/fallback/fallback-net' ttomsant Linux - Newbie 0 04-07-2009 03:31 PM
is this hardware for home storage (NAS) ok? OS: latest centos or fedora Yaniv-Fer Linux - Hardware 6 10-16-2008 06:19 PM
Home folder setup with a NAS trbelmore Linux - Server 1 10-10-2008 05:37 PM
Totally securing a home server and NAS meles meles Linux - Security 3 07-10-2006 01:31 PM
Linux Home on Windows NAS Box Pravat Linux - Networking 1 04-02-2006 05:05 PM


All times are GMT -5. The time now is 02:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration