de - A Minix Disk Editor Terrence W. Holm, Jan. 1989 INTRODUCTION The de(1) disk editor allows a system administrator to look at and modify a Minix file system device. Commands allow movement throughout a file system device, displaying information in a couple of formats, writing blocks from the device onto another file, and rewriting words on the disk. A few changes to the Minix file system aid recovering files. I-node numbers are retained in directory entries now (they get moved to the end). And all the i-node information is not zeroed-out when a file is unlinked. So, after a file is accidently rm(1)'ed, you can find the old i-node, and then manually (or automatically) go to each of the freed blocks and write them to a new file. USES FOR THE DISK EDITOR 1) EDUCATION. Students can look at a file system in a painless manner. For example you don't have to use od(1) to look at the zone numbers in i-nodes. A simple assignment is to change the size of an un-mounted floppy disk file system from 360 to 300 blocks. (A more difficult assignment is to explain why this works, even though fsck(1) and df(1) do not report the correct number of free blocks. :-) 2) ADMINISTRATION. You can visually check inconsistencies reported by fsck(1) before letting fsck(1) fix them. You can change any word on the disk, this greatly simplifies editing file system information. For example, changing the size of a block special device is actually fun, no more "blind" writing to your partitions. Bit maps can be displayed with 2048 "bits" per screen, (on the IBM/PC console), see how your zones are allocated! INSTALLATION - Install de.1 in /usr/man/cat1. - Install the files: Makefile, README, de.h, de.c, de_stdin.c, de_stdout.c, de_diskio.c and de_recover.c in commands/de. Add -F and -T. to the Makefile, if necessary. - "make" de(1). If a header file is not found, don't worry: You probably have it somewhere, just link it to what de(1) is looking for. This program also requires the subroutine tolower(3), see EFTH MINIX report #50, if you don't have it. USING DE(1) FOR THE FIRST TIME De(1) starts up in "word" mode at block 0 of the specified device. Hit the PGDN (or space bar) a few times, observing all the information on the screen. Each PGUP/PGDN moves to the next 1024 byte block, (de(1) only knows about 1 block per zone file systems). Note that "word" mode only displays 32 bytes at a time, so you are only observing the first 32 bytes in the first few blocks when you skip using PGDN. Now go back to block 3, (zone bit map), using "g 3 ENTER". Change to "map" mode "v m", and then use the down arrow key to check each 2 Megs in the zone bit map. Now change to "block" mode using "v b". And go to some data block, eg. "g 1000 ENTER". Use PGUP/PGDN to see what data is in each nearby block. Remember 'h' gives you a help page. Try some more commands, for example: 'END', 'I', '/'. (Note: searching through a whole disk under Minix takes a long time: 30-60 seconds per megabyte, depending on your machine, drive and controller, [Minix is embarrassingly slow].) Don't worry about looking at a mounted device, you must specify the "-w" option before the 's' command is operational, and this command is the only one which will try to modify the contents of the device. MINIX-ST Please contact me if you are interesting in attempting a port to MINIX-ST. MINIX-vmd After repairing too many type errors this program runs under Minix-vmd, but file recovery is forcefully removed, because a on a real system deleted blocks are reused before you know it. (Proper support for undelete is to be added, alas I don't care enough to do it soon myself.) By the way, the search times above should read: "1-2 seconds per megabyte" nowadays. Kees J. Bot (kjb@cs.vu.nl) $PchId: README,v 1.3 1995/11/27 22:17:36 philip Exp $