Cloning an entire SSD Step-by-Step Instructions?

Hello,

I wish to clone my entire 120gb SSD (A) with OpenSUSE 13.2 KDE loaded onto another 120gb SSD(B).

I have all the adapters I need, what I lack is the knowledge.

I was wondering if someone could let me go through a step-by-step instructions on how to achieve this? I basically want the B formatted and partitioned EXACTLY as A(I use Ext4 by the way, BTRFS left me a bad taste a few months ago).

Best way is to use a clone program like Clonezilla

You can use dd to do a binary copy of the drive. Note you copy the drive not a partition on a drive. Copying partitions may change the UUID thus making boot a bit harder

So, where would I find step-by step instructions for clonezilla?

Here are more details.

Work as root.

Connect the two drives. Find their names through command

fdisk -l

The names may be, say, /dev/sdc and /dev/sdd. Attention: be very careful with the names, otherwise some disk will be wiped out. The name of a disk cannot be /dev/sdc1

Now, let /dev/sdc be the source and /dev/sdd be the destination. Naturally, /dev/sdd must be greater or equal to /dev/sdc in capacity. The formatting and partitioning of /dev/sdd doesn’t matter before the dd command is issued, since the entire disk, including its partition table, will be overwritten.

The copy (otherwise known as disk dump, dd, imaging, cloning) command is

dd if=/dev/sdc of=/dev/sdd; sync

Be very careful with the syntax of the command. There are no warnings about overwriting issued.

However, this type of copy has very narrow use. I find it possible that /dev/sdd cannot be used as bootable OS disk, because of names. But I don’t know much and haven’t done such a thing.

What it will serve perfectly for, is a backup for /dev/sdc, since you can bring back the content from /dev/sdd to /dev/sdc, and then /dev/sdc will work as OS disk.

dd is by far the best and I would suggest
Something like

ionice -c3 ddrescue /dev/sda /media/sdc1/laptop.iso

Where sda is the sdd
And where: /media/sdc1/laptop.iso is the target

You will need to replace with your actual source and target which will vary.

I usually run all this from Parted Magic live session

On the clonezilla website maybe???

http://clonezilla.org/

Confirmation:



Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x389a1131


Device     Boot    Start       End   Sectors  Size Id Type
/dev/sda1           2048  16771071  16769024    8G 82 Linux swap / Solaris
/dev/sda2  *    16771072 241168383 224397312  107G 83 Linux


Disk /dev/sdb: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0001cc68


Device     Boot  Start       End   Sectors   Size Id Type
/dev/sdb1         2048    206847    204800   100M  7 HPFS/NTFS/exFAT
/dev/sdb2  *    206848 234436607 234229760 111.7G  7 HPFS/NTFS/exFAT


Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 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
Disklabel type: dos
Disk identifier: 0x879e7d5c



suppose my sda is Linux OS, sdc is mounted drive.
dd if=/dev/sda of=/dev/sdc; sync
would do the trick?

Also slight problem, I just realized that my LinuxSSD is 128gb, and target SSD is 120gb, any way to still clone it? I’m using maybe 40gb of 128gb in originating drive.

no

Target must be equal or greater then the source

You could partition the target and copy files but you do have the problem of different UUID for the partitions and thus must edit some files to allow a boot from the target media.

I’m listening.

What don’t you understand?
ASSUMING a EFI BOOT

  1. create equivalent partition on the target
  2. copy files to the target (can use dd for that (man dd for details))
  3. determine the UUID for partitions now on the target (hint info is in /dev/disk/by-uuid)
  4. mod the /etc/fstab on the target to point mounts to the new UUIDs
  5. to boot you will need to reinstall grub
    for detail need to know details ie fdisk -l after the files coopied

Using Clonezilla is so easy, documentation really isn’t needed. But, if you want to know how to do it, I assume there should be many blogs by people who described their step by step experience. Maybe even a YouTube video.
Only BIG issue to be careful about which is common to all copying that is destructive (wipes out the target before copying) is that you <must> <absolutely> be certain which is the source and which is the target when configuring.

As for the smaller target disk, IIRC and AFAIK (Yeah),
When doing disk copying, only the partition contents of the disks are important. The actual geometry and size of the disks <might> not be as important.

