You are not logged in.

#1 2015-09-07 19:10:23

kozaki
Member
From: London >. < Paris
Registered: 2005-06-13
Posts: 671
Website

NAND flash-memory devices cloning

Assuming dd is an efficient tool for cloning and backing up NAND flash-memory devices. How do you define the block size to use for cloning a SSD, or a lower-end USB stick / SD card? Wiki Disk cloning is awesome for HDDs but it does not even mention these devices --yet.

From the wiki:

# dd if=/dev/sdX of=/dev/sdY bs=512 conv=noerror,sync

This will clone the entire drive, including the MBR (and therefore bootloader), all partitions, UUIDs, and data.

    bs=512 sets the block size to 512 bytes, the "classic" block size for hard drives. If and only if your hard drives have a 4 Kib block size, you may use "4096" instead of "512". Also, please read the warning below, because there is more to this than just "block sizes" -it also influences how read errors propagate. [...]

If you are positive that your disk does not contain any errors, you could proceed using a larger block size, which will increase the speed of your copying several fold. [...] But keep in mind that read errors on the source disk will end up as block errors on the destination disk, i.e. a single 512-byte read error will mess up the whole 64 Kib output block.

Note: You may wish to use a block size (bs=) that is equal to the amount of cache on the HD you are backing up. For example, bs=8192K works for an 8 MiB cache. The 64 Kib mentioned in this article is better than the default bs=512 bytes, but it will run faster with a larger bs=.

To my understanding of the above and spinning drives vs flash memory devices' technologies:

For SSDs, that means using the page size (and not the Erase block size!) for a proper 'bs='. Also there's no point worrying for the buffer-cache, as a) wiki is somehow unclear on its impact when restoring (error propagating), and b) SSDs do not ship or handle cache memory as spinnings devices do. Is this correct?

As for low-end NAND flash-memory devices such as USB sticks and SD Cards: I'd also go for using their page size (found via eg flashbench) for a proper 'bs='. Thanks to USB 3.0, UHS-N and so on, they are more and more used for eg. smartphones/tablets storage (with a bunch of apps, valuable data or elaborated folder structures), or as handy live/rescue portable devices. Therefore the ability to cloning or backing them up efficiently (dd a few 64 GiB device with 'bs=8K' pfffoooow hmm ).

Your thoughts guys & lads?

Last edited by kozaki (2015-09-07 19:11:51)


Seeded last month: Arch 50 gig, derivatives 1 gig
Desktop @3.3GHz 8 gig RAM, linux-ck
laptop #1 Atom 2 gig RAM, Arch linux stock i686 (6H w/ 6yrs old battery smile) #2: ARM Tegra K1, 4 gig RAM, ChrOS
Atom Z520 2 gig RAM, OMV (Debian 7) kernel 3.16 bpo on SDHC | PGP Key: 0xFF0157D9

Offline

Board footer

Powered by FluxBB