(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
https://forum.puppylinux.com
and continue your work there. Thank you.

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 17 Jan 2021, 20:39
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to wipe unused areas of hard drive?
Moderators: Flash, Ian, JohnMurga
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
PaulBx1

Joined: 16 Jun 2006
Posts: 2307
Location: Wyoming, USA

PostPosted: Sun 18 Feb 2007, 01:26    Post subject:  How to wipe unused areas of hard drive?  

In another thread there was a link to a security page, where the author mentions a program to wipe unused areas of the hard drive. He mentions this program:

http://packages.debian.org/unstable/utils/wipe.html

Is there anything like that available for puppy, easily installed? I'd take a try at compiling wipe but there appear to be several dependencies which I don't know how to deal with (I'm at the thumb-sucking stage when it comes to compilation).
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 13653
Location: Arizona USA

PostPosted: Sun 18 Feb 2007, 01:36    Post subject:  

I'm pretty sure there have been several posts in the forum describing how to do what you want. I think the dd command can do it but I'm not sure.
Back to top
View user's profile Send private message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Sun 18 Feb 2007, 01:58    Post subject:  

for example:

echo Erasing free space on /mnt/hda9
dd if=/dev/zero of=/mnt/hda9/foo4976.bin bs=4048 count=600K 2>> /tmp/erase2.log
sync
sync
rm -f /mnt/hda9/foo4976.bin

or:

echo Erasing free space on /mnt/hda14
dd if=/dev/urandom of=/mnt/hda14/foo4976.bin bs=4048 count=600K 2>> /tmp/erase2.log
sync
sync
rm -f /mnt/hda14/foo4976.bin
Back to top
View user's profile Send private message 
PaulBx1

Joined: 16 Jun 2006
Posts: 2307
Location: Wyoming, USA

PostPosted: Sun 18 Feb 2007, 14:28    Post subject:  

G2, that is wiping *before* it is free space. I want to wipe files that have already been deleted. But not the whole partition.

Flash, I did a search but not much luck. I'm kinda surprised there is no dotpup out there for it.
Back to top
View user's profile Send private message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Sun 18 Feb 2007, 15:26    Post subject:  

no, it is wiping most of the free space in a partition (file system really, you can do the same thing to the pup_save file, useful if you want to compress it, for example, as a backup)

what is happening is that you are creating a large file, larger than the free space in the partition ... when dd has used every byte of free space, it stops with an error ... at that point, you just delete the file ... all the free space you had is back again, it's just filled with zeros, or random numbers

this is the same method Eraser ... http://www.heidi.ie/eraser/ ... uses, or did use ... i remember that Windows would pop up an error message warning that the drive was running out of space

you can erase a partition or a drive using dd ... but that is not what those commands do

a more complex program like wipe can erase a bit more space than a simple dd command can ... for example, files usually do not completely fill the last block of space in the file system, and there is free space in the tables that contain the file names

but a journaled file system will have space that a program can't easily access, so if you want to be absolutely sure that the entire file system is wiped, you really need to erase the entire partition

and hard drives automatically remap damaged sectors to backup sectors, so there might be sectors that have damage that are no longer accessible to your wiping program, that might have information on it that you might like erased

for most people, the simple methods are probably adequate
Back to top
View user's profile Send private message 
PaulBx1

Joined: 16 Jun 2006
Posts: 2307
Location: Wyoming, USA

PostPosted: Mon 19 Feb 2007, 12:51    Post subject:  

Thanks G2, I didn't realize what was going on there. Looks perfect for my needs. The file system is vfat so I don't have to worry about journaling, and I don't care about filenames.

It might be slow to use urandom directly. Probably faster to create a 4096-byte file from urandom, then copy that file using dd, over and over? I will play with it...
Back to top
View user's profile Send private message 
PaulBx1

Joined: 16 Jun 2006
Posts: 2307
Location: Wyoming, USA

PostPosted: Sun 25 Feb 2007, 13:41    Post subject:  

Here is a little program I put together to fill initrd/mnt/dev_save (can be changed) with 1GB random data files, then delete them and refill, etc 10 times.

It is not interactive; you have to edit it to change anything (easy, with variables up front). It's a "fire and forget" program, just start it out in the evening before going to bed. On my old Thinkpad it can do one fill of 10GB in 15 minutes.

You need to INVOKE IT FROM THE COMMAND LINE.

It can't clean journals on journaling file systems. Oh, and it can't do swap either.

Someone might want to take it and play with it, add features, etc. I understand there are already a bunch of such programs out there. I really just did it for myself, so if anyone else wants to play with it, have at it.
wipe.tar.gz
Description  Updated script to wipe volume free space.
gz

 Download 
Filename  wipe.tar.gz 
Filesize  1.83 KB 
Downloaded  730 Time(s) 
Back to top
View user's profile Send private message 
PaulBx1

Joined: 16 Jun 2006
Posts: 2307
Location: Wyoming, USA

PostPosted: Sun 26 Apr 2009, 15:49    Post subject:  

I have updated the above script as follows:

1) Mount point for tmpram is now under /mnt, more standard for Puppy; you can delete /tmpram mount point if you used the earlier version.

2) Added usage line.

3) Script is now invoked passing a parameter specifying what mounted volume you want wiped; saves editing the script for different volumes.

4) A -z parameter is available that will wipe using zeros on the last iteration. This helps backup if the backup procedure compresses the data in the process; all zeros compress better. Not recommended for encrypted volumes as these are more secure if random data fills the free space.

5) Uses only 5 iterations by default; this should be plenty.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0589s ][ Queries: 13 (0.0102s) ][ GZIP on ]