You are not logged in.

#1 2011-02-07 23:08:18

Daerun
Member
Registered: 2011-02-07
Posts: 92

[SOLVED] Just got my Arch! Can /home be moved to different partition?

Hello everybody, after three days of work I've finally got my Arch running correctly, and I'm very thrilled about moving on and use it on a regular basis.

Now I have a doubt: during installation I selected to install home in the same partition as file sistem, because I have a home partition for Ubuntu and Fedora and was unsure if setting it would simply create a new folder for Arch, or it would be automatically formatted, which would have meant the destuction of all my data. That means all Arch data is inside the same partition.
So, question is, is there any way to move to that home partition now?

Last edited by Daerun (2011-02-08 22:33:24)

Offline

#2 2011-02-07 23:31:54

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Just got my Arch! Can /home be moved to different partition?

You can have separate /home partitions for every distribution you have but what is the problem with the current setup? You can move / copy your data (music, photos etc.) to your Arch /home.

What is the output of 'mount'?

Offline

#3 2011-02-07 23:57:36

Daerun
Member
Registered: 2011-02-07
Posts: 92

Re: [SOLVED] Just got my Arch! Can /home be moved to different partition?

There is actually no problem, sistem is running ok; it's just a matter of order and also habit, I guess. I just would like the sistem to have the Arch /home at my shared home partition, instead of being in the Arch partition as I have set it. That would mean actually moving it (I'm editing thread title).

My sistem:

sda5 > Ubuntu
sda6 > Fedora
sda7 > Arch (with /home inside of it)
sda8 > home for Ubuntu and Fedora

Maybe I'm asking something really weird lol

'mount' doesn't show the other partitions because I still haven't worked on mounting them, but sistem sees them, because they show at the places menu (unmounted, of course).

Last edited by Daerun (2011-02-08 00:01:04)

Offline

#4 2011-02-08 00:18:07

mcmillan
Member
Registered: 2006-04-06
Posts: 737

Re: [SOLVED] Just got my Arch! Can /home be moved to different partition?

You'll want to edit /etc/fstab to use sda8 as /home. If you use the same username in Arch as the other distros you should be able the same existing directories and can remove the old /home from Arch (though different versions of programs may have incompatible config files). If you want to use the Arch home files you can mount the other partitions and move your home over there. I'd suggest booting up a live CD or one of the other distros to transfer/remove the Arch directory to be sure you're not messing with a /home that's being used though I'm not sure if it's completely necessary to do it that way.

Offline

#5 2011-02-08 02:35:50

ces
Member
Registered: 2011-02-08
Posts: 3

Re: [SOLVED] Just got my Arch! Can /home be moved to different partition?

You should not need to boot into a live CD.  Just log out completely and log in as root.  Once logged in as root execute

# telinit 1

this will change you to single user mode and will ensure that you are not using any of the files in /home.

From there, make your changes to fstab to mount sda8 as /home. For example you might add:

/dev/sda8 /home ext4 defaults 0 1

to your /etc/fstab. 

Next, copy your current /home onto sda8.  Make sure that there are no naming conflicts and that your home folders name still matches your user name.

Once you are sure all your data is safely copied over to sda8, move /home to /home-backup

 #mv /home /home-backup 

and then manually mount sda8  at /home

#mount /dev/sda8 /home

no additional flags should be needed if you have already updated /etc/fstab appropriately.

Finally, run

#telinit 3

and then log back in as your regular user.  Ready to rock and roll.

Offline

#6 2011-02-08 05:33:02

SeanM
Member
Registered: 2011-02-07
Posts: 25

Re: [SOLVED] Just got my Arch! Can /home be moved to different partition?

I should point out the directory name is dependent on your username, but directory and file permissions are determined by UID. If you are using a filesystem that uses proper unix permissions (effectively all of them native to Linux), then you will have to make sure that your UID on each system is the same.

Tradition for Linux is to start UIDs for regular users at 1000 (Debian [Ubuntu] and Arch do for sure, haven't used Red Hat in a while, but should be the same), so if you are the first user on all of your installs you should be uid 1000 and have no issues. You can check by logging in and running `id`, among other ways.

If you are NOT the same uid on one of them, you might run into permission issues. There are at least three good ways to solve that, but that's a bridge to cross if you get there :-)

Offline

#7 2011-02-08 17:29:33

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: [SOLVED] Just got my Arch! Can /home be moved to different partition?

I don't know how many times I have seen this problem - and the solution is oh so easy ...
Forget about /home as such - make it just part of the root filesystem and don't put any data in there.
Instead - mount /myhome  (or whatever you want to call it) on a partition on its own and have all of your users (ie all the usernames you use) rwx-access to it - use it as your 'real' home.
This way, you don't have the clutter of dot-files/directories if you should have more than one distro. To use a common /home for more than one distro is a big fallacy (at least in _my_ eyes) unless you make sure that uid and gid is the same (which is seldom the case if you're a newbie - old hands know better!)
Even if you have the same uid/gid - the dot-files may not be completely compatible and you're heading for troubles.

Another advantage - you can replace a distro with some other distro without thinking twice about it - your 'real' home is safe.

Oh - and while I'm at it.
Why all the different partitions for each distro? (/var, /usr, /home etc). That is OK if you only use one distro - the second you try to install another one you will be heading for troubles.
Just use the root filesystem and give it 20 gigs - 20 gigs for each distro and you will not have any problems - ever (almost). Hey - in these days of terabyte disks for $50, what's the problem?
Then - a final /myhome as a common home partition for all distros.

Another 'mistake' I often see is playing around with different filesystems, trying to wring the last ounce of effort out of a poor diskdrive. Make a /testing partition and experiment to your heart's content with all kind of weird and wonderful filesystem, but keep the root filesystem and your /myhome safe. ext3 and/or reiserfs are excellent filesystems and have been so for years - they are as safe as the bank. ext4 is getting there.

Just my 2c worth ...

Last edited by perbh (2011-02-08 17:38:51)

Offline

#8 2011-02-08 22:33:01

Daerun
Member
Registered: 2011-02-07
Posts: 92

Re: [SOLVED] Just got my Arch! Can /home be moved to different partition?

Thanks everybody. I tried CES method and it worked!

As for the user folder and this partition, I use different usernames for each distro, so there's a unique folder for each of them (ubuntuuser, fedorauser, archuser); so thanks SeanM and perbh for pointing me to the uid issue, but I simply avoid this problem and possible file incompatibility with the different usernames.

The point of this is to have relatively small but fit enough root partition that includes everything /boot, /usr, and all (I set them to 10GB, which I find more than enough, I've never used more than 8), and then a larger /home partition (88GB in my case. Still working in a 180GB HD) with the different distro userfolders to have enough room for everything it could come, including downloaded videos (Amule user, you know), so I never run out of available disk space AND, more importantly, my configuration data is safe in case of a system failure or upgrade to new release (that combined with wise periodical backups, in case of disk dying, of course).

Again, thanks all smile

Offline

Board footer

Powered by FluxBB