FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 07-18-2008, 11:48 PM
Dan Thurman
 
Default F9: Using dd to clone a drive...

I used dd off the Gnome Live CD, so that neither
drives were mounted nor active. Next I proceeded
to use dd as follows:

dd if=/dev/sda of=/dev/sdb

It took approx. 6 hours to copy over 450GB of data.

I was successful at getting getting Grub to come up, was
able to select XP and Vista partitions and these booted up
just fine. Great! I checked everything and these worked
fine as far as I can tell. But when I tried to boot Fedora 9,
there was a whole raft of errors spewed out, from "Stale NFS"
errors, missing/corrupted/perm problems with /var/run,
/var/bin/id, I was not able to tell what the problem and the
list is endless. In short, I was not able to boot at all.

I could however boot into single user (with lots of errors)
but was not really sure what to do next. I tried fsck but there
was a warning that I could severely corrupt the / partition,
so I declined to follow through with it.

Next, I shutdown the system, rebooted with the original drive
with the clone added as secondary drive, and brought up GParted
and took a look at the cloned drive's partition and everything appears
fine except the / partition, it appears with a black border, has a warning
exclaimation icon, and the partition is marked as "Unknown".

Can someone give me some guidance as to post-followup to dd, or
perhaps a repair of / partition, or to simply download Gparted-Live
and make a partition to partition copy of / (which I am downloading
as I write up this post)?

Curiously, why is it that dd works for XP/Vista and not Fedora-9?

Thanks!
Dan

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 07-19-2008, 01:50 AM
"Michael Wiktowy"
 
Default F9: Using dd to clone a drive...

On Fri, Jul 18, 2008 at 7:48 PM, Dan Thurman <dant@cdkkt.com> wrote:
>
> Can someone give me some guidance as to post-followup to dd, or
> perhaps a repair of / partition, or to simply download Gparted-Live
> and make a partition to partition copy of / (which I am downloading
> as I write up this post)?
>
> Curiously, why is it that dd works for XP/Vista and not Fedora-9?

A few things I can think of:

dd with a bs=8M (or some blocksize bigger than the default) argument
runs *way* faster. So if you want to try dd-ing again (maybe something
got corrupted somehow the first time), it will likely finish in an
hour or so instead of 6.

You can also use dd on a partition by partition basis in the same way
... just specify the partition device name instead of the whole disk.
... which would be even faster if you want to just retry the
partition. Just make sure you are not clning the corrupted/empty
partition over the good one. It is *very* easy to do such things with
dd.

Are you leaving the old hard drive still in the machine when rebooting
after cloning ... maybe just putting it into the secondary interface.
If so, then you might be running into disk label conflicts with Fedora
struggling to figure out which partition labeled "/" to mount.

Be wary of booting your system with two cloned harddrives installed. I
have been burned by that in the past with Windows. Somehow it decided
to use a little bit of the OS from one drive and a little bit of the
OS from the other drive such that it ran when both were in the machine
but if I pulled either one out, it would not boot.

Or alternatively, if your partitions are being mounted by UUID then
some might not be getting mounted at all. That might account for the
missing x,y,z errors. Check what your fstab on the new disk says. I
think the UUID would change for the partition on the new disk but I am
not sure. 'blkid /dev/sda1' is how to get the UUID of sda1

I have used dd in the past to do the things you seem to be doing, so
unless something got broken in F9, it should work.

/Mike

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 07-19-2008, 02:05 AM
"Mikkel L. Ellertson"
 
Default F9: Using dd to clone a drive...

Dan Thurman wrote:


I used dd off the Gnome Live CD, so that neither
drives were mounted nor active. Next I proceeded
to use dd as follows:

dd if=/dev/sda of=/dev/sdb

It took approx. 6 hours to copy over 450GB of data.

You would be better off using gparted or clonzilla to do the
copping. With DD, it has to copy every byte. The others understand
file systems and only copy data, not empty space.


Mikkel
--

Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 07-19-2008, 07:10 AM
"Daniel B. Thurman"
 
Default F9: Using dd to clone a drive...

Mikkel L. Ellertson wrote:


Dan Thurman wrote:
>
> I used dd off the Gnome Live CD, so that neither
> drives were mounted nor active. Next I proceeded
> to use dd as follows:
>
> dd if=/dev/sda of=/dev/sdb
>
> It took approx. 6 hours to copy over 450GB of data.
>
You would be better off using gparted or clonzilla to do the
copping. With DD, it has to copy every byte. The others understand
file systems and only copy data, not empty space.


