LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   symlink home-directory? (http://www.linuxquestions.org/questions/linux-general-1/symlink-home-directory-408349/)

SteQve 01-26-2006 04:03 PM

symlink home-directory?
 
I have 2 harddrives in my computer. One with the dist, and one with movies, mp3, projects and so on.

My username is steqve and I'd like to put my home-dir on the multimedia-disk.

So when I install a new dist, I can format the 1:st hdd, and still have all important data on disk 2. When I have installed a new dist, I insert disk 2 and symlink to the "home" directory there.

Question:
Can i symlink /home/steqve to /multimedia/home/steqve without any problems?

Richie55 01-26-2006 04:40 PM

Mot too sure about the answer to your question, but I use mandrake and in kcontrol then paths these is an option to change the paths of certain locations and your home directory is one of them. I assume suse is similar. If not someone here must know the file to edit to do the same thing but I'm afraid I don't. Would this not do what you want to?

gilead 01-26-2006 04:42 PM

From memory, the HOME variable is populated from /etc/passwd. You could try just changing the entry in /etc/passwd if you wanted to manually move the files over. Alternatively, you could use:

Code:

usermod -d /multimedia/home/steqve -m steqve
This would move the files from their existing location to the new one.

I haven't tried this, but the following is from the man page for usermod (on Slackware 10.2):

Quote:

NAME
usermod - Modify a user account

SYNOPSIS
usermod [-c comment] [-d home_dir [-m]]
[-e expire_date] [-f inactive_time]
[-g initial_group] [-G group [,...]]
[-l login_name] [-p passwd]
[-s shell] [-u uid [-o]] [-L|-U] login

DESCRIPTION
The usermod command modifies the system account files to reflect the changes that are speci-
fied on the command line. The options which apply to the usermod command are:

[snip]

-d home_dir
The user's new login directory. If the -m option is given the contents of the cur-
rent home directory will be moved to the new home directory, which is created if it
does not already exist.
[snip]


All times are GMT -5. The time now is 08:24 PM.