Re: Using dd to clone smaller drive to larger drive



On Tue, Dec 06, 2005 at 08:27:47PM -0800, Brian C wrote:
> Hi,
>
> /dev/hda is the Debian Sarge system, w/ 3 partitions.
> /dev/hdb is a new slightly larger drive w/ no partitions.
>
> /dev/hda may have a bad block or two, and so the plan is to clone it to
> the new drive, remove the old drive, move new drive to /dev/hda (primary
> master) and then run from the new drive.
>
> Can I just type (as root):
>
> dd if=/dev/hda of=/dev/hdb
>
> and will that just work?
Hi Brian,

I generally think that your approach is fine, especially because you
mention bad sectors. With dd you get everything from the failing disk
and you can worry about recovering files later. I would however suggest
the following modification:

make partition on /dev/hdb; mount it

dd if=/dev/hda1 of=/mnt/hdb1/backup_dd_hda1.img
dd if=/dev/hda2 of=/mnt/hdb1/backup_dd_hda2.img
dd if=/dev/hda3 of=/mnt/hdb1/backup_dd_hda3.img

You can then mount your partition images with

mount -o loop /mnt/hdb1/backup_dd_hda1.img /mnt/loop1
mount -o loop /mnt/hdb1/backup_dd_hda2.img /mnt/loop2
mount -o loop /mnt/hdb1/backup_dd_hda3.img /mnt/loop3

and work on them/fix them/copy them as you like.

Hth

Andreas
>
> Should I first set up the new drive with identical partitions to the old
> drive?
>
> If so, what can I do with the extra space?
>
> What will happen if dd encounters a bad block?
>
> Thanks,
> Brian
>
>
--
Andreas Rippl -- GPG messages preferred
Key-ID: 0x81073379

Attachment:signature.asc
Description: Digital signature



Relevant Pages

  • Re: Problem with random disks mount sequence
    ... I'll get random mount sequences. ... At the beginning the USB ... nautilus remember that 'storage3' was 1st partition, ... SCSI drives are listed by order of discovery. ...
    (Fedora)
  • Re: Relabel partition didnt work
    ... > You're confusing disk lables with mount points. ... > When installing etch, at some point partman asked for a mount point for ... > that partition and I entered /xyz. ... There's nothing to do to the second hard disk. ...
    (Debian-User)
  • Re: Ubuntu second hard drive was Windows partition
    ... Ubuntu second hard drive was Windows partition ... If ntfs-3g does come default in ubuntu, you can probably mount the ... on these lists for a couple of years now and should know what to say and ...
    (Ubuntu)
  • Re: R/W access of a vfat partition by any user ?
    ... FAT32 partition will be writable by any user instead of just root. ... users Allow every user to mount and unmount the file system. ... The 'umask=022' makes all files and directories have rwxr-xr-x permissions. ... If you want different perms and you don't speak binary, ...
    (alt.os.linux.suse)
  • Re: Newbie: Accessing Windows filesystem in Fedora Core 4
    ... As with mounting your Win2000 partition to get access to it, ... Firstly it would be better to mount it manually and then if things work ... Use the mount command to mount the win2000 partition in /mnt/win2000 ...
    (linux.redhat.install)