I tried Gparted-Live.

Unfortunately, it failed to copy 85% of the way complaining
about a bad block on the source drive! I have run the 'Check'
and it does not even see any problems with the source drive!
I even did a check on the destination drive and it says it does
not see any problems either - even when the copy failed!

Is there any tool besides fsck that really does a through job
making sure to detect bad-blocks (if there really was any)
and add it to the bad block list? Or, perhaps there is a problem
with Gparted-Live v0.3.7.7.1 version?

Source: /dev/sda6
Destination: /dev/sdb6

Copy stops with a message on the source saying something like:

/dev/sda6:
Copied 86948585 of 604106921
Error while reading block at 937752324

The sda6 partition size is correctly 604106921 (~300GB) so why
the heck is Gparted reading 937752324, probably somewhere
in the 7th partition (5GB swap) or even possibly at the end of
the750GB drive itself?

Of the 300GB / partition, only 49GB is actually used while the
rest is actually empty space. Is that the problem? Is Gparted
smart enough not to copy over empty space and end after 49GB
of data?

I have tried everything I could throw at it:

Gnome-Live & Gparted Live:
1) mount /dev/sda6 /mnt/a
mount /dev/sdb6 /mnt/b
setenforce 0
a) cp -acpx /mnt/a/. /mnt/b
b) tar --xattrs -cpf - /mnt/a | (cd /mnt/b tar --xattrs -xpf - .)

Nothing seems to work!

Why am I not able to get the / partition copied over
successfully? Everything is bootable *except* / !

Please advise!

Thanks,
Dan

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 07-19-2008, 03:30 PM
g
 
Default F9: Using dd to clone a drive...

Dan Thurman wrote:


I used dd off the Gnome Live CD, so that neither
drives were mounted nor active. Next I proceeded
to use dd as follows:


a while back, i tried running 'dd' from a live cd to 'clone' 2
drives of same brand, model, firmware, whole 9 yards.

clone bombed every time.

i cured problem by building a bare system, no 'x', networking,
or anything else unneeded, on a 3rd hard drive, and only the
1 drive in fstab.

i am not sure what problem was, but i can only contribute it to
simple fact of 'live cd'.

ymmv.

good luck to you.


--

tc,hago.

g
.

in a free world without fences, who needs gates.

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 07-19-2008, 04:52 PM
Les Mikesell
 
Default F9: Using dd to clone a drive...

Daniel B. Thurman wrote:


> I used dd off the Gnome Live CD, so that neither

> drives were mounted nor active. Next I proceeded
> to use dd as follows:
>
> dd if=/dev/sda of=/dev/sdb
>
> It took approx. 6 hours to copy over 450GB of data.
>
You would be better off using gparted or clonzilla to do the
copping. With DD, it has to copy every byte. The others understand
file systems and only copy data, not empty space.


I tried Gparted-Live.

Unfortunately, it failed to copy 85% of the way complaining
about a bad block on the source drive! I have run the 'Check'
and it does not even see any problems with the source drive!
I even did a check on the destination drive and it says it does
not see any problems either - even when the copy failed!

Is there any tool besides fsck that really does a through job
making sure to detect bad-blocks (if there really was any)
and add it to the bad block list? Or, perhaps there is a problem
with Gparted-Live v0.3.7.7.1 version?


A brute-force approach is 'cat /dev/sda >/dev/null'. If it completes,
run dmesg to see if there were any messages about soft errors or
retries. Also, smartctl -a /dev/sda might have something interesting
about the disk health.


I'd try to get a tar archive of the contents of that filesystem if there
is anything important on it. The bad spot might be on an unused portion
that a file based copy would miss.




The sda6 partition size is correctly 604106921 (~300GB) so why
the heck is Gparted reading 937752324, probably somewhere
in the 7th partition (5GB swap) or even possibly at the end of
the750GB drive itself?

Of the 300GB / partition, only 49GB is actually used while the
rest is actually empty space. Is that the problem? Is Gparted
smart enough not to copy over empty space and end after 49GB
of data?

I have tried everything I could throw at it:

