# Backup Entire Harddrive to an Image

Backup content of the harddrive to a file. Creates an image of the drive


dd if=/dev/sda of=/tmp/sda.iso

Author: Binny V A
A philosopher programmer who specializes in backend development and stoicism.

## 4 thoughts on “Backup Entire Harddrive to an Image”

1. Use partimage. It backups only used spaces. But dd extracts used space as well as unused space.

2. tctc says:

Change the file name in your example to something generic like *.img not *.iso since dd does not create iso9660 file structures!

3. About having *.iso in the example… It’s important to remember that changing the file extension doesn’t do anything magical (unless you are saving an image in GIMP XD). The file extension is simply part of the file name; nothing more; nothing less. You don’t actually NEED file extentions. However, there are conventions. When you add the *.iso file extention, you are proclaiming to everyone that that file is an image file containing the ISO 9660 filesystem or a filesystem compatible with the ISO 9660 filesystem (such as UDF) or a combination. You could name the file *.spaghettimonster, and it won’t magically convert it to anything. Likewise, naming an image of a FAT32 partition to *.iso won’t make it have such a filesystem. But if you are imaging a CD that would image to something worthy of the *.iso extention, it’s ok to do that. That’s almost all optical media except for audio CDs. Just know that dd pads zeros onto the end of the image, so your hashes won’t match with the rest of the world. Psst – check out ddpt.