Dos tool to zero empty spaces for fat
#1
Posted 17 June 2010 - 03:43 PM
Not entirely OT -- anyone knows a Dos tool that can zero out empty spaces for FAT? I have Norton Utilities, can Norton Utilities do that?
Not entirely OT because this is useful if the device on which this FAT file-system resides is a disk image -- I may zip up the image to reduce the size after the zero outs for my Grub4dos to load and boot from.
Thanks
#2
Posted 17 June 2010 - 04:01 PM
You can make a DOS batch file that simply loops until an error condition and copies a file together with itself until the copy fails because you've run out of room. Then you can delete that file. You can create the initial dummy file with echo.>dummy.txt.
EDIT: Actually, it might be better to "slow-fill" the file by continually appending to it. The method above would be much faster, but could run out of room just past the half-way point. A happy medium might be repeatedly doing type 512.bin>>filler.
#4
Posted 17 June 2010 - 10:16 PM
In case anyone else is interested, basically, as the empty free space is concerned, it's method is exactly as outlined by Sha0, just filling the free space with zeros, as opposed to anything else:
You can make a DOS batch file that simply loops until an error condition and copies a file together with itself until the copy fails because you've run out of room. Then you can delete that file. You can create the initial dummy file with echo.>dummy.txt.
EDIT: Actually, it might be better to "slow-fill" the file by continually appending to it. The method above would be much faster, but could run out of room just past the half-way point. A happy medium might be repeatedly doing type 512.bin>>filler.
Actually, all above can be done with a single command under Linux (no wonder I wasn't able to find such tools under Linux):
dd if=/dev/zero of=filler ...
The following is taken from the description from zerofree package, which zero free blocks from ext2/3 file-systems:
The usual way to achieve the same result (zeroing the unused
blocks) is to run "dd" do create a file full of zeroes that takes up
the entire free space on the drive, and then delete this file. This
has many disadvantages, which zerofree alleviates:
* it is slow;
* it makes the disk image (temporarily) grow to its maximal extent;
* it (temporarily) uses all free space on the disk, so other
concurrent write actions may fail.
I guess ordinary Windows user would have a hard time trying to under this because they don't have the concept of a sparse file.
From http://wiki.archlinu...php/Sparse_file
The advantage of sparse files is that storage is only allocated when actually needed: disk space is saved, and large files can be created even if there is insufficient free space on the file system.
Anyway, I think this brain-dead brute-force method works for me.
> What does OT mean? How would you abbreviate its opposite?
OT: Off-topic; And no, normally people don't abbreviate "on-topic".
thanks
#5
Posted 17 June 2010 - 10:52 PM
I would have pointed out DD for Windows[1] by John Newbigin and Chrysocome, but you said DOS, which is != Windows. This is the FreeDos and Dos area.Thanks TheK for pointing out sDelete.
I believe that recent versions of DD for Windows will accept the above command exactly. If not, you can install the Zero and Random Device Driver[2] by Olof Lagerkvist, then do dd if=\\.\zero of=0 and fill up your empty space.In case anyone else is interested, basically, as the empty free space is concerned, it's method is exactly as outlined by Sha0, just filling the free space with zeros, as opposed to anything else:
...
Actually, all above can be done with a single command under Linux (no wonder I wasn't able to find such tools under Linux):
dd if=/dev/zero of=filler ...
Always a good idea to defragment and make all files as contiguous as possible, before-hand. Also, you can use bs=XXX to [hopefully] increase the filling speed.
Using DD every single day (on UNIces and Windows, both) is where the cheap idea for a DOS environment came from. A repeating sequence of two characters 0x0D, 0x0A will surely compress pretty close to what you'd get for one character 0x00.
Windows's NTFS filesystem supports sparse files. Look for mksparse.exe, for example....I guess ordinary Windows user would have a hard time trying to under this because they don't have the concept of a sparse file...
[1] dd for windows
[2] Tools and utilities for Windows
#7
Posted 18 June 2010 - 02:14 AM
Ask and ye shall receive FILL.COM[1]. Note the speed difference between byte-at-a-time and 512-bytes-at-a-time. I hope this file is OT for this thread.thanks, Sha0. I did mean DOS.
[1] FILL.COM with source code
Also see direct download below, whose MD5 hash is D16BCD44BB88847B00219A9AE00BDAD4.
Attached Files
#8
Posted 18 June 2010 - 07:15 AM
For example, you could use something like bfi.exe ( http://nu2.nu/ ) to create a boot disk with the required files. The balance of the fat and the diskette will be entirely empty, which makes the appropriate zip entirely empty.
I wrote a rexx script for appending a tail to a boot sector (based on the boot sector), for making a perfectly empty diskette, complete with empty fat and data blocks.
#9
Posted 18 June 2010 - 08:21 PM
For example, you could use something like bfi.exe ( http://nu2.nu/ ) to create a boot disk with the required files.
Any direct link please?
I've checked
- hompe page
- UTILITIES
- BOOT DISK
but didn't find that bfi.exe
thanks
#10
Posted 18 June 2010 - 08:29 PM
Any direct link please?
I've checked
- hompe page
- UTILITIES
- BOOT DISK
but didn't find that bfi.exe
thanks
http://www.nu2.nu/bfi/
#11
Posted 17 December 2010 - 08:23 AM
http://reimagery.com...l2.htm#filewipe
#12
Posted 21 December 2010 - 11:50 PM
ZAPEMPTY from WIPEUTIL package is the tool that I used to zero-filling free spaces of disk images. . .
Exactly what I was looking for! Thanks!
#13
Posted 01 April 2011 - 10:14 PM
#14
Posted 01 April 2011 - 11:33 PM
I am afraid very few people will be able to run Winimage from DOS or FreeDos....WinImage - Image - Defragment seems to do something similar because when I zip an image after running Defragment it makes a much smaller file.
Wonko
#15
Posted 28 April 2011 - 02:56 PM
I am afraid very few people will be able to run Winimage from DOS or FreeDos
But still good to know.
Thanks Steve.
#16
Posted 02 March 2012 - 07:41 PM
ZAPEMPTY from WIPEUTIL package is the tool that I used to zero-filling free spaces of disk images. (for super-floppy images, I have to use grub4dos map it to (fd0) and load freedos and run speedisk to defrag it and then zapempty it)
I mount my15.6MB image using IMDISK in windows, winrar it's contents to a file, delete ALL the files on the image, run Microsoft's sdelete -z [image drive], then restore the contents from the rar backup file. Run another sdelete -z [image drive] for good measure. These steps defrag the image and ensures empty space is zeroed out.
After that I unmount my image, compress my image source file into a SFX EXE (RAR) file, then run UPX over the SFX to get the smallest possible SFX file for distribution. Works great but you can see that I'm doing all of these operations from within Windows rather than the FreeDOS boot image.
#17
Posted 02 March 2012 - 08:03 PM
http://www.cezeo.com...f=disk-redactor
It can run from the command line or GUI and is free.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users