0

I have read many questions similar to mine, but still can't get it to work. I have a working pc with 2 hard drives, ssd drive of 256 GB on which the OS is installed (/dev/sda), and 1TB sata drive for home folders, data, etc. (/dev/sdb). I am trying to clone the installation (and hopefully the data drive as well) to an identical pc (hardware wise) over ssh. I booted into the new pc using Ubuntu 16 live cd, installed ssh, and then use dd over ssh from the first pc:

sudo dd bs=64K conv=noerror,sync if=/dev/sda | gzip -1 - | ssh ubuntu@ip_address "sudo dd of=/dev/sda"

The problem is, after dd is done, the new computer doesn't recognize any bootable disk, and if I again boot using the live cd, the disk appears as 'unallocated' in gparted. If I try to mount it, I get:

mount: wrong fs type, bad option, bad superblock on /dev/sda, missing codepage or helper program, or other error

The same happens with the 2nd drive.

As a side note, I've seen many solutions with the advice to use boot repair, however when I try to install it in the live cd boot session, I get an error about the ppa not having this package (when trying to add it by sudo add-apt-repository ppa:yannubuntu/boot-repair)

Any idea what goes wrong?

  • 2
    When you clone a drive (HDD, SSD, etc) you should have nothing mounted on that drive. You should boot from another drive, for example an Ubuntu live drive or a Clonezilla live drive (USB, DVD, memory card). In Ubuntu you can use dd to a local drive. In Clonezilla you can clone to a local drive or to a connected drive to a server (but not to the drive running the server during the cloning operation). I recommend Clonezilla because it is both safer and faster compared to dd. See clonezilla.org – sudodus Jun 5 '17 at 7:01
  • You mean the source drive cannot be mounted? – Itamar Katz Jun 5 '17 at 7:27
  • 1
    That's right. When some partition on the source drive is mounted (and particularly, when running from it), the content can change during the process and the resulting cloned copy might be or will probably be damaged. – sudodus Jun 5 '17 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.