If that is true, then you should be able to shrink the last partition of your source disk using something like Gparted Live (http://gparted.org/livecd.php) by maybe 20MB before running Clonezilla. And, you shouldn’t really need documentation how GParted Live works, it’s very intuitive.

TSU

So far,

  1. Gparted -> shrink / a little bit
  2. Clonezilla -> I dentify sda and sdc
  3. Clonezilla clone sda to sdc ?

<Assuming> you have a default disk layout, yes.
You can also display your existing partition and disk layout with each of the following which displays the disk information in different ways.

fdisk
dl
dl -h

TSU

Sorry,
I must have had a brain freeze, don’t know where that “dl” came from
Use “df” as follows

fdisk
df
df -h

TSU

Gyro:/home/SJL # fdisk -l; df; df -h;

Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x389a1131


Device     Boot    Start       End   Sectors  Size Id Type
/dev/sda1           2048  16771071  16769024    8G 82 Linux swap / Solaris
/dev/sda2  *    16771072 241168383 224397312  107G 83 Linux


Disk /dev/sdb: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0001cc68


Device     Boot  Start       End   Sectors   Size Id Type
/dev/sdb1         2048    206847    204800   100M  7 HPFS/NTFS/exFAT
/dev/sdb2  *    206848 234436607 234229760 111.7G  7 HPFS/NTFS/exFAT


Disk /dev/sde: 931.5 GiB, 1000204886016 bytes, 1953525168 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
Disklabel type: dos
Disk identifier: 0x879e7d5c


Device     Boot Start        End    Sectors   Size Id Type
/dev/sde1  *       64 1953520063 1953520000 931.5G  7 HPFS/NTFS/exFAT


Filesystem     1K-blocks      Used Available Use% Mounted on
devtmpfs         4021280         0   4021280   0% /dev
tmpfs            4027336     86080   3941256   3% /dev/shm
tmpfs            4027336      2116   4025220   1% /run
tmpfs            4027336         0   4027336   0% /sys/fs/cgroup
/dev/sda2      110302720  63853620  45422944  59% /
/dev/sde1      976759996 794382684 182377312  82% /run/media/SJL/2211FlagDrive
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           3.9G   85M  3.8G   3% /dev/shm
tmpfs           3.9G  2.1M  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda2       106G   61G   44G  59% /
/dev/sde1       932G  758G  174G  82% /run/media/SJL/2211FlagDrive



sda = OpenSUSE 13.2 drive
sdb = Windows 7 Pro drive, in extra HDD caddy in place of optical drive

and any external drive should be labeled sdc, currently the “FlagDrive”

dd/of ; sync was not successful.

I attempted shrinking and moving over the boot partition over, again, unsuccessful. I’ve decided to just do a fresh install for the time being. In the worst case scenario, I will just take the 128gb ssd out and stick into the other laptop.

Clonezilla, is unfortunately not the best option for me right now, as I don’t have an optical drive, and none of my flashdrive seems to be compatible to be set to a boot drive. I’m also finding that my main OpenSUSE has been wobbly and less stable lately.

Any flash drive should be bootable. Making it botable is a function of the software you use to write the iso image to the flash. Just download the latest clonezilla iso and use an app like [Rufus](http://Rufus - Create bootable USB drives the easy way) to write it to one of your flash drives. When you boot, tap f8 when your bios screen appears and select the flash drive as your boot option. For some motherboards, you may have to do something different to boot from USB but f8 will generally work. Post back if it doesn’t or if it’s not clear which boot option is the USB.

For the reason stated above, I think the safest thing to do is to use clonezilla to save the entire drive as an image and then “restore” that image to your new drive. That way you have a copy of the original image, which you want to have and keep anyway, and there is no risk of accidentally over-writing your original copy. You do need a drive location to store the image that you make of the original copy, but again, you probably want a saved image anyway. This is the alternative to doing a device-to-device procedure where you would have both the original drive and the new drive connected and make a direct copy. This works also but I think involves more risk and I have had a few more problems getting this to work.

This is using clonezilla from a boot device like a DVD or bootable flash, so you won’t have your OS mounted at the time you make your image. As suggested, this is really very easy, but I can write out a set of directions if you really think you need them.

If you want to be perfectly safe, physically disconnect any drives other than the drive you are making an image of and the drive you are storing the image on. After the image is created. Power down and physically disconnect the original drive you are copying. Finally, connect the new blank drive and restore the image to the drive. Note, you are making an image of a “device” and not a “partition”. This saves you from having to create partitions on the drive to receive the data.

If you really want to do a device to device copy, most drive manufacturers provide tools to do that kind of thing. I have used the Samsung software on a number of occasions to cloning a Samsung SSD. If you have such software that will run on the platform you are in, that would be another option, but there are advantages to learning to use clonezilla. I think that it is absolutely essential to have backup images of your OS and applications drive. This is the best insurance against malware and mal-user (meaning when I inadvertently do more damage to my own system by being stupid than any software ever did). It often takes me less than 5 minutes to restore from an image. Compare that to doing a complete re-install of your OS and all your applications, configurations, etc.

Post back if you want a set of instructions for what I suggest, but I am confident you can manage on your own with a little care.

LMHmedchem

Well moment of truth, I am currently cloning my 128gb ssd to a 240gb ssd. This is because I learned that I need more capacity. One slight question now is how would/can I increase the partition size, whence I have everything working properly?