Gnome-Live & Gparted Live:
1) mount /dev/sda6 /mnt/a
mount /dev/sdb6 /mnt/b
setenforce 0
a) cp -acpx /mnt/a/. /mnt/b
b) tar --xattrs -cpf - /mnt/a | (cd /mnt/b tar --xattrs -xpf - .)

Nothing seems to work!

Why am I not able to get the / partition copied over
successfully? Everything is bootable *except* / !


Do you still have both drives in the same machine, and do they contain
LVM volumes? If you cloned the id's the duplicate might not work. The
solution might be as simple as unhooking the other drive. If the reason
you are cloning is to build a different machine and you also have enough
space on a networked drive to hold a compressed image copy, I recommend
using clonezilla-live. It's a bootable iso that will save the master
copy to a local or remote (nfs/smb/ssh) drive. Then you can boot it in
the target and it will reconstruct the partitioning and filesystems as
well as the contents. It knows enough about most filesystems (including
windows) to only copy the used portions of the disk so it is very fast.


--
Les Mikesell
lesmikesell@gmail.com

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 07-19-2008, 11:39 PM
Dan Thurman
 
Default F9: Using dd to clone a drive...

Les Mikesell wrote:


Daniel B. Thurman wrote:

> > I used dd off the Gnome Live CD, so that neither
>> > drives were mounted nor active. Next I proceeded
>> > to use dd as follows:
>> >
>> > dd if=/dev/sda of=/dev/sdb
>> >
>> > It took approx. 6 hours to copy over 450GB of data.
>> >
>> You would be better off using gparted or clonzilla to do the
>> copping. With DD, it has to copy every byte. The others understand
>> file systems and only copy data, not empty space.
>>
> I tried Gparted-Live.
>
> Unfortunately, it failed to copy 85% of the way complaining
> about a bad block on the source drive! I have run the 'Check'
> and it does not even see any problems with the source drive!
> I even did a check on the destination drive and it says it does
> not see any problems either - even when the copy failed!
>
> Is there any tool besides fsck that really does a through job
> making sure to detect bad-blocks (if there really was any)
> and add it to the bad block list? Or, perhaps there is a problem
> with Gparted-Live v0.3.7.7.1 version?

A brute-force approach is 'cat /dev/sda >/dev/null'. If it completes,
run dmesg to see if there were any messages about soft errors or
retries. Also, smartctl -a /dev/sda might have something interesting
about the disk health.

I'd try to get a tar archive of the contents of that filesystem if there
is anything important on it. The bad spot might be on an unused portion
that a file based copy would miss.


> The sda6 partition size is correctly 604106921 (~300GB) so why
> the heck is Gparted reading 937752324, probably somewhere
> in the 7th partition (5GB swap) or even possibly at the end of
> the750GB drive itself?
>
> Of the 300GB / partition, only 49GB is actually used while the
> rest is actually empty space. Is that the problem? Is Gparted
> smart enough not to copy over empty space and end after 49GB
> of data?
>
> I have tried everything I could throw at it:
>
> Gnome-Live & Gparted Live:
> 1) mount /dev/sda6 /mnt/a
> mount /dev/sdb6 /mnt/b
> setenforce 0
> a) cp -acpx /mnt/a/. /mnt/b
> b) tar --xattrs -cpf - /mnt/a | (cd /mnt/b tar --xattrs -xpf - .)
>
> Nothing seems to work!
>
> Why am I not able to get the / partition copied over
> successfully? Everything is bootable *except* / !

Do you still have both drives in the same machine, and do they contain
LVM volumes? If you cloned the id's the duplicate might not work. The
solution might be as simple as unhooking the other drive. If the reason
you are cloning is to build a different machine and you also have enough
space on a networked drive to hold a compressed image copy, I recommend
using clonezilla-live. It's a bootable iso that will save the master
copy to a local or remote (nfs/smb/ssh) drive. Then you can boot it in
the target and it will reconstruct the partitioning and filesystems as
well as the contents. It knows enough about most filesystems (including
windows) to only copy the used portions of the disk so it is very fast.


Thanks to all who have replied with the suggestions. The ONLY product
that worked for me was CloneZilla! It *perfectly* cloned my drive and
I have an *exact* copy. All of the other clone CDs will be snapped in half!
And not only that, CloneZilla was DAMN FAST compared with any other
program that I have tried. GREAT (FREE) PRODUCT!

Dan

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

Thread Tools




All times are GMT. The time now is 12:30 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org