HD to SSD question.

Gregory Hosler ghosler at redhat.com
Wed Aug 21 03:13:43 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/19/2013 04:57 AM, Erik P. Olsen wrote:
> I plan to swap the HD on my laptop with an SSD of same size. Will it work
> OK if I dd the HD to an external HD, swap the HD with the SSD and dd the
> contents back to the SSD? I believe I can use knoppix to the process.
> 

it would be safer to create your partitions, and then dd them (the partitions)
one by one from one place to the other (or use backup storage in between).

examples:

	dd if=/dev/sda1 of=/dev/sdb1 bs=1024000

with backup storage (in this case a file -- probably very large)

	dd if=/dev/sda1 of=/junk/sda1 bs=1024000
	dd if=/junk/sda1 of=/dev/sdb1 bs=1024000

Thinks to keep in mind:

large bs will make the copy faster. multiples of 1024 are good in that the
layout on the disk (at the block layer) will be 1024.

the destination partition needs to be same size or larger. This will NOT work
if the destination is smaller. In that case resize the source partition to be
the same size or smaller before the dd. If you DO need to do this, then you
will need to compute bs= / size= so that they match (or slightly exceed) the
filesystem size, since the dd would (by default) copy the entire partition.

Once the copy is complete do a resizefs on it to expand the filesize to the
new partition size.

Note that the swap partition should just be recreated (mkswap) instead of
copied. This is especially true if the new swap partition is a different size.

This method can also be used to copy file systems from a partition to an lv (a
"logical" partition, if you will) or vice versa.

===

I use this method all the time whenever I am migrating to a new (larger) disk
with larger partitions.

I create the new partition table (with same or larger sized partitions) and
then I dd from the old to the new (placing the new disk in an external usb
casing).

Swap disks, boot into a rescue disk, re-write my mbr, and i'm done.

one last thing...

The source partition should be unmounted. If a mounted partition is being
copied, then the result (destination) is that mounted partition. As boot time,
it will need to be fsck. Any open files will be in whatever state they were in
when they were copied. Hence, all files should be closed.

When I do the above mentioned migration, I boot into single user mode and then
do my dd. no services running, no user space stuff editing/creating files, etc.

Been doing this for years.

All the best,

- -Greg


- -- 
+---------------------------------------------------------------------+

Please also check the log file at "/dev/null" for additional information.
                (from /var/log/Xorg.setup.log)

| Greg Hosler                                   ghosler at redhat.com    |
+---------------------------------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlIUMGYACgkQ404fl/0CV/SCSwCfeLA90tldMBTEkMEcSiyv13ks
TZgAoLb7oQ7dNJJs9/jtSNvOx044q7ye
=a41X
-----END PGP SIGNATURE-----


More information about the users mailing list