HD to SSD question.

ergodic gmml at embarqmail.com
Wed Aug 21 15:15:57 UTC 2013


Caveat.

The UUIDs of the newly partitioned drive will most probably
be different from those of the original drive which can create
problems with the booting and swap partitions.
Check the /etc/fstab file to see what UUIDs the OS is using.

The UUIDs of the original drive and partitions should be identical
to those of the cloned drive.
When a whole drive is cloned all at once the UUIDs are the same.

The following commands can be used to check the UUID:

$ ls -l /dev/disk/by-uuid/
or:
$ blkid /dev/sdxy (where x = drive, y = partition, eg. /dev/sda1)
or:
sudo blkid

To assign a given UUID to a drive/partition use the command 
tune2fs eg.

sudo tune2fs /dev/sdb4 -U f0acce91-a416-474c-8a8c-43f3ed3768f9

This command will change the UUID of /dev/sdb4 to "f0acce91-a416-474c-8a8c-43f3ed3768f9"

Also try the command dcfldd it is an improved dd. 
 




----- Original Message -----
-----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-----
-- 
users mailing list
users at lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


More information about the users mailing list