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
$ 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
Total Comments 0