code: mafs

Download patch

ref: 9b76881a8e11c44aae5dfd447e1cd1bc074ec9f3
parent: 29909fc9ff080101591c8de6dfa732fc65bb323d
author: 9ferno <gophone2015@gmail.com>
date: Sat Dec 3 13:08:50 EST 2022

added fsck so users do not have to remember the details

--- /dev/null
+++ b/fsck
@@ -1,0 +1,17 @@
+#!/bin/rc
+
+# usage
+#	disk/fsck /dev/sdFn/fs
+
+disk=$1
+if(~ $#disk '')
+	exit invalid disk
+
+# get the total number of blocks from the config block
+nblocks=`{disk/block $disk 2 | awk '$1 == "nblocks"{ print $2 }'}
+
+# write the free extents to /adm/frees
+disk/updatefrees $disk <{disk/unused $nblocks <{disk/used $disk}
+
+# change fsok from 0 to 1
+disk/fsok $disk