LinuxQuestions.org
Help answer threads with 0 replies.
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 07-04-2007, 02:23 PM   #1
arijit_2404
Member
 
Registered: Jul 2007
Location: Kolkata, India
Distribution: Fedora 9
Posts: 85

Rep: Reputation: 15
Post Can I move /home partition under root partition


I've feisty(/) installed in my pc. My HDD has one more free partition,
on which I want to install a different distro for evaluation.(so that
partition will be formatted at regular interval)

here's current hdd structure:
sda1: ubuntu root(8 GB)
sda2: swap (1 GB)
sda3: ubuntu /home (125 GB)
sda5(logical): reserved partition for distro testing (22 GB)

but during evaluation I may download/create files in the second OS.
So I want to store those files in one common partition. for that reason
I want to convert that partition from "/home" to a common data partition.
And home should be moved to "sda1" itself.

My qustion: can i safely do this without loosing my settings for ubuntu?
I don't want to share "sda3" as common home. I already tried that before.
different distros overwrite software settings which is troublesome.
 
Old 07-04-2007, 02:41 PM   #2
GregLee
Member
 
Registered: Feb 2004
Location: Waimanalo, HI
Distribution: Slackware 10, Fedora 6
Posts: 308

Rep: Reputation: 30
I'm not 100% sure I understand what you want to do, but I think it's:

cp -a /home /home_save
umount /home
mv /home_save /home

then edit /etc/fstab to remove the line that mounts /dev/sda3 on /home.
 
Old 07-04-2007, 02:51 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Create a partition temporarily named /home-new, and then copy the contents of /home to it.

I think the command to use would be "sudo cp -dpR /home/* /home-new/". If you have links, check if they are OK.

When you share a home directory, you can have problems with the ~/.kde/ or ~/.gnome2/ settings being changed. You can still share the /home partition. Use a different home directory for each partition. You don't even need to use a different username. You can change the location of your home directory when creating a user, or later using the "users & groups" config program of your distro, or directly by editing the home directory field in /etc/passwd.

One thing to look out for, both ways is that the range of UIDs for regular users can differ between distro's. Mandrake & Red Hat start at 500. SuSE starts at 1000.

You can change this behavior in the /etc/login.defs file:
This is from SuSE 10.2
Code:
#
# Min/max values for automatic uid selection in useradd
#
# SYSTEM_UID_MIN to SYSTEM_UID_MAX inclusive is the range for
# UIDs for dynamically allocated administrative and system accounts.
# UID_MIN to UID_MAX inclusive is the range of UIDs of dynamically
# allocated user accounts.
#
SYSTEM_UID_MIN            100
SYSTEM_UID_MAX            499
UID_MIN                  1000
UID_MAX                 60000

#
# Min/max values for automatic gid selection in groupadd
#
# SYSTEM_GID_MIN to SYSTEM_GID_MAX inclusive is the range for
# GIDs for dynamically allocated administrative and system groups.
# GID_MIN to GID_MAX inclusive is the range of GIDs of dynamically
# allocated groups.
#
SYSTEM_GID_MIN            100
SYSTEM_GID_MAX            499
GID_MIN                  1000
GID_MAX                 60000
You might want to change your UID & GID to a number that is in range of both distro's if they differ. Make sure your UID and GID numbers match if you want to use a common data partition.

You would want to do the same thing if you had an external mass storage drive with an ext3 or xfs or reiserfs filesystem. They you would have access regardless of which distro you booted to.

Last edited by jschiwal; 07-04-2007 at 02:56 PM.
 
Old 07-05-2007, 12:01 AM   #4
arijit_2404
Member
 
Registered: Jul 2007
Location: Kolkata, India
Distribution: Fedora 9
Posts: 85

Original Poster
Rep: Reputation: 15
Thumbs up

Quote:
Originally Posted by jschiwal
When you share a home directory, you can have problems with the ~/.kde/ or ~/.gnome2/ settings being changed. You can still share the /home partition. Use a different home directory for each partition. You don't even need to use a different username. You can change the location of your home directory when creating a user, or later using the "users & groups" config program of your distro, or directly by editing the home directory field in /etc/passwd.

One thing to look out for, both ways is that the range of UIDs for regular users can differ between distro's. Mandrake & Red Hat start at 500. SuSE starts at 1000.

You can change this behavior in the /etc/login.defs file:
This is from SuSE 10.2
Code:
#
# Min/max values for automatic uid selection in useradd
#
# SYSTEM_UID_MIN to SYSTEM_UID_MAX inclusive is the range for
# UIDs for dynamically allocated administrative and system accounts.
# UID_MIN to UID_MAX inclusive is the range of UIDs of dynamically
# allocated user accounts.
#
SYSTEM_UID_MIN            100
SYSTEM_UID_MAX            499
UID_MIN                  1000
UID_MAX                 60000

#
# Min/max values for automatic gid selection in groupadd
#
# SYSTEM_GID_MIN to SYSTEM_GID_MAX inclusive is the range for
# GIDs for dynamically allocated administrative and system groups.
# GID_MIN to GID_MAX inclusive is the range of GIDs of dynamically
# allocated groups.
#
SYSTEM_GID_MIN            100
SYSTEM_GID_MAX            499
GID_MIN                  1000
GID_MAX                 60000
You might want to change your UID & GID to a number that is in range of both distro's if they differ. Make sure your UID and GID numbers match if you want to use a common data partition.

You would want to do the same thing if you had an external mass storage drive with an ext3 or xfs or reiserfs filesystem. They you would have access regardless of which distro you booted to.
thanks for this information. this seems a better solution.
 
  


Reply

Tags
home directory, linux


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
How to move /home to new partition frazelle09 Ubuntu 12 05-02-2007 09:22 PM
How do I move /home to a new partition? glenn69 Linux - Newbie 2 01-05-2005 10:15 PM
How do i move /home to a new partition? glenn69 Linux - General 8 06-25-2004 11:38 AM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 10:19 PM
Move /home to Windows Partition Campy19 Mandriva 2 11-23-2003 12:24 AM


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

Main Menu
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