LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-23-2004, 05:24 PM   #1
RyanBarnard
LQ Newbie
 
Registered: Sep 2004
Location: Bellingham, WA
Distribution: Gentoo
Posts: 2

Rep: Reputation: 0
Zeroing free space?


I've been working on creating an install of Gentoo Linux that will be imaged to multiple machines on the network. I have a machine here that had multiple hard drive bays, so all that needs to be done is something like:

dd if=/dev/hda bs=256k | tee /dev/hdb /dev/hdc /dev/hdd ... > /dev/null

Once the image is completed and mirrored to all the hard drives, I would like to backup the image for storage by doing something like:

dd if=/dev/hda1 bs=256k | tar -c linux_image_hda1.tar
dd if=/dev/hda2 bs=256k | tar -c linux_image_hda2.tar

But I worry that all free disk space on the disk is filled with random characters instead of zeros...due to me not doing a "dd if=/dev/zero of=/dev/hda" at the start of the project.


So, the question: is there a utiltity that will put zeros into the disk (or partition) where free space exists? Or....does ext2 and ext3 do that automatically when files are removed from the disk and I have nothing to worry about?

I know that zeroing the freespace isn't entirely necessary, but since I'm tarring the partition, a bunch of zeros will compress a lot nicer than a bunch of random characters.

Thanks,
Ryan Barnard
 
Old 09-23-2004, 05:51 PM   #2
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
Not sure it's needed, but why not use dd to do the zeroing as well?
 
Old 09-23-2004, 06:05 PM   #3
RyanBarnard
LQ Newbie
 
Registered: Sep 2004
Location: Bellingham, WA
Distribution: Gentoo
Posts: 2

Original Poster
Rep: Reputation: 0
I can't do that because I don't know what part of the hard drive to dd with /dev/zero. If I could get a list of unused sectors or blocks or whatever, then I could dd just those parts of the drive....but how would I get that information?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Zeroing out ununsed space in a ext3 partition saravkrish Linux - General 2 11-19-2004 03:10 PM
Not enough free space on hard drive with 50g of free space??? auoq SUSE / openSUSE 5 10-13-2004 08:21 PM
Not enough space for root directory on a drive with 50g free space??? auoq Linux - Newbie 1 10-13-2004 12:44 PM
"no space left on device" - But df shows free space! monita Linux - General 7 03-30-2004 01:14 PM
Formating free space: WinXP pro and RH9 dualboot with free space on 3rd drive Vermicious Linux - General 2 03-22-2004 05:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration