restoring FC1 to *new* partition from tar archive

Luciano Miguel Ferreira Rocha strange at
Sat May 8 20:39:43 UTC 2004

On Sat, May 08, 2004 at 03:37:46PM -0400, Joe(theWordy)Philbrook wrote:
> Hi I've just had to relocate my FC1 to a different partition. I used
> tar...  And I'm hoping I did this well enough for it to survive when I
> eventually use anaconda to upgrade to FC2.
> Would someone tell me if I did this right?  I've usually only done this
> kind of thing with partimage. But not all of my partitions are the same
> exact size so I thought I'd learn to use tar.
> I was concerned about files being updated during the tar -czf process
> however, so I booted my mdk9.1 partition, and used mkfs on the new FC1
> partition to ensure a clean ext2 file system. Then I and mounted the old
> and new FC1 partitions.
> next I did a cd to the old FC1's mount point and:
> # tar -czf /archivepath/tarfilename.tgz .

I use tar czsSpf dest.tar.gz *

And then extract with tar xzsSpf --numeric-owner dest.tar.gz

> Tar said it was skipping some sockets, which I wasn't sure about, but all
> of them were in /tmp so I figured they couldn't be that important...

Sockets are only inodes and can be created only with bind(2). Don't worry
about them

> Then I did a cd to the new FC1 mount point and:
> # tar -xpzf /archivepath/tarfilename.tgz .

You could have done it in one single pass:

tar csSpf - * | (cd /newpart && tar xzsSpf - --numeric-owner)

or: cp -a /old /new

Running without -p and --numeric-owner could cause some problems:
-p: preserves permissions. Without this, the permissions of extracted
    files will be affected by the value of umask.
--numeric-owner: if you had created the tar.gz under FC1 and extracted it
under MDK, different values for same users in /etc/passwd could cause
problems. As you made the tar and extracted it under FC1, you shouldn't
worry about this one.

Luciano Rocha

More information about the fedora-list mailing list