Question: I want to create image from hard disk without free space (useless space) in linux(ex3 type).

I've been tried to create image with **dd** command but this command gave us total size of hard disk.

I need data on this hard disk without free space.

thanks a lot.

Answer: 
One option would be to create the file system image as a [**sparse file**](http://en.wikipedia.org/wiki/Sparse_file). You could first run an utility such as [zerofree](https://frippery.org/uml/) on your ext3 file system to make sure all free blocks are filled with zeros, and then just image the disk with `dd` and pipe the image through `cp` with the `--sparse=always` option to force it to create a sparse file:

```
dd if=/dev/whatever | cp --sparse=always /dev/stdin disk.image

```
+1 Partimage . The [system rescue CD](http://www.sysresccd.org) might help if you just want to save something. Plug in a removable drive and/or a network mount once it has booted and write the image to disk. 

If you're trying to image an entire drive for transport, don't forget to save the partition table (and the boot sector for a bootable)