Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora User (http://www.linux-archive.org/fedora-user/)
-   -   Yet another post on disk copy methods (http://www.linux-archive.org/fedora-user/7736-yet-another-post-disk-copy-methods.html)

Duane Clark 11-28-2007 09:44 PM

Yet another post on disk copy methods
 
I thought I would throw up yet another post about copying disks, to add
to the several that have appeared here in the past. This certainly is
not the "right way", but it uses tools and commands I am familiar and
comfortable with.


My goal was to simply create a duplicate disk as easy as possible.
Because I have experienced several disk failures over the past 20 years,
I like to keep a duplicate hard disk around that duplicates all the
software and setup on my work computer (I also keep it at a separate
location, so that a fire or earthquake - which we have a lot of in
California - would be unlikely to destroy both). While I have been doing
this for a number of years, the other complication was that this was the
first time I had been using LVM partitions (I recently installed F7).


The method of creating partitions and making them bootable is one I have
used in the past; I simply booted the F7 installation DVD in the machine
with the new disk, and installed a minimal system. The doesn't take very
long and used tools I am familiar with. Unfortunately, as I discovered,
you cannot then mount this with the old disk and copy the partition
contents, because the old and new disks have the same LVM names.


After surfing around at what others used, I decided to give g4l a try. I
got that up and running and started the copy, but after 25 minutes, it
had only copied about 1.2GB. I had 55GB to copy (and none of that is
copyright violation material ;), so that was a no go.


I took a look clonezilla, but frankly, that looked like something that
an IT department would use for many machines. It looked like way too
much for the simple task I wanted.


Finally it occurred to me to go back to the old method. I reinstalled a
minimal system from scratch, but this time edited the LVM group name
changing VolGroup00 -> VolGroup01. Now I could mount the old and new
partitions simultaneously, so I did a simple:

mkdir /mnt/disk
First the boot partition
mount /dev/sdb1 /mnt/disk
cd /boot
cp -ax ./* /mnt/disk
Now I need to edit the grub.conf file, and alter references to
VolGroup00 to read VolGroup01. Also, I had altered the actual partitions
used, so I changed those too. Then umount it.

umount /mnt/disk
Now the main partition.
mount /dev/VolGroup01/LogVol00 /mnt/disk
cd /
cp -ax / /mnt/disk
That took about an hour to copy 55GB. I needed to edit the file
/mnt/disk/etc/fstab, and again alter references to VolGroup00 and to the
partition numbers of the swap and boot partitions.


After all that, I tried booting the disk. Grub came up fine and started
the boot process, but immediately after the LVM manager found my new
partition, a message came up about being unable to find the "resume
device" and referencing VolGroup00, the wrong one.


A bit more surfing revealed this interesting web page:
http://mhensler.de/swsusp/
In particular, I found the part interesting that begins:
"Fedora requires an initrd for booting and resuming your system. "
and continues with info on editing this file. So I decided to unpack the
initrd file that I was using and see what it looked like. And sure
enough, the "init" file within initrd turns out to be a plain text file
with several references to VolGroup00. I altered those, repacked the
initrd file according to those directions, and copied it to the boot
partition of the new disk.


I tried booting the disk and success! I logged in, the automatic update
checker thingy came up, so I let it do an update to see if that works
fine. I ran several of my licensed apps to make sure those were working.
I did a network git update of wine and recompiled and installed that.
And I checked my email and posted to fedora-list. It all seems to work
fine, so it looks like this is a good copy.


--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

Les Mikesell 11-28-2007 10:13 PM

Yet another post on disk copy methods
 
Duane Clark wrote:


I took a look clonezilla, but frankly, that looked like something that
an IT department would use for many machines. It looked like way too
much for the simple task I wanted.


clonezilla-live is the one to look at. It's an iso image that you can
boot (or alternatively a zip archive to install on a USB drive). You
just boot it, optionally mount some storage space via nfs, smb, or ssh,
and let it copy the disk to an image with enough info to re-create it.


The main clonezilla project does the same things but is geared toward
network booting and mass-cloning of the images.


--
Les Mikesell
lesmikesell@gmail.com

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list


All times are GMT. The time now is 09:41 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.