LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 03-29-2014, 08:21 AM   #1
alanhr
LQ Newbie
 
Registered: Aug 2008
Distribution: Crunchbang Waldorf, Arch
Posts: 23

Rep: Reputation: 15
Best way to merge /home and / while keeping data on separate volume


I currently have a /home partition that is shared between two different distros. This is causing conflicts between local config files, so now I want to have my /home directory on the same volume as root, mount my data in /mnt/data (for example), and use symlinks in the user directories (e.g., /home/alanhr) to point to directories in /mnt/data that I wish to have commonly available between the two distros. I am having trouble figuring out the best way to merge /home and / while keeping my data on the separate partition.

Here is what I am thinking right now:
  • Login as root, perhaps in recovery mode.
  • Delete the existing user account.
    Code:
    userdel alanhr
  • Unmount /home and remount it as /mnt/data.
  • Make a new /home directory.
  • Create a skeleton user account.
    Code:
    useradd -m alanhr
  • Generate symlinks from /home/alanhr to /mnt/data.
  • Edit fstab so data partition is mounted to /mnt/data instead of /home.
  • Test and repeat for second distro.

I should add that I have a lot of cruft in my local config files, so I want to generate the appropriate skeleton files for each distro -- hence the useradd command.

Is this the right approach, or am I missing something?

Thanks!
 
Old 03-29-2014, 11:22 AM   #2
itsgregman
Member
 
Registered: Jan 2008
Location: North Carolina
Distribution: Slackware 14.1
Posts: 207

Rep: Reputation: 60
When using a common /home partition between two different distros you should always use different user names, for example in your case alanhr for one and maybe alhr or alanhr1 for the other, that way you don't get conflicts with common config files.

To move your user to your / partition simply remove it then edit fstab and remove the entry for the /home partition, log out then back in as root and recreate your user, that should create your new user directory on the / partition.
I'm not sure what your trying to do with systemlinks.
 
Old 03-30-2014, 03:02 PM   #3
alanhr
LQ Newbie
 
Registered: Aug 2008
Distribution: Crunchbang Waldorf, Arch
Posts: 23

Original Poster
Rep: Reputation: 15
Thanks for the reply. In the end I did it exactly as I described in my initial post and everything worked out fine. The idea was to get rid of the /home partition and simply have a data partition being shared between distros, so now I have two distros, each with its own /home directory on the root partition. I have mounted the data partition on /mnt/data and inside of the /home/user partitions I have symlinks pointing to the relevant directories in /mnt/data (e.g., /home/user1/documents is symlinked to /mnt/data/documents on each distro).
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving /home to another volume breaks ext3 Trash on new volume uncleboarder Linux - General 3 10-01-2010 11:59 PM
separate out documents/data and configuration files Home anillohchab007 Linux - Laptop and Netbook 7 11-04-2008 12:55 AM
awk command to merge columns from two separate files into single file? johnpaulodonnell Linux - Newbie 4 01-23-2007 11:10 AM
keeping volume settings on logout rdanda Slackware 1 04-12-2003 03:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:32 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration