VDMFEC(1)
π¦ VDMFEC(1) β Block ECC for files, bestie π¦
okay so this is the vdmfec(1) page from the General Commands Manual, and it's literally all about making your files survive corruption π
β¨. no cap, it's giving "save my diskette era" energy.
πΈ NAME πΈ
vdmfec β Block ECC for files π
β¨ SYNOPSIS β¨
vdmfec [-v] [-d] [-b blocksize] [-n N] [-k K] [file]
vdm_encode [-v] [-b blocksize] [-n N] [-k K] [file]
vdm_decode [-v] [-b blocksize] [-n N] [-k K] [file]
π DESCRIPTION π
okay bestie, here's the tea: vdmfec reads an input stream and adds error correction blocks so that large consecutive sections of the output stream may be corrupted, and the data recovered ππ«Ά. like, diskettes typically lose whole sectors at once, or related groups of sectors, or even entire tracks. data written to a diskette with this program may be recovered even with many read errors. iconic behavior, honestly.
the algorithm used is a Forward Error Correction (FEC) code based on Vandermonde (VDM) matrices in GF(2^8) due to Luigi Rizzo ππ. given the FEC parameters K and N, with N greater than K, N blocks are written for every K input blocks in such a way that any K blocks are sufficient to reconstruct the data. that is, up to N - K blocks out of every group of N blocks may be lost without loss of data. slay.
the amount of overhead in the output stream is easily adjustable by varying K. N and blocksize control the total amount of data written. depending on the types of errors you expect, different settings may be more or less useful π¦. for example, you may not expect to have two or three bad sectors on every track (if you do it's time to replace the diskette!), but you might expect three bad sectors on two or three contiguous tracks (diskette errors tend to cluster). periodt.
π OPTIONS π
-vβ Print informative messages about the encoding or decoding process tostderr, including the expansion factor π¬. Use-vvto get information about each block being read or written.-dβ Decode the input rather than encoding it. Using this option is equivalent to invoking the program asvdm_decodeπ.-b blocksizeβ Set the FEC block size to blocksize bytes. The blocksize may have a'k'or'K'appended, in which case the block size is set toblocksize * 1024bytes. This should usually be a multiple of the output media block or sector size (e.g.,512,1024,18K, etc.), and must be at least26bytes in version 1. Default1024π¦.-n N -k Kβ Set the FECNandKparameters.Nmust be greater than2and less than or equal to256.Kmust be greater than0and less thanN. DefaultN=18,K=14π’.
π¨ bestie listen: theN,K, andblocksizeparameters are NOT written to the output! you must specify the same parameters when you run the decoder. (Actually, the decoder is capable of explicitly detecting an invalidKvalue, but incorrectblocksizeorNvalues will result in bad blocks and decode failure.) π
the decoder is capable of reading from non-seekable media such as pipes, however, buffer underruns are not detected and will result in failure π. also, when reading from a pipe the entire file must be read. reading from a seek-able stream can be faster because only K good blocks out of N need to be read. highkey useful.
the encoder stores chunk and block ids which are used to detect out of order blocks, but those errors (which can sometimes happen due to filesystem corruption) are not corrected π. the only type of error that can be corrected is in place corruption of data. in particular, missing blocks (as from lost packets) result in decode failure, even when K good blocks are available. this program is primarily intended to recover data lost due to read errors on fixed media such as diskettes; several other programs and libraries are available that use FEC to handle the other (typically network packet) errors π«Ά.
π EXAMPLES π
consider a diskette with 80 tracks, 2 heads, and 18 512-byte sectors per track (a standard 1.44MB diskette). π
bzip2 < file | vdmfec > /dev/fd0
uses the default parameters of -b1k -n18 -k14, stores up to ~1.1MB of compressed input data, written one (double-sided) track (18K) at a time, and allows 4 bad clusters (8 sectors) per track. cute.
vdmfec -d /dev/fd0 | bunzip2 > file
recovers the original file π.
vdm_encode -b18k -n80 -k70 file.img > /dev/fd0
writes the entire diskette, stores up to ~1.23MB of data, and allows multiple errors on 10 different double-sided tracks β¨.
vdm_decode -b18k -n80 -k70 /dev/fd0 > file.img
recovers the data and reads no less than 70 tracks. note that vdm_decode exits with a non-zero status on failure, so that constructions such as
vdm_decode /dev/fd0 > moo && tar -xvf moo
are possible π.
dd if=/dev/tape ibs=1024 conv=noerror,sync | \
vdm_decode > file
this might be necessary to recover data from some non-seekable media. you can of course simply write the encoded output to a normal file, as in
tar -cf - dir | gzip | vdm_encode -v > dir.tgz.vdm
π REPORTING BUGS π
report bugs to Tom Holroyd <tomh@po.crl.go.jp> π«Ά.
π§ SEE ALSO π§
fec(3) π
okay that's the whole page bestie!! source/version: vdmfec, date: September 2001, manual: VDMFEC(1) β byeee π«Άβ¨π
π¦ where this page comes from
- nixos 26.05: vdmfec 1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms