Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-15-2015, 02:27 PM
|
#1
|
Senior Member
Registered: Jun 2011
Location: NOVA
Distribution: Debian 12
Posts: 1,071
|
Help me with sym links
If I were to copy all of my home folders to another hard drive then created sym links to the new location all data save would go to the second drive correct?
|
|
|
12-15-2015, 03:18 PM
|
#2
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,887
|
Consider what a "symbolic link" actually is. "It's a very-tiny disk file which has a file-name in it." When Linux sees that you've used a symlink in your file-reference, it simply grabs that file-name and substitutes it, then tries once again to find the target file or directory.
With regard to home folders, I think that a wiser approach would be to update the user-definition to point directly to the new home-folder location. I'm not persuaded that Linux will honor a symbolic reference to the user's "home." (I anticipate that it might make an exception, in the name of security ...)
As an experiment, make one dummy user, then move his home-directory, update the user to point to the new location, and verify that it worked. (The user should not be logged-on at the time.)
|
|
1 members found this post helpful.
|
12-15-2015, 03:39 PM
|
#3
|
Member
Registered: Oct 2014
Location: Cyberinternetspace
Distribution: Slackware, mostly
Posts: 49
Rep:
|
You don't want to do this. You are going to want to update your /etc/fstab so that /home is mounted from the second drive. You can copy or move the contents over to a directory, like /home.bak and then copy it in to your newly mounted /home on your second drive.
Last edited by fu9ar; 12-15-2015 at 04:04 PM.
|
|
|
12-16-2015, 07:43 AM
|
#4
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,895
|
Yes, use the usermod command to alter the location of you home directory. Use the -m option so it will move your current home contents to the new location.
If you're unsure, create a test user account and perform the command to verify how things happen.
|
|
|
12-17-2015, 04:54 AM
|
#5
|
Senior Member
Registered: Jun 2011
Location: NOVA
Distribution: Debian 12
Posts: 1,071
Original Poster
|
so usermod -d -m then path to new drive?
|
|
|
12-17-2015, 07:08 AM
|
#6
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,895
|
Quote:
Originally Posted by Germany_chris
so usermod -d -m then path to new drive?
|
Yes, that is correct. As previously suggested, make a new temporary user, execute this command, and verify it operates as expected so there will be no surprises. You'll also have to use "sudo" because this should be performed as root.
|
|
|
12-17-2015, 08:47 AM
|
#7
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,887
|
To clarify: "the path to the new home directory on the new drive."
Specify the complete path to where the home directory is now to be located.
The user should not be logged-in at the time. If so, s/he should log off and log back in.
|
|
|
12-18-2015, 03:43 AM
|
#8
|
Senior Member
Registered: Jun 2011
Location: NOVA
Distribution: Debian 12
Posts: 1,071
Original Poster
|
The -m option creates the new directory if there isn't one according to the man? I was going to do this last night but go distracted try to figure out why x suddenly decided it wanted to start locking up randomly
|
|
|
All times are GMT -5. The time now is 03:42 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|