code: mafs

Download patch

ref: 892eb4b8d46fe804aa9560542e6dd3b5b45963c3
parent: b0b3ed10547c57a781c4e72b995cfbabe4cc476e
author: 9ferno <gophone2015@gmail.com>
date: Sun Nov 6 07:01:05 EST 2022

updated documentation with more commands

--- a/docs/mafs.ms
+++ b/docs/mafs.ms
@@ -1221,8 +1221,40 @@
 .sp
 	disk/find  disk.file blocknumber
 .sp
+.ne 5
+Build the list of free blocks.
 .sp
-.ne 6
+.nf
+	disk/used /dev/sdF1/fs > used.blocks
+	sort -n used.blocks -o used.blocks.sorted
+	disk/unused used.blocks.sorted 11721040049 # 11721040049 is the total number of disk blocks
+.fi
+.sp
+.ne 3
+Find the total number of blocks on a disk.
+.sp
+.nf
+	dd -if /dev/sdF1/fs -bs 512 -iseek 1 -count 1 -quiet 1 | awk '$1 == "nblocks" { print $2 }'
+.fi
+.sp
+.ne 5
+Change /adm/frees.
+.sp
+.nf
+	disk/unused <{disk/used tests/test.0/disk} 32 | tr -d '	' > unused.blocks
+	# cat unused.blocks
+	disk/updatefrees tests/test.0/disk unused.blocks
+.fi
+.sp
+.ne 5
+A test of disk/used, disk/unused and disk/free programs. $nblocks is the total number of disk blocks. $disk is the disk.
+.sp
+.nf
+	diff <{disk/unused -l <{disk/used $disk} $nblocks}} <{disk/free $disk}
+.fi
+.sp
+.sp
+.ne 20
 .ft B
 Tests
 .ft R
@@ -1314,6 +1346,7 @@
 .fi
 .sp
 .sp
+.ne 3
 .ft B
 Limitations
 .ft R
binary files a/docs/mafs.pdf b/docs/mafs.pdf differ