I have a pre-fail drive, and while I'm waiting for replacement I am trying to do full back up to two smaller drives. Given that drive is 3TG and ones I have are 1.5 and 2TB, is this a correct way to do the backup?

dd if=/dev/sda of=/mnt/sda-1G-1270 bs=1G count=1270

then plug in 2nd drive, mount it, and do:

dd if=/dev/sda of=/mnt/sda-1G-rest bs=1G skip=1270

and to recover:

dd if=/mnt/sda-1G-1270 of=/dev/sda bs=1G count=1270
dd if=/mnt/sda-1G-rest of=/dev/sda bs=1G seek=1270

will that work?..

  • 1
    dd apparently gets upset if it meets bad blocks/sectors. Add the conv=noerror,sync options to make it convert bad areas into nulls. – garethTheRed Aug 6 '14 at 7:55
  • 1
    @garethTheRed: If there are already bad blocks, using ddrescue is probably a better idea. – celtschk Aug 6 '14 at 8:42
  • @celtschk - Absolutely or clonezilla. I was just answering the OP's query about dd. Personally, I'd rsync data off, directory at a time onto one disk until it's full, then onto the other. Although time consuming, I'd feel safer that I could access it all on the two disks in the interim. IT would also enable the opportunity to install a larger drive, change filesystems etc, if the urge/requirement was there. – garethTheRed Aug 6 '14 at 8:51
  • @garethTheRed: Using low-level copy has the advantage that you'll also copy data that's inaccessible on the file system level due to corrupted file system structures (not too unlikely if you have bad blocks). Of course, the perfect solution is to always have up-to-date backups, so you only have to copy/ddrescue the few files which changed since the last backup, and otherwise just restore the backup to a new drive. – celtschk Aug 6 '14 at 9:07

Your Answer

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

Browse other questions tagged or ask your own question.