1

I followed a couple of tutorials, which implied I can copy Ubuntu image to a new hard driver by issuing the command dd /dev/sda /dev/sdb , which transmitted the data but not everything apparently since the new hard driver boots into BusyBox and I get a (initramfs) prompt. What is the best way for me to copy all the data from the old hard drive, which is by the way on its last leg into the new hard drive? I have gparted on the old image, and can also create a live usb, but I really like to learn how to transfer an entire hard drive image exactly as the original to the new hard drive. Is there way to do that? Can anyone tell me why the command above did not work? Could it be that the new hard drive is labled as /dev/sdb and the bootloader configuration is for /dev/sda?

3
  • 1
    Just by way of improving the content and learning more about this topic, I read the content of "How can I repair grub? (How to get Ubuntu back after installing Windows?" article stated above. I do not see how copying drives or the tools used for this is covered in that post. That post is about repairing the MBR, I am asking about copying a drive to another.
    – Sean
    Jun 15, 2017 at 19:05
  • Congratulations and thanks for sharing your solution :-)
    – sudodus
    Jun 18, 2017 at 4:53
  • Congratulations for solving your problem! However please don't put the answer into your question. Normally in such a case you should answer your own question and accept your answer but this question was closed as a duplicate. The detailed steps that led you to the point where you used the duplicate are highly specific to your system configuration and unlikely to be of use to anybody else. That's why I advocate to keep this question closed. I also took the liberty to toll back your edit that adds the "solution" to your question. Jun 18, 2017 at 9:02

2 Answers 2

3
  • Both dd and Clonezilla should be run when the computer is booted from a third drive. The source drive with the original system, and the target drive where you want the cloned copy should have no mounted partition.

  • The target drive must be at least as big as the source drive, not one single byte smaller. It is not enough that the nominal size is the same, look at the actual size of the source and target drives.

  • Both tools work, but Clonezilla is better than dd

    • Clonezilla is much safer because it asks questions and gives you a chance to double-check, that you will be writing to the correct target drive.
    • Clonezilla is faster because it can identify which blocks in the partitions that are used and copies only them, but skips the free blocks. It saves a lot of time, particularly if there is a lot of free space.
    • I suggest that you download a stable version of the Clonezilla iso file, create a live system in a DVD disk, USB pendrive or memory card.

      link: clonezilla.org

4
  • Just a follow up question; dd took 3 days to copy about 1TB of data, does Clonezilla take the same? It may be that my old drive is going kaput, and it is slow? I had to return my new hard drive. My old one is 1.5 TB, 2 actually but seems Linux goes up to 1.5, and I thought I can fit the data in a TB drive. I had no idea that there the hard requirement of device size.
    – Sean
    Jun 15, 2017 at 21:57
  • dd copies every single byte, also where there is no file. Clonezilla skips the parts of the drive with no file data. So unless the partitions are full with file data (no free space), Clonezilla will be faster. If the drive is half-full, Clonezilla need only copy half as much as dd, and it makes a considerable time-saving. If you copy the directories and files as directories and files from one partition and its file system to another partition and its file system, you can move from a bigger to a smaller drive (if the data fit in the smaller drive). But if you clone, you cannot do that.
    – sudodus
    Jun 15, 2017 at 22:24
  • Thanks. Would you share some links on how to do the copying so I can have the same configuration, and installed applications, or tell me what to search for, or is this an option in Clonezilla I can choose? I have a couple of apps, which took some work to install from source and do not want to lose them. Buying a larger drive is not a huge issue either.
    – Sean
    Jun 15, 2017 at 22:29
  • Search the internet with the phrase "clonezilla tutorial" (without quotes), to find several tutorials. Browse them and select one that shows what you need. Otherwise, at the directory and file level, you can use gparted to create the partition table and file systems on the target drive. Then you can use rsync to copy the direcotories and files. The manual man rsync is good, and you can find tutorials about rsync too via the internet. But in this case you must also install the bootloader and fix with some files or UUIDs of partitions plus probably add a swap partition: more complicated.
    – sudodus
    Jun 15, 2017 at 22:39
0

Use Clonezlla (sudo apt install clonezilla). This will handle all the weird specifics required to make it boot correctly.

Not the answer you're looking for? Browse other questions tagged .