1

I did get a new ssd and tried doing duplicate of the old ssd into the one, usind the dd command, but after finishing progressing the 250 Gb, everything from old and new ssd just disappeared.

This is the command I used:

sudo dd if=/dev/sda of=/dev/sdb status=progress
  • Which command did you used exactly? – ChanganAuto Mar 15 '22 at 19:38
  • sudo dd if=/dev/sda of=/dev/sdb status=progress – Mokhled Redjimi Mar 15 '22 at 19:40
  • 2
    Right. And are you sure those were the origin and target drives? DD is merciless, once started there's no way back. If you used the drives the other way around you just copied a blank drive to one that HAD something. If that was the case then it's lost, period. – ChanganAuto Mar 15 '22 at 19:41
  • yes am pretty sure, cause the first one was being copied and it has 250gb and it wzs progressing normally and after it finished, everything disappeared from it, the 2nd was empty – Mokhled Redjimi Mar 15 '22 at 19:42
  • 1
    Progression is shown regardless of what's happening. Did you check to make sure which one was sda and which was sdb? – ChanganAuto Mar 15 '22 at 19:46
  • On a side note, I think using cat is generally safer than dd. – mchid Mar 15 '22 at 19:47
  • yes am pretty sure the first one was the source and the 2nd is the target. it's weird – Mokhled Redjimi Mar 15 '22 at 19:48
  • 2
    Your dd copy copied the UUIDs of the partitions also, so vast confusion among drives is possible. – ubfan1 Mar 15 '22 at 19:48
  • What was the contents of /dev/sda before? Are you sure /dev/sda1 and others do not exist? – mchid Mar 15 '22 at 19:48
  • 1
    now they both got everything as unallocated space, before they both had partitions – Mokhled Redjimi Mar 15 '22 at 19:49
  • 1
    What you're seeing is exactly what is expected when a blank drive is cloned to another. And that is what must have happened. Keep in mind devices are enumerated depending on how the firmware reports them. Very likely the new drive you added is sda. That's why you should have checked after having both connected and before using dd. – ChanganAuto Mar 15 '22 at 20:08
  • if this is the case changanAuto, why would it show that it copied the 250gb and progressed it instead of 0gb in the new one? – Mokhled Redjimi Mar 15 '22 at 20:11
  • Anything overwritten is unrecoverable. Restore from backups – Nmath Mar 15 '22 at 20:20
  • Take a look at this: https://askubuntu.com/questions/191368/how-to-repair-partition-table. Maybe you can restore the partitiontable using your usb-stick. – Joepie Es Mar 15 '22 at 20:48
  • 1
    @MokhledRedjimi Again... Progress is shown no matter what is happening, be it one or more partitions being cloned or unpartitioned space looks EXACTLY the same from the dd's point of view. This is what I've been trying to make you understand since the beginning and that why dd is dangerous when you don't double or triple check the EXACT devices being cloned. You did the opposite operation of what you intended to do, end of story. – ChanganAuto Mar 15 '22 at 21:45
  • 1
    @JoepieEs No, it really doesn't work that way. dd has writen blank space in the old drive. There's no partition table, partitions or data inside to be recovered now. That's why dd is so often called "disk destroyer". Once started and pointed to the wrong drive it's game over! – ChanganAuto Mar 15 '22 at 21:47
  • @Changanauto thanks for explaining that. – Joepie Es Mar 15 '22 at 21:51
  • @MokhledRedjimi Sorry. I thought I had a solution for you. – Joepie Es Mar 15 '22 at 21:53

0 Answers0