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

Re: linux copying



on Tue, May 13, 2003 at 11:40:50AM -0400, Bob Paige (bobman@Iname.com) wrote:
> Konstantin Kostadinov wrote:
> >Just boot with your current installation (small hdd) and attached second 
> >new disk (big hdd).
> >
> >tar cvf linux.tar /  - create linux.tar from root [/]
> >mount /your/new_drive /mnt/something (after file system create)
> >cd /mnt/something - change dir where is mounted your new drive
> >tar xvf path_to/linux.tar - extract tar file with your current distro 
> >under new hdd
> >
> >OK now you have your current installation to your new drive !
> >now type chroot /mnt/something - this will change your root to destination 
> >that you used for untar your distro
> >
> >lilo -v - this will install lilo (if you use lilo) to your new hdd
> >
> >power off and boot from your new drive.
> >
> >another way is to tar and untar trough pipe without first tar and after 
> >this untar (if you do not space)   
> 
> Why the trip through tar? What does that buy you over 'cp', assuming the 
> old and new drives are both mounted?

Rigorously correct treatment of permissions, ownership, symlinks, fifos,
device files, timestamps (both creation and access) and other sundries.  
Most of which have been maltreated by other means of copying files in 
the past, and most of which are probably correctly treated now, but which
old farts still trust GNU tar to treat right.

Note that the piped tar trick does you pretty well:

    $ tar cvf . | ( cd newpath; tar xvf - )

...too, tar is by default verbose and lets you know what's going on.  In
the above instance, on *both* the read and write sides of the equation.

For synching up two systems, rsync wins over tar.

Peace.

-- 
Karsten M. Self <kmself@ix.netcom.com>        http://kmself.home.netcom.com/
 What Part of "Gestalt" don't you understand?
    First they came for the Communists, and I didn't speak up, because I
    wasn't a Communist.  Then they came for the Jews, and I didn't speak
    up, because I wasn't a Jew.  Then they came for the Catholics, and I
    didn't speak up, because I was a Protestant.  Then they came for me,
    and by that time there was no one left to speak up for me.
    -- Rev. Martin Niemoller, 1945



Reply to: