moving data from home directory to home partition

Liam Proven lproven at gmail.com
Wed Feb 1 22:00:58 UTC 2012


On 1 February 2012 19:59, Default User <hunguponcontent at gmail.com> wrote:
> Hi!
>
> I run Ubuntu 11.10, home user, single user setup, no lvm, nothing exotic.
> For simplicity I have just 2 partitions:
>
> /  (bootable, ext4)
> linux-swap
>
> So all of my data (except system and application-generated configuration
> files, etc.) is in the /home directory of /.  I have heard a number of users
> recommend a separate home partition, that it makes things easier when
> updating or upgrading.
>
> So could I just:
> 1) use the Ubuntu install routine from a "live" media to create a new,
> separate home partition
> 2) use the Ubuntu install routine from a "live" media to mark the new
> partition as "home"
> 3) reboot
> 4) move the data from /home to the new home partition
> 5) reboot again
>
> Would that work?  Or should I just wait until 12.04 and do a fresh install
> with a separate home partition then?

What Ioannis said, basically.

I have done this before.

In a simpler form, the steps are:

[0] Back up all your stuff somewhere safe, on another drive!

Then:

[1] Boot from LiveCD

[2] Use Gparted to:
[a] shrink your root partition
[b] make a new extended partition
[c] in there, make & format a new logical ext4 partition. Give it an
easy name such as "home" - ideally with no spaces or punctuation.

[3] Reboot.

[4] Click on your new partition in "Computer". It should mount
automatically on something like /media/home. Check it's OK.

[5] Make a folder in named with your username. So if your username is
"jsmith" make a folder called "jsmith"

[5] Copy everything in your home directory into the new volume. You
could use the LiveCD for this again.

[6] Edit fstab and set the new folder to mount as /home

Reboot and try it.

If it works OK, boot from a LiveCD again, check the new partition has
all your stuff in it, and if so, remove all the contents of the old
/home folder on the root filesystem.

If all this sounds too complicated - and I am deliberately not giving
step-by-step instructions, as if you need them, you won't be able to
recover if anything goes wrong and you risk breaking your system -
then what you should do is:

[1] back up everything in /home/YourUserName to an external disk
[2] reformat and reinstall with a separate /home partition
[3] then restore all your stuff



-- 
Liam Proven • Profile: http://lproven.livejournal.com/profile
Email: lproven at cix.co.uk • GMail/G+/Twitter/Flickr/Facebook: lproven
MSN: lproven at hotmail.com • Skype/AIM/Yahoo/LinkedIn: liamproven
Tel: +44 20-8685-0498 • Cell: +44 7939-087884




More information about the ubuntu-users mailing list