Copy Disk with dd using an Emergency BootISO

Introduction

You need to make a backup of an active disk to a image file, the following describes howto do this.

Problem Description

Maybe you have an SSD where S.M.A.R.T. is telling you that badblocks are starting to show up. So you need to replace the SSD with a new one. You need to create an image of the actual disk (If te badblocks are not too high you can try it).

Solution

Take a backup to an Image on the running system:

dd if=/dev/sda conv=sync,noerror bs=128k status=progress | gzip -c > YYYYMMDD-boot-disk.gz

Restore the Image File. Double Check that you use the right Device Name (/dev/sda, /dev/da0 etc.)

gunzip -c YYYYMMDD-boot-disk.gz | dd of=/dev/sda

Boot the System with the new SSD.


Revision #3
Created 7 August 2024 07:18:47 by Peter Baumann
Updated 7 August 2024 07:37:40 by Peter Baumann