On Wed, 29 Mar 2000, Matthias Oertli generated:

>Hi all,
>I need to copy the contents of a linux partition onto a bigger
>partition on a replacement harddisk. I'd like an exact copy with all
>the permissions intact, etc.
>Would a  simple  cp -a /oldhd/* /newhd/*   do the trick is there a
>better way?

* get tomsrtbt distro, install onto a floppy.
* turn off putr, install new disk, leave in old disk
* boot tomsrtbt & login
* mount /dev/hdold /mnt (or whatever)
* mkdir /mntnew
* mke2fs /dev/hdnew (assuming that there is no filesystem on this disk already)
* mount /dev/hdnew /mntnew
* cd /mnt
* tar cf - * | (cd /mntnew ; tar xf -)
* wait for a while
* once done, check to make sure the /mntnew filesystem seems intact
* umount /mntnew and /mnt
* mount the root partition, edit /etc/fstab on *it* (not the tomsrtbt)
  to make sure you mount the new drive in the right place
* reboot
* take out tomsrtbt disk ;)

the important line here is the tar line, this will preserve symlinks (a
few caveats apply) and permissions and everything while copying a
directory tree to another directory/filesystem/etc

hope this helps

-- 
jamesw

Fortunatley, not all of the world lives in the United States.
                -- ssl(8), OpenBSD 2.6
------------------------------
[EMAIL PROTECTED]
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to