alterddumbfs [options] <parent-directory>
alterddumbfs create anomalies in an offline ddumbfs filesystem, for testing only.
The parent-directory is the directory containing the ddfs.cfg file and ddfsroot directory.
show this help message and exit
be more verbose and display progress
lock index into memory (increase speed)
create funny file
initialize random seed
alter index
swap non empty consecutive nodes in the index
swap non empty random nodes in the index
reset to zero non empty nodes in the index
duplicate non empty nodes in empty random place
duplicate non empty nodes just after itself
exchange addresses of two non empty nodes in the index
write one random byte anywhere in the index
simulate a crash or a powercut
For example, to test if fsckddumbfs will detect and correct addresses the swap of some addresses inside the index:
# umount /l0/ddumbfs/
# alterddumbfs -a 2 /l0/ddumbfs/
# fsckddumbfs -C /l0/ddumbfs
use asynchronous io
root directory: /l0/ddumbfs/ddfsroot
blockfile: /l0/ddumbfs/ddfsblocks
indexfile: /l0/ddumbfs/ddfsidx
== Check index
== Checked 983 nodes in 0.0s
== Check block hash
== Checked 12 blocks in 0.0s
== Check unmatching 2 block
== Checked 2 unmatching blocks in 0.0s
== Read files
== Read 1 files in 0.0s
== Summary
Used blocks : 12
Free blocks : 148
Index errors : 0 OK
Index blocks : 12
Index blocks dup : 0 OK
Block errors : 2 ERR
Files : 1
Files errors : 2 ERR
Files blocks : 12
Files lost blocks : 0 OK
Tested hashes : 0
Wrong hashes : 0 OK
Diff index vs files : 0 OK
Diff blocks vs files : 0 OK
Filesystem status : ERROR
# fsckddumbfs -n /l0/ddumbfs
use asynchronous io
root directory: /l0/ddumbfs/ddfsroot
blockfile: /l0/ddumbfs/ddfsblocks
indexfile: /l0/ddumbfs/ddfsidx
02:40:45 INF Repair node order, fixed 0 errors.
02:40:45 INF Update index from files.
02:40:45 INF calculate hash for block addr=2
02:40:45 INF calculate hash for block addr=5
02:40:45 INF Read 1 files in 0.0s.
02:40:45 INF 12 blocks used in files.
02:40:45 INF 2 blocks have been added to index.
02:40:45 INF ddfs_load_usedblocks
02:40:45 INF 12 blocks used in nodes.
02:40:45 INF 2 suspect blocks in nodes.
02:40:45 INF Resolve Index conflicts.
02:40:45 INF 2 nodes fixed.
02:40:45 INF Fix files.
02:40:45 INF Fixed:0 Corrupted:0 Total:1 files in 0.0s.
02:40:45 INF Deleted 0 useless nodes.
02:40:45 INF blocks in use: 12 blocks free: 148.
# fsckddumbfs -C /l0/ddumbfs
use asynchronous io
root directory: /l0/ddumbfs/ddfsroot
blockfile: /l0/ddumbfs/ddfsblocks
indexfile: /l0/ddumbfs/ddfsidx
== Check index
== Checked 983 nodes in 0.0s
== Check block hash
== Checked 12 blocks in 0.0s
== Check unmatching 0 block
== Checked 0 unmatching blocks in 0.0s
== Read files
== Read 1 files in 0.0s
== Check 'unexpected shutdown' blocks: 0.
== Summary
Used blocks : 12
Free blocks : 148
Index errors : 0 OK
Index blocks : 12
Index blocks dup : 0 OK
Block errors : 0 OK
Files : 1
Files errors : 0 OK
Files blocks : 12
Files lost blocks : 0 OK
Tested hashes : 0
Wrong hashes : 0 OK
Diff index vs files : 0 OK
ddumbfs(1), fsckddumbfs(8)
Alain Spineux <alain.spineux@gmail.com>