Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Sunday, September 7, 2008

From old /home to new /home

mkdir /newhome

Add an fstab line something like this for the new disk.

/dev/hdb1 /newhome ext3 defaults 1 2

Now make sure that /home and /newhome are as expected.i.e. make sure you have not removed files you do not have copies of.
Next swap the rename the old /home dir to /oldhome or some such thing.
i.e. edit fstab to mount the old home space as /oldhome and the new as /newhome.
i.e. do not mount /home as /home yet. Let it be an empty dir or mount point.

Just mount /oldhome and /newhome...
If you have fstab lines like this you may find that you can be confused about the physical device under things.

LABEL=/home /home ext3 defaults 1 2

The above is important because a partition label can cause confusion.
You can orient yourself with tricks like "df ."

$ cd /home
$ df .
Filesystem 1K-blocks Used Available Use% Mounted on

/dev/hda5 10713248 247936 9921096 3% /home

When you have /oldhome and /newhome clearly identified and labeled then fix things so that /newhome is /home. Check and verify...
perhaps with:

# diff -d /home /oldhome

When all is right in /home remove /oldhome you can recover the space.
If it is an isolated partition removing the files will not 'add space' to /.
If you have multiple users. You can consider keeping the /oldhome partition as say /homeA and move some users there. I happen to have collected a lot of stuff in my 'src' dir. In the past I have made a link to another partition for bloat stuff like that.

Same for system documentation...

# df -s /*
might give you a good choice of stuff to move. Recall that some things are best located in the / files system.

The goal of the above is to be cautious so the recovery CD lets you recover by simply undoing a single step.

No comments: