RogerTa
May 7th, 2013, 03:35 AM
Hi all,
Summary:
Copying an old hdd to a new ssd results in misaligned partitions. Is there a way to fix this during the copy or after the copy?
Full version:
I am running ubuntu 10.04.4 LTS:
$ uname -a
Linux sodium 2.6.32-46-generic #108-Ubuntu SMP Thu Apr 11 15:56:25 UTC 2013 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS"
The main disk was a Hitachi Travelstar 7K200 hdd, which I upgraded to an ssd. I did not want to reinstall the OS or s/w packages, so I cloned the disk using the command:
dd if=/dev/sda of=/dev/sdb
I then took the original hdd out and put the ssd in its place. The machine boots just fine with the side effect of being much faster :-) However, with I run fdisk I get warnings about misalignment of sector boundaries:
$ sudo fdisk -l -u
Disk /dev/sda: 240.1 GB, 240057409536 bytes
255 heads, 63 sectors/track, 29185 cylinders, total 468862128 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x158fa71c
Device Boot Start End Blocks Id System
/dev/sda1 * 63 240187814 120093876 7 HPFS/NTFS
Partition 1 does not start on physical sector boundary.
/dev/sda2 240187815 312576704 36194445 5 Extended
Partition 2 does not start on physical sector boundary.
/dev/sda5 240187878 309508289 34660206 83 Linux
Partition 5 does not start on physical sector boundary.
/dev/sda6 309508353 312576704 1534176 82 Linux swap / Solaris
Partition 6 does not start on physical sector boundary.
I did some research and found that newer disk really like partitions to be 4K aligned, whereas older disk only need 512 byte alignment. See http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
Is there anyway to realign the partitions without erasing them?
Alternatively, is there anyway to copy the original hdd to the ssd using dd (or some other tool) that can realign as the copy is made?
Thanks!
Summary:
Copying an old hdd to a new ssd results in misaligned partitions. Is there a way to fix this during the copy or after the copy?
Full version:
I am running ubuntu 10.04.4 LTS:
$ uname -a
Linux sodium 2.6.32-46-generic #108-Ubuntu SMP Thu Apr 11 15:56:25 UTC 2013 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS"
The main disk was a Hitachi Travelstar 7K200 hdd, which I upgraded to an ssd. I did not want to reinstall the OS or s/w packages, so I cloned the disk using the command:
dd if=/dev/sda of=/dev/sdb
I then took the original hdd out and put the ssd in its place. The machine boots just fine with the side effect of being much faster :-) However, with I run fdisk I get warnings about misalignment of sector boundaries:
$ sudo fdisk -l -u
Disk /dev/sda: 240.1 GB, 240057409536 bytes
255 heads, 63 sectors/track, 29185 cylinders, total 468862128 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x158fa71c
Device Boot Start End Blocks Id System
/dev/sda1 * 63 240187814 120093876 7 HPFS/NTFS
Partition 1 does not start on physical sector boundary.
/dev/sda2 240187815 312576704 36194445 5 Extended
Partition 2 does not start on physical sector boundary.
/dev/sda5 240187878 309508289 34660206 83 Linux
Partition 5 does not start on physical sector boundary.
/dev/sda6 309508353 312576704 1534176 82 Linux swap / Solaris
Partition 6 does not start on physical sector boundary.
I did some research and found that newer disk really like partitions to be 4K aligned, whereas older disk only need 512 byte alignment. See http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
Is there anyway to realign the partitions without erasing them?
Alternatively, is there anyway to copy the original hdd to the ssd using dd (or some other tool) that can realign as the copy is made?
Thanks!