moving a working fedora install from old to new hardware?

John Austin ja at jaa.org.uk
Mon Aug 24 09:57:53 UTC 2009


On Mon, 2009-08-24 at 18:56 +0930, Tim wrote:
> On Mon, 2009-08-24 at 03:28 -0400, Robert P. J. Day wrote:
> >   so is there a fedora way to say, "make *this* box look just like
> > *that* box, but do it intelligently"?
> 
> Using kickstart files to install a new box with the same packages, is a
> start.  Perhaps copying some /etc/ files over, afterwards.
> 
> I spose you could partition the new drive, then file copy...
> 
> -- 
> [tim at localhost ~]$ uname -r
> 2.6.27.25-78.2.56.fc9.i686
> 
> Don't send private replies to my address, the mailbox is ignored.  I
> read messages from the public lists.
> 
> 
> 

Notes to myself may be of interest

See attachment

John

-------------- next part --------------
Comparision of tar, cp and rsync for partition archiving
See also
~/hints_info/partition_clone_using_gparted
~/hints_info/updating_grub_on_boot_partition
######################################################################
Using tar to archive a partition
Details derived from info:tar

Creating an archive of a ext3 partition when booted from USB stick

1.	Mount the partition "ro" to avoid modification time changes
	mount -o loop -r fred /mnt/zip
	mount -r /dev/sda7 /mnt/zip

2.	--xattrs
	This option causes `tar' to store the current extended attributes
    in the archive. This option also enables `--acls' and `--selinux'
    if they haven't been set already.

3.	--numeric-owner
	To avoid problems with file ownership between the "booted" OS (F11 say)
	and the partition being archived (Centos 5.3 say)
	If the /etc/passwd files do not match there would be a problem
	If this option is present during creation it is not needed on restore!
	If forgotten during creation use it during restore!

4.	--atime-preserve=system
	This avoids changing the access time in the first place, if the operating
	system supports this. Unfortunately, this may or may not work on any given operating
    system or file system.  If `tar' knows for sure it won't work, it complains right away.

5.	--absolute-names
	Normally when creating an archive, `tar' strips an initial `/' from member names.
	This option disables that behavior. This is NOT required.

6.	tar --xattrs --numeric-owner --atime-preserve=system \
	-zcf /tmp/tmp/archive.tgz /mnt/zip

Tested the above on /global/SSD_avon_root
[root at naxos ~]# tar --xattrs --numeric-owner --atime-preserve=system -zcf /tmp/tmp/archive.tgz /mnt/zip
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
tar: /mnt/zip/tmp/.ICE-unix/3647: socket ignored
tar: /mnt/zip/tmp/mapping-root: socket ignored
tar: /mnt/zip/var/lib/imap/socket/lmtp: socket ignored
tar: /mnt/zip/var/lib/imap/socket/idle: socket ignored
tar: /mnt/zip/var/run/acpid.socket: socket ignored
tar: /mnt/zip/var/run/dbus/system_bus_socket: socket ignored
tar: /mnt/zip/var/run/vmware/usbarbitrator-socket: socket ignored

Careful reading of the tar info page shows no option to "tar" sockets
Are they required ?

On the otherhand cp -a /mnt/zip /tmp/tmp completes with no errors
and /var/run/vmware/usbarbitrator-socket ... are preserved

The tar archive is 4.3GB and the cp tree is 11GB as shown by du, the raw partiton is 20GB
######################################################################
Using cp to Archive a Partition
1.	Mount the partition to be archived read only
	mount -r /dev/sdaX /mnt/zip

2.	Create directory to save the files
	mkdir /tmp/tmp/archive

3.	Copy the files in archive mode - accept the extra directory level
	cp -a /mnt/zip /tmp/tmp/archive
OR
4.	cp -a /mnt/zip/* /tmp/tmp/archive
######################################################################
Using rsync to Archive a Partition
-a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
-r, --recursive             recurse into directories
-l, --links                 copy symlinks as symlinks
-p, --perms                 preserve permissions
-t, --times                 preserve modification times
-g, --group                 preserve group
-o, --owner                 preserve owner (super-user only)
-D                          same as --devices --specials
--devices               	preserve device files (super-user only)
--specials              	preserve special files
-H, --hard-links            preserve hard links
-A, --acls                  preserve ACLs (implies -p)
-X, --xattrs                preserve extended attributes

1.	Mount the partition to be archived read only
	mount -r /dev/sdaX /mnt/zip

2.	Create directory to save the files
	mkdir /tmp/tmp/archive

3.	Copy the files to the archive - Note the trailing / in this line
	rsync --exclude=lost+found --numeric-ids -aHAX /mnt/zip/  /tmp/tmp/archive
######################################################################
Restoring a dd_archive
1.	Mount the dd_archive read only
	mount -r -o loop dd_archive /mnt/zip

2.	Mount the partition to which the archive is to be restored
	mount /dev/sda7 /mnt/zzip

3.	cp -a /mnt/zip/* /mnt/zzip
OR
4.	rsync --exclude=lost+found --numeric-ids -aHAX /mnt/zip/  /mnt/zzip
######################################################################
Restoring an rsync_archive or cp_archive
1.	Mount the partition to which the archive is to be restored
	mount /dev/sda7 /mnt/zzip

2.	rsync --exclude=lost+found --numeric-ids -aHAX /tmp/tmp/archive/  /mnt/zzip
OR
3.	cp -a /tmp/tmp/archive/* /mnt/zzip
######################################################################
Conclusion
1.	dd if=/dev/source_partition of=dd_archive to copy complete partition
2.	mount -r -o loop dd_archive /mnt/zip - to work with the archive
3.	mount /dev/dest_partition /mnt/zzip
4.	rsync --exclude=lost+found --numeric-ids -aHAX /mnt/zip/  /mnt/zzip
----------------------------------------------------------------------
Modify the Disk Master Boot partition
1.	nedit grub.conf to add extra indirect entry

Modify the restored partition
1.	PartitionBootRecord using grub - root (hdX, Y); setup (hdX, Y)
2.	Disk label using e2label
3.	nedit grub.conf to change Splashimage (hdX,Y), UUID entries, root (hdx, Y)
4.	nedit /etc/fstab to change UUIDs
----------------------------------------------------------------------
Further thoughts
Cloning usng dd, cp or rsync all work well when the "clone" is installed
on the same machine.
If the clone is run on a different machine, particularly for Centos 5.3,
even if USB disk/stick is used, then difficulties with ethernet and graphics will occur.
1. Centos5.3 does not have a sky2 driver that recognises the Marvell ethernet on SA76G2
2. If kmod-nvidia is present on the clone then it will not run on SN68SG2 without work
3. Careful use of grub during booting required to get the clone running


More information about the users mailing list