PDA

View Full Version : Write zeros to empty space.



firebyrd10
09-19-2004, 10:33 PM
Is there some way to write all 0's to the empty space on my ext3 partition. Tis isn't for security but rahter for compression. When I made an image of the parttion it was 3.2 gigs compressed. But only 1.4 gigs are acually used. The rest is ghost data from files long gone that the OS can ignore but not the compression. Which means if I were able to write zeros on all the free space, the compressed size would decrease dramaticly.

garyng
09-20-2004, 05:26 AM
1. go to a mount point under the fs
2. dd if=/dev/null of=rubbish
3. rm rubbish

firebyrd10
09-21-2004, 01:23 AM
Worked like a charm. Got the image size down to 640 megs.

Thanks