I want to backup an existing SSD on a new notebook with a pre-installed Windows, Recovery Partition, ... before I wipe it and install Ubuntu on it. (It is too small for a dual-boot)

Until now I have been using dd for that kind of situation. But now I have read on various sites that dd isn't a good choice for SSDs. These are the things I came across:

  1. dd also fills empty areas with 0s reducing spare area. This makes sense to me
  2. dd may mess with alignment. I tried reading up on alignment but I still didn't get it entirely. If I do a bitwise copy of a SSD and later put it back on the same drive shouldn't this make them totally identical including any alignment?
  3. dd puts unnecessary wear on a SSD. I understand that it would be better to only write areas with actual data, but is this really such an issue on a modern SSD?

My questions now are:

  • Do the things stated above make sense? (This is just for personal interest, my main questions follow)
  • Is dd therefore a safe choice for backup/restore of a whole SSD drive?
  • If not, is Clonezilla better suited?
  • Otherwise: What is the best way to go?
  • dd also fills empty areas with 0s reducing spare area

true, it is far from space efficient.

  • dd may mess with alignment

Memory chips do not have cylinders and heads, but they do have pages. Some chips were/are quicker reading within the same page as switching to a different page. However these timings differences are very low and if you copy to the same ssd it will not differ because it are the same chips.

  • I understand that it would be better to only write areas with actual data, but is this really such an issue on a modern SSD?

No. Maybe the other way round, if you place backups on your SSD but reading the chips is not causing any wear and writes are at least close to a million on current SSD's. I hope you don't plan on restoring that often. :)

So I would call dd safe if you know how to use it and would not care too much about wear and alignment. Space considerations you can consider yourself. Dd is easy but at a cost of space and time while doing the backup. Clonezilla is a smarter way but an additional program which you also need to install before restoring.

Just a matter of preference I guess...

  • Thanks for the answer. One more question about spare area. I don't care about the size of the backup. What I read (if I got this right) is that if on restore all empty space is filled with 0s on a SSD this differs from areas that have never been written to and those "virgin" sectors are important for "Read-Modify-Write, Wear Leveling and Bad Block Replacement". I got this from wiki.ubuntuusers (Sorry, german) – kraftner Feb 26 '14 at 17:42
  • What the site claims, and this has some trued in it, is that when wear begins the bad block space will be quicker filled. If you write all disk once, all faults will be noticed and be placed in the badblock region. When more blocks start to give in the disk might get a shortage of this space sooner then when you only use 30% of the disk and 70% of the bad blocks have not been identified in the first case. My SSD it pretty much filled, so for me it won't make much difference. Also checked a datasheet and with 20GB writes a day the SSD last for at least 5 years, taht is with full use. – Requist Feb 26 '14 at 18:12
  • Thanks for your quick reply. So to summarize: If backup&restore will be on the same SSD, I don't care about backup size and backup time and my SSD will be mostly filled anyway I can forget my worries, do a dd backup and be happy. – kraftner Feb 26 '14 at 18:19
  • yes, based on reading, arguments, datasheets and current state of technique, that would be my conclusion. Of course it is difficult to say something for all drives, if you have an ancient one it might be a bit different but with the ones you buy today it should not be a problem. – Requist Feb 26 '14 at 18:30

dd fills the disk with whatever junk was there in the original, not necessarily zeros. While this does put unnecessary wear on the ssd, doing it once won't make much of a dent in the overall life of the drive, but you will want to be sure to trim it afterwards to restore its performance. It also takes a lot more time to backup/restore, and requires more disk space to store the backup image. You also have to boot from alternate media to make the backup, and can not do periodic incremental backups.

Alignment issues only come into play if you back up an old drive that already had bad alignment and restore it to a new drive that really requires proper alignment for good performance.

Conventional backup tools like tar or just making a plain copy with rsync don't have these problems. Restoring just becomes slightly more complex since you have to format the filesystem, restore the files, then reinstall grub, but that's really not hard.

See http://wiki.ubuntu.com/BackupYourSystem for more information.

  • Okay, another new term learned (Trim). If I understand this correctly doing a trim after a restore with dd scans the drive, checks for empty areas and reports those to the SSD firmware to be empty and ready to be used because the SSD itself can't differentiate on its own if empty space in a filesystem is actually empty or just filled with e.g. 0s intentionally. Is this correct? – kraftner Feb 26 '14 at 18:36
  • @kraftner, that's it in a nutshell. – psusi Feb 26 '14 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.