Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

is it possible to use network storage locations as mount points during installation?

cause i want to separate system (ubuntu) with data (personal files).

eg. if i have 5 computers i don't want to recreate /home/david 5 times.

so i want to mount networkdrive/home to /home in local ubuntu server.

so ALL users home folders could be used and maybe also networkdrive/projects to /projects.

in that way its ok if i by accident repartitioned the local ubuntu server cause all data is not there on that server, but in the data server.

is separating "data" from "logic" good in this case?

and is it possible? what protocol should i use for the mapping over internet? (maybe the server is in Sweden, and the data is in Norway). thanks.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

It's definitely possible, however you will only be able to the one user at a time (meaning, you can't have 5 people using the same directory).

What you're asking to do is like a roaming profile in Windows, however it's much more simpler to do this in linux as you can even use Samba (SMB, Windows networked shares, CIFS) to achieve this easily by mounting the home directory off a networked drive through fstab on the client machines.

First of all you have to create the directory that you want shared on the server. Leave the directory empty and share the directory through samba. When you first log in from the client PC, the client PC will create the necessary folders and files. Make sure that the permissions for the directory are set up correctly so that you don't get writing errors from the client PC trying to write to a directory that it doesn't have permission for.

Depending on your configuration, your /home directory might be on a separate partition from the rest of the OS, so you may have to remove that entry from the fstab file (located in /etc/fstab by the way), otherwise just rm -rf everything in /home/ to remove and delete everything in there. Be careful that you aren't deleting something that you don't want deleted because this step is irrevocable. You could also just back up the existing profiles to another space in the file system, perhaps /root/backeduphome or something.

Add an entry in your fstab to mount the samba share to /home/. An entry might look like this:

//ubuntuservername/homedirectoryshare /home cifs user,uid=500,rw,suid,username=sushi,password=yummy 0 0

although there are tons of different options for the fstab entries, but I would probably make sure that you have to use a password and username so that your home directory isn't available to anyone who can access that Windows share! This fstab entry isn't perfect either because it stores in plaintext the password for your user, so I would advise researching a better method for the fstab entry.

As soon as you can mount the drive, just create a new user from the client PC and it should all be transitive for the client PC from there.

Of course, the limiting factor here is that you may only be logged in once and there is no protection from other people accidentally logging in while you're in. A solution for this is to limit connections for that share, sure, but if you want to be logged in from multiple points you're going to have to lose any form of saving preferences (meaning, every time that you log in the /home profiles are copied over) or use some other solution that I'm not aware of.

This is a very naive method for achieving what you want and it won't work well on anything but a firewalled LAN. As soon as you decide to expose this to the internet you'll run into problems, unless you have it set to connect to a VPN or something along those lines. A good look into this topic has been discussed before, see this thread for a dip and google 'linux roaming profile' for other solutions.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.