[sclug] Copy drive problem

Philip Hands phil at hands.com
Sat Mar 2 11:40:27 UTC 2013


Ed Davies <sclug.xu.1106 at edavies.me.uk> writes:

> On 2013-03-01 15:42, Neil Haughton wrote:
>> IDE0 slave - my old drive (two partitions, sdb1, sdb2,  mounted as /boot
>> and /home )
>
> That's /var and /home?
>
>> Then I booted the machine, logged in, and as root ran gparted to partition
>> the new drive into one about the same size as /dev/sdb1 (/var), and the
>> rest for the second parition. I used the default partition table format
>> (msdos), both partitions ext3 to match the 'old' partitions.
>
> I don't think it matters what file system you put on those partitions
> if you're about dd over them. The type in the partition table matters,
> of course.
>
> Also, having a bigger partition for /home won't help, I think, if
> you dd on a file system set up for a smaller partition. AIUI, the
> extra blocks at the end will just be ignored.

Well, you can run resize2fs on it after the copy is done, and that will
grow the filesystem to fit the partition, so it will be ignored only
until you do that.

>> Then I tried as root to 'dd' the sdb1 partition (/var)  to its new home:
>> 
>> dd if=/dev/sdb1 of=/dev/sdc1
>
> Dunno, but it seems unwise to me to dd from a partition which is
> mounted, at least if it's mounted for write. (You don't say if your
> reboot changed the mounted status of this partition - probably worth
> being clear about such things.)

Quite.

>> After a long pause the message 'read error' appeared and dd bombed out,
>> with only a couple of MB transferred.  Why would this be? Have I done
>> anything wrong or missed out a vital step?
>
> Dunno again, but Alex's answer sounds the most likely to me.

If dd bails out because of bad blocks, as seems to be the case here as
Alex suggests, then there's ddrescue

  http://www.forensicswiki.org/wiki/Ddrescue

which will carry on past the bad blocks, and then keep retrying the bad
blocks -- quite often it'll get your data off if there's any chance of
it being occasionally readable.

Cheers, Phil.
-- 
|)|  Philip Hands [+44 (0)20 8530 9560]    http://www.hands.com/
|-|  HANDS.COM Ltd.                    http://www.uk.debian.org/
|(|  10 Onslow Gardens, South Woodford, London  E18 1NE  ENGLAND
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
Url : http://sclug.org.uk/pipermail/sclug/attachments/20130302/9ffd39ea/attachment.bin 



More information about the Sclug mailing list