Paul L. Snyder on 31 Aug 2004 18:17:03 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Adding a new HD


Quoting Art Alexion <art.alexion@verizon.net>:

> I am adding a new (additional) hard drive.  My current HD has a simple 
> ext3 partitioning: (/, /boot, & /swap).  I want to move /home to the new 
> drive as well as installing a new distro.
[...] 
>     mkdir /newhome
[...]
>     mv /home /newhome
>     mv /newhome/home /home

That would probably work, but it might be safer to do an rsync and
confirm your copy is good before deleting the original.  For example,
if your new HD is hdb and you've created an hdb1 partition for your
new /home:

 mount /dev/hdb1 /mnt/tmp    # mount the new partition on any empty dir
 rsync -a /home/* /mnt/tmp/  # Read 'man rsync' for -a (--archive)
 rsync -an /home/* /mnt/tmp/ # A "dry run" to make sure the copy is
                             # identical. Check the output for sanity.

 rm -rf /home/*              # Zorch.  Will miss dotfiles in /home, but 
                             # not in subdirs.
 umount /dev/hdb1;
 vi /etc/fstab               # Add an entry to /etc/fstab to point to
                             # /home's new, independent existence
 mount /dev/hdb1 /home

As an added bonus, if the rsync is interrupted in the middle it can
be restarted where it left off.

> Or is there something I should be doing with dd?

I'd stick away from dd for moving from one hard drive to another.  It
might work, but you're probably more interested in preserving the
high-level (file) view, rather than mucking with the low-level (block)
view.  

> Or should I install the new distro to the new HD and then just move the 
> existing /home files to /home on the new distro?

Make sure that whatever distro you are installing is not allowed to 
format the partition specified as /home.  For belt and suspenders, you
could wait until the new distro is installed before deleting the
original.  Or, as you suggest, just wait until after the new distro is
installed before performing the move

> I am assuming no major 
> conflict in sharing home among the two distros as long as it is in its 
> own partition.

I would guess that there would be only minor problems, for the most part.
If the distros install different versions of packages, there might be
divergent opinions about what constitutes legal options in config
files.  I have shared a single /home partition between multiple distros
without significant difficulty.

Note that concepts of user/group IDs may be different between the two
distros, as well, so you might make sure that you have similar entries
in /etc/passwd and /etc/group on both distros.

HTH,
pls
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug