Re: Migrating /home from too small /dev/hda partition

Ryan <[email protected]> 11 Aug 2003 09:56:40 +0800
Newsgroups gmane.linux.hardware.sony
Organization slowest.net
Message-ID <1060567000.725.19.camel@vaio>
On Mon, 2003-08-11 at 09:35, Dan Whitacre wrote:
> Hello all,
> 
> A few days ago, I rambled about many things, one of
> which was having too small a /home dir, living on its
> own /dev/hda7 partion that in my lack of wisdom, I
> made way too small (61M) on install.  Well, I managed
> to move it, and at the risk of condecending, I'll go
> through the process:

Thanks for taking the time to write it out, I'm sure it will assist
someone in the future .. and yes, you can move any partition anywhere
you want without reinstalling through similar means to what you
described.  Some other more vital partitions have other considerations
and are not quite as simple though.

To preserve owernship, modes and timestamps you could have used:

cp -a

... and then blown away the old home directory.

-a is the same as -dpR:

-d = don't follow symlinks - ie: copy the symlink as a symlink, not what
it points to
-p = preserve modes, ownership, timestamps etc.
-r/-R = recursive copy

I don't know if mv has such options, that's why I use cp :)   You could
also have used tar, as that effectively achieves the same ownership
preservation.

Either way it saves a lot of farting around during the aftermath, and
having the timestamps remain the same is rather nice (and in some cases
a requirement).

Ryan