LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > arniekat
User Name
Password

Notices


Rate this Entry

Slackware-13.1-Hacks-Wiping free space

Posted 01-02-2011 at 11:45 PM by arniekat

To eliminate the traces of old removed files, etc, you would want to wipe the empty space. The simple method is to use a standard Linux "dd" utility. In this example, suppose you want to wipe the free space on your hard drive for the /home partition. This will also work for any other partition, such as /tmp. You will only use ONE of the following commands depending on the type of data you want to use to fill up the empty space. The command is/are:

$ su
$ <Root_Password>

# dd if=/dev/zero of=/home/slackspace
This command will create a file called /home/slackspace and fill it with zeroes.

# dd if=/dev/urandom of=/home/slackspace
This command will create a file called /home/slackspace and fill it with good-quality random data from the kernel. If you are unsure about whether you should use /dev/random or /dev/urandom, then probably you want to use the latter. As a general rule, /dev/urandom should be used for everything except long-lived GPG/SSL/SSH keys.

# dd if=/dev/random of=/home/slackspace
This command will create a file called /home/slackspace and fill it with high-quality random data from the kernel. When read, the /dev/random device will only return random bytes within the estimated number of bits of noise in the entropy pool. /dev/random should be suitable for uses that need very high quality randomness such as one-time pad or key generation. When the entropy pool is empty, reads from /dev/random will block until additional environmental noise is gathered.

# sync

# rm /home/slackspace

This command removes the file /home/slackspace, thus freeing up the space, which has been zeroed.

# sync
Posted in Uncategorized
Views 1040 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 09:13 AM.

Main Menu
Advertisement
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