Notifications
Clear all

Clone an SSD Drive.  

hack3rcon
(@hack3rcon)
New Member

Hello,
I have an SSD drive that using kind of Linux or Unix(QNX). It is an SSD drive for a switch device.
I want to create a backup from it. The SSD drive has below structure:

$ lsblk -f
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT

sdc
├─sdc1
│ vfat /sysro
│ 020C-0000
├─sdc2
│ vfat /db 0257-0000
├─sdc3
│ vfat /vmail
│ 02F6-0000
├─sdc4

├─sdc5
│ vfat /sysro
│ 036A-0000
├─sdc6
│ vfat /db 037F-0000
└─sdc7
vfat /unused
03FA-0000

First, I unmounted all of the partitions:

$ sudo umount /dev/sdcX

Then, used below command to create a clone:

$ sudo dd if=/dev/sdc of=/home/jason/SSD.dd
234441648+0 records in
234441648+0 records out
120034123776 bytes (120 GB, 112 GiB) copied, 2850.17 s, 42.1 MB/s

And:

$ file SSD.dd
SSD.dd: DOS/MBR boot sector; partition 1 : ID=0x6, active, start-CHS (0x0,1,1), end-CHS (0x8f,254,63), startsector 63, 2313297 sectors; partition 2 : ID=0xb, start-CHS (0x90,0,1), end-CHS (0x3ea,254,63), startsector 2313360, 13799835 sectors; partition 3 : ID=0xc, start-CHS (0x3eb,0,1), end-CHS (0x3ff,254,63), startsector 16113195, 29543535 sectors; partition 4 : ID=0xf, start-CHS (0x3ff,0,1), end-CHS (0x3ff,254,63), startsector 45656730, 188784918 sectors

After it, I plugged another SSD drive with the same capacity and executed below command to recover the image to this new SSD drive:

# dd if=SSD.dd | pv | dd of=/dev/sdc bs=1M
234441648+0 records iniB/s] [ <=> ]
234441648+0 records out
120034123776 bytes (120 GB, 112 GiB) copied, 4376.66 s, 27.4 MB/s
111GiB 1:12:56 [26.2MiB/s] [ <=> ]
1+2129501 records in
1+2129501 records out
120034123776 bytes (120 GB, 112 GiB) copied, 4415.03 s, 27.2 MB/s

But, when I plugged this new SSD to the switch then it doesn't work!
I guess, the drive has some hidden parts (HPA and DCO), Any tools that can copy these parts when cloning?

Thank you.

This topic was modified 2 months ago 2 times by hack3rcon
Quote
Topic starter Posted : 01/12/2020 1:07 pm
jaclaz
(@jaclaz)
Community Legend

>After it, I plugged another SSD drive with the same capacity

Maybe the same or maybe not, unless the new SSD is the exact same brand and model. (and basically this is what the DCO is for, but on SSD's DCO - and HPA - managing may be complicated by "overprovisioning" and what not):

https://www.thomas-krenn.com/en/wiki/SSD_Over-provisioning_using_hdparm

Exact make/model of the switch?

Exact make/model of both the "source" and "target" SSD's?

Running on both SSD's:

hdparm -N /dev/sdc

won't make any harm, however, and will tell you if "normal" size is the same.

jaclaz

 

 

 

 

 

ReplyQuote
Posted : 01/12/2020 1:47 pm
athulin
(@athulin)
Community Legend
Posted by: @hack3rcon

But, when I plugged this new SSD to the switch then it doesn't work!
I guess, the drive has some hidden parts (HPA and DCO), Any tools that can copy these parts when cloning?

You seem to assume that pv is forensically neutral.   I assume you have verified that it is.

Have you examined how the SSD normally is created? That is, followed the advice or requirements by the reference manual or other documentation?

The reason I ask is that some devices require correctly initialized media -- sometimes to ensure that bad media cannot be used for backup copies (could be used to extract management passwords), or allow pre-prepared media to be accepted as backup media. (It could be something like writing the SSD serial number in a file somewhere, and verifying that it is correct on mount.) This, obviously, depends on what kind of switch this is, but the presence of a SSD suggests something a little more than a basic unmanaged consumer switch.

If that should happen to be the case, you need to follow switch management SOPs: read the manual or ask manufacturer's support line for help.

 

(Added: After thinking a bit ... you talked about making a backup, not a forensic image. If that reflects what you need, I think you should check into the software already provided: there are backup functionality in MiVoice and, it seems, also in the system software. )

ReplyQuote
Posted : 01/12/2020 4:27 pm
hack3rcon
(@hack3rcon)
New Member

@jaclaz Thank you.

The device is MITEL 3300. This device is using a 120GB SSD Drive. Device SSD is AMD and I used an ADATA SSD Drive 120GB.

Others used clone button on HDD Docking device like

and it's worked.

Why HDD Docking device can clone it but "dd" can't?

This post was modified 2 months ago 3 times by hack3rcon
ReplyQuote
Topic starter Posted : 01/12/2020 4:41 pm
jaclaz
(@jaclaz)
Community Legend

Maybe the pv? (it would be "queer", but you never know).

Or maybe the "bs=1M" ?

You should try checksumming (MD5 is good enough) source and target.

The two SSD's (original and copy made through the hardware duplicator) should be the same.

As well the SSD.dd image should have the same.

jaclaz

ReplyQuote
Posted : 01/12/2020 6:02 pm
AmNe5iA
(@amne5ia)
Active Member

Why are you using pv at all?  You didn't use it to create the dd file so why use it to copy the dd file to the new device? You also didn't specify the bs=1M for the initial dd file so again why include it to clone the device?

just use:

sudo dd of=/dev/sdc if=/home/jason/SSD.dd

ReplyQuote
Posted : 02/12/2020 2:42 pm
Tic-Tac
(@tic-tac)
New Member

I would use dcfldd just for the convenience.

dcfldd if=/dev/sdc conv=sync,noerror bs=512 of=SSD.dd

dcfldd if=SSD.dd conv=sync,noerror bs=512 of=/dev/sdc

 

Also make sure that the source SSD and the target SSD have the same sector size. Trying to clone a 512-byte/512-byte or 512-byte/4096-byte physical/logical sector SSD to a 4k native SSD (4096-byte sectors physical/logical) will not work as your partitions will be misaligned.

ReplyQuote
Posted : 05/12/2020 1:05 pm
jaclaz
(@jaclaz)
Community Legend
Posted by: @tic-tac

Also make sure that the source SSD and the target SSD have the same sector size. Trying to clone a 512-byte/512-byte or 512-byte/4096-byte physical/logical sector SSD to a 4k native SSD (4096-byte sectors physical/logical) will not work as your partitions will be misaligned.

Correct, but IMHO improbable.

Full 512 byte/sector SSD's do not exist (AFAIK), they were all born 512e. i.e. with internal sector size 4k but exposing 512 bytes.

Native 4K SATA SSD's are still pretty much rare, still AFAIK, and are more or less in the "high" end or in the NvMe or PciE formats.

A number of SSD's can have the firmware changed so that they become 4k native, but generally speaking they are still shipped as 512e.

jaclaz

ReplyQuote
Posted : 06/12/2020 9:11 am
Tic-Tac
(@tic-tac)
New Member
Posted by: @jaclaz
Posted by: @tic-tac

Also make sure that the source SSD and the target SSD have the same sector size. Trying to clone a 512-byte/512-byte or 512-byte/4096-byte physical/logical sector SSD to a 4k native SSD (4096-byte sectors physical/logical) will not work as your partitions will be misaligned.

Correct, but IMHO improbable.

Full 512 byte/sector SSD's do not exist (AFAIK), they were all born 512e. i.e. with internal sector size 4k but exposing 512 bytes.

Native 4K SATA SSD's are still pretty much rare, still AFAIK, and are more or less in the "high" end or in the NvMe or PciE formats.

A number of SSD's can have the firmware changed so that they become 4k native, but generally speaking they are still shipped as 512e.

jaclaz

Agreed about the 4k native drives. I have yet to see a 512e SSD. Seen many 512e mechanical drives though. For example, this one is fairly new and if you can trust smartctl it's 512/512.

smartctl 7.1 2019-12-30 r5022 (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model: SSD 256GB
Serial Number: AA200300000705004130
Firmware Version: S1206A0
User Capacity: 256 060 514 304 bytes [256 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: mSATA

 

 

ReplyQuote
Posted : 06/12/2020 10:11 am
jaclaz
(@jaclaz)
Community Legend

I think that the firmware (or software) is "lying".

A SSD page is anyway at least 2K, AFAIK, and more commonly 4 K.

Anyway the point is that - not unlike modern hard disks - SSD's are "black boxes" of which you know nothing if not what they "expose".

I will gladly rephrase as "improbable as most - like 99.99% of SATA SSD's do expose to the OS 512 bytes sectors".

jaclaz

ReplyQuote
Posted : 06/12/2020 1:00 pm
Share: