{"id":231,"date":"2013-01-20T08:02:45","date_gmt":"2013-01-20T08:02:45","guid":{"rendered":"http:\/\/www.buildingcubes.com\/?p=231"},"modified":"2025-02-21T15:00:49","modified_gmt":"2025-02-21T15:00:49","slug":"dd_rescue-gddrescues-ddrescue-for-disks-with-advanced-format-af-4kib-sectors-4096-byte","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2013\/01\/20\/dd_rescue-gddrescues-ddrescue-for-disks-with-advanced-format-af-4kib-sectors-4096-byte\/","title":{"rendered":"DD_RESCUE ( GDDRESCUE&#8217;s ddrescue ) for disks with Advanced Format ( AF ) 4KiB sectors 4096 byte"},"content":{"rendered":"\n<p>1- Before using dd, ddrescue, or dd_rescue, you need to know which disk is which, you can do that by simply using the command &#8220;fdisk -l&#8221; in my case, the old disk turned out to be \/dev\/sdb and the new un-partitioned disk is \/dev\/sdc.<\/p>\n\n\n\n<p>So, i have been cloning a 2TB hard drive ( WD20EARS ) to a WD20EARX, same disk, but with a few differences<\/p>\n\n\n\n<p>WD20EARS is sata 2 and the other is sata 3, another difference is that using &#8220;hdparm -I \/dev\/sdb&#8221; the older WD20EARS reports (And should not be true)<\/p>\n\n\n\n<p>WD20EARS<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Logical\/Physical Sector size:           512 bytes\n<\/pre>\n\n\n\n<p>wile with &#8220;hdparm -I \/dev\/sdc&#8221; the newer WD20EARX reports<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">        Logical  Sector size:                   512 bytes\n        Physical Sector size:                  4096 bytes\n        Logical Sector-0 offset:                  0 bytes\n<\/pre>\n\n\n\n<p>The first clone did not work for a reason <strong>unknown to me<\/strong>, i cloned my NTFS disk with ddrescue (gddrescue) on a linux (because i don&#8217;t know how to clone on windows) and then plugged it into windows, where it simply did not work, and in disk management reported the disk as un-partitioned space, so now i want to do the thing again, but i don&#8217;t want that slow performance, so i increased block size to 4KiB. (UPDATE: THE NEW COPY WITH 4KiB DID WORK BUT I DONT KNOW IF THE 4KiB SIZE IS RELEVANT, MAYBE YOU SHOULD TAKE A LOOK AT THE SECOND DIFFERENCE BETWEEN THE DISKS UP AT THE BEGINNING OF THE POST)<\/p>\n\n\n\n<p>For now, i will try the cloning with the command (Only change the block level for advanced format hard drives)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Note, block size no longer works, and it is called sector-size, but the short letter for it -b is still the same, so we will change this to the line below it\n<s>ddrescue --block-size=4KiB \/dev\/sdb \/dev\/sdc rescue2.log\n<\/s>ddrescue -b=4KiB \/dev\/sdb \/dev\/sdc rescue2.log<\/pre>\n\n\n\n<p>And if all of your data is important, you can ask ddrescue to retry every bad block 3 times (or as many times as you wish) with the -r command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><s>ddrescue --block-size=4KiB -r3 \/dev\/sdb \/dev\/sdc rescue2.log\n<\/s>ddrescue -b=4KiB -r3 \/dev\/sdb \/dev\/sdc rescue2.log<\/pre>\n\n\n\n<p>And what do you know, the disk now works on my WINDOWS machine \ud83d\ude00 no errors and no nothing, great, so now to some details about the copy<\/p>\n\n\n\n<p>The result up to now is that i am reading at a maximum of 129MB while the average (in the first 60 GBs is 93018 kB\/s), if this continues, i will be done in less than 6 hours.<\/p>\n\n\n\n<p>The part that does not make any sense to me is that western digital states clearly in the specs that the maximum (Host to\/from drive (sustained)) is 110 MB\/s for both drives, it must be that i need to wait a bit more and see what that actually means.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rescued:         0 B,  errsize:       0 B,  errors:       0\nCurrent status\nrescued:    74787 MB,  errsize:       0 B,  current rate:     119 MB\/s\n   ipos:    74787 MB,   errors:       0,    average rate:   93018 kB\/s\n   opos:    74787 MB,     time from last successful read:       0 s\nCopying non-tried blocks...\n<\/pre>\n\n\n\n<p>Now, once done, you can have the OS reload the partition table without having to restart, you can simply use the command partprobe<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">partprobe\nor\npartprobe \/dev\/sdc\n<\/pre>\n\n\n\n<p>To use partprobe, you need to install parted<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get install parted<\/pre>\n\n\n\n<p>If it were a linux drive, an advanced format drive would not have it&#8217;s first sector on sector 63 but rather on sector 2048, which is at exactly 2KiB, it could (but usually does not) start at any other value divisible by 8.<\/p>\n\n\n\n<p>Windows probably does something similar for our AF Disk, so asking parted about our ntfs disk, this is what parted says<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Model: ATA WDC WD20EARS-00M (scsi)\nDisk \/dev\/sdb: 2000GB\nSector size (logical\/physical): 512B\/512B\nPartition Table: msdos\n\nNumber  Start   End     Size    Type     File system  Flags\n 1      1049kB  2000GB  2000GB  primary  ntfs\n<\/pre>\n\n\n\n<p>1049kB is 1074176 bytes, Which when divided by 8 is 134272 (divisible by 8).<\/p>\n\n\n\n<p>NOTES:<br>-There is a tool specifically for cloning ntfs volumes called ntfsclone, i am not sure what extra features it provides that are specific to ntfs, i have never used it before, with my disk that has bad blocks, i can only rely on gddrescue.<br>-A block is 512 on regular drives, and 4096 on newer ones, if you want to backup the hard drive&#8217;s geometry, you can do one of the following<br>Backup the first 63 blocks (MBR + Bootloader). on a &#8220;non advanced format&#8221; drive<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dd if=\/dev\/sda of=\/mnt\/storage\/sda.vbr bs=512 count=63<\/pre>\n\n\n\n<p>On an advanced format drive, we can try<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dd if=\/dev\/sda of=\/mnt\/storage\/sda.vbr bs=4096 count=63<\/pre>\n\n\n\n<p>Which, will make us read 258048 bytes rather than the traditional 32256 bytes (around 250K rather than 32K)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1- Before using dd, ddrescue, or dd_rescue, you need to know which disk is which, you can do that by simply using the command &#8220;fdisk -l&#8221; in my case, the old disk turned out to be \/dev\/sdb and the new un-partitioned disk is \/dev\/sdc. So, i have been cloning a 2TB hard drive ( WD20EARS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,215,4,32],"tags":[35,37,38,41,46,45,53,62,69,71],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-hard-disks","category-hdparm","category-linux","category-ntfs","tag-advanced-format","tag-af","tag-bad-blocks","tag-clone","tag-dd_rescue","tag-ddrescue","tag-fdisk","tag-hdd","tag-ntfs-2","tag-parted"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=231"}],"version-history":[{"count":2,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":5018,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/231\/revisions\/5018"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}