ref: fb53d7e68bcb2108fb304c81dccb1d7ff50ffa1f
dir: /man/mafs.8/
.TH MAFS 8 .SH NAME block, find, free, reconcile, unused, updatefrees, used - file server maintenance .SH SYNOPSIS .PD 0 .PP .B halt .PP .B sync .PP .B users .PD .PP .B disk/block .I drive .I block_number .PP .B disk/find .I drive .I block_number .PP .B disk/free .I drive .PP .B disk/reconcile .I -u used_blocks_list_file .I -F free_blocks_list_file .I nblocks .PP .B disk/unused .I used_blocks .I nblocks .PP .B disk/used .I drive .PP .B disk/updatefrees .I drive .I free_blocks_list_file .I nblocks .SH DESCRIPTION Reading /adm/ctl prints the number of free, used and total blocks/megabytes. The following commands should be written to /adm/ctl of a .IR mafs (4) file server. .PP .I Halt stops the mafs service after pending writes to the disk are completed. .PP .I Sync blocks until all the pending writes to the disk are completed. .PD .PP .I disk/block Interpret the contents of a block based on the tag and write out a single formatted block based on the tag. .PP .I disk/find traverses the directory heirarchy and identifies the file that a block number belongs to. .PP .I disk/find traverses the directory heirarchy and identifies the file that a block number belongs to. .PP .I disk/free shows the list of free blocks from the contents of /adm/frees. .PP .I disk/reconcile reads two lists of block numbers and flags the common and missing blocks. .PP .I disk/unused builds the list of free blocks. This should match the contents of /adm/frees. .PP .I disk/used traverses the directory heirarchy and writes out all the used block numbers. .PP .I disk/updatefrees changes the contents of /adm/frees. .SH EXAMPLES Check disk usage (traditional df) of a mafs mounted at /n/mafs_myservice. .IP .EX cat /n/myservice/adm/ctl .EE .PP Show the contents of block 22 in disk, tests/test.0/disk. .IP .EX disk/block tests/test.0/disk 22 .EE .PP Find the file using block 17 in disk, tests/test.0/disk. .IP .EX disk/find tests/test.0/disk 17 .EE .PP From the contents of /adm/frees show the list of free blocks. disk/reconcile uses the output of this to reconcile the list of used blocks with the list of free blocks. .IP .EX disk/free tests/test.0/disk .EE .PP Read two lists of block numbers and flag the common and missing blocks. .IP .EX disk/reconcile -u <{disk/used tests/test.0/disk} \\ -F <{disk/free tests/test.0/disk} 32 .EE .PP Build the list of free blocks. This should match the contents of /adm/frees. .IP .EX disk/unused <{disk/used test.0/disk} 32 .EE .PP Traverse the directory heirarchy and write out all the used block numbers. .IP .EX disk/used tests/test.0/disk .EE .PP Change the contents of /adm/frees. .IP .EX disk/updatefrees tests/test.0/disk \\ <{disk/unused <{disk/used tests/test.0/disk} 32} .EE .PP A sanity check that the file system is not corrupt by comparing that the unused blocks and free blocks match up. $nblocks is the total number of disk blocks. $disk is the disk. .IP .EX diff <{disk/unused -l <{disk/used tests/test.0/disk} 32}} \\ <{disk/free tests/test.0/disk} .EE .SH SOURCE .B /sys/src/cmd/mafs .SH SEE ALSO .IR mafs (4) .br M[a]fs - Plan 9 userspace file system .SH SOURCE .B /sys/src/cmd/mafs