copy full system from old disk to a new one

Gordan Bobic gordan at bobich.net
Tue Feb 19 18:19:17 UTC 2013


On 19/02/2013 17:48, Heinz Diehl wrote:
> On 19.02.2013, Reindl Harald wrote:
>
>> i can not remember when the last ext3/ext4
>> had 512 bytes blocksize
> [....]
>
> Most of the "conventional" harddisks have a sectorsize/blocksize of
> 512/512. All the newer and bigger WD/Seagate drives and SSDs are using
> "advanced format", which means 512/4096.
>
> To support this, there are two factors which must be present:
>
> 1. Proper alignment to 4k block boundaries
> 2. A filesystem on top which supports 4k blocksize
>
> If you use "dd" to raw-copy a 512/512 drive to a newer WD/Seagate or a
> SSD, this will result in misalignment (even if your FS supports the 4k
> blocksize) causing huge performance loss.
>
> To avoid this, you'll have to create proper aligned partitions on the
> new drive first, formatted with a FS supporting 4k blocksize,
> and copy the data the "traditional" way, e.g. using cp, rsync and brothers.

To ensure proper alignment it is sufficient to manually partition to 4KB 
boundaries and then dd individual partitions over (as opposed to the 
whole disk in one transfer). Of course, mkfs + [cp | rsync | tar] will 
be much more efficient as it only transfers the files, rather than also 
the empty space.

Gordan


More information about the users mailing list