7

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.

Matt Simmons
  • 20,584
M.Rezaei
  • 425

5 Answers5

6

One option would be to create the file system image as a sparse file. You could first run an utility such as zerofree 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
jackem
  • 216
5

Sounds like Partimage might be what you are looking for?

andol
  • 7,074
1

If you're using LVM, clonezilla is the way to go.

0

+1 Partimage . The system rescue CD 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)

0

I use partimage for get image also this program worke with command.

If you get image by bash script you work with this and dumpe2fs or xfsdump commands.

M.Rezaei
  • 425