mnx_fresh, mnx_backup, mnx_restore - maintain MINIX O.S. on floppies

SYNOPSIS

mnx_fresh [host]
mnx_backup [drive]
mnx_restore [drive]

DESCRIPTION

These commands allow you to maintain a backup copy of the MINIX O.S. on floppies. You can use them to save your version of the O.S. on floppies and to load that version on a MINIX PC the next day to continue your work.

The drive argument (by default fd0), indicates which one of the floppy drives you want to use. Use fd0 to indicate drive /dev/fd0 (A:), and fd1 for drive /dev/fd1 (B:). In the examples drive 0 will be used.

To use these commands you need three formatted floppies. Label them clearly as 1, 2 and 3 as you will need to insert exactly the right diskette when asked to.

On day 1 you will use mnx_fresh to fill the hard disk of the PC with a fresh copy of MINIX. For this the system needs to be booted using the stable 2.0.0 kernel with full networking support (the '=' menu choice) as these files are obtained from a remote UNIX machine where they are safe. Become root and type

mnx_fresh

and watch /usr being checked and repaired. (You can run this command again later if the machine is in a somewhat bad state. The helpdesk people can revive a system that is completely sick.)

Mnx_fresh may be called with the name of a host as argument, for if the default host is down or unreachable.

You are now ready to do your assignments, although you may want to try mnx_backup first. Log in as bin now, bin can do almost anything you need to do and it has it's home directory (/usr/src) right above the kernel sources. A simple su command will make you root for those few special tasks that remain. (Being root is no fun when you don't need a password.)

After a day of work, use mnx_backup to save your O.S. on the three backup diskettes. When you want to continue the next day, you simply type mnx_restore to reload the O.S. on the hard disk. (You may want to run mnx_fresh first to put the machine in a known state, who knows what people have done to it.)

After saving you data, mnx_backup asks if it may delete all the files you have changed in the backed up directories, so that no-one can steal your work.

Backup diskettes

The three backup diskettes must be 1.44Mb diskettes formatted either from DOS or from MINIX with the command format(1). Use format /dev/fd0 1440 to format a 1.44Mb floppy in drive 0. Next you need to run mkfs /dev/fd0 on each diskette to put a MINIX file system on it. Now they are ready for use under MINIX.

Mounting and unmounting

To make mounting and umounting floppies easier, the command M fd0 mounts /dev/fd0 on /fd0, and U fd0 umounts it, the same goes for fd1. Never remove a floppy that is mounted! Re-insert it immediately if you find out.

Making a test kernel

Type make hdboot in the tools directory to compile and install a test kernel, reboot the machine and choose 't' on the boot menu to boot the experimental kernel. (The "stable" kernel is the /minix/2.0.0 file. The kernels you make are named /minix/2.0.0rN where N is a revision number. The MINIX bootstrap likes to load the newest kernel image present in /minix ('t') unless you specify otherwise ('='). Type set to the Boot Monitor for enlightenment.)

Rebooting the machine can be done by CTRL-ALT-DEL to quit MINIX, followed by CTRL-ALT-DEL once more to really reboot. It is faster to type exit at the monitor prompt though. The truly shrewd would use the MINIX command

shutdown -x test

Backed up files.

The following directory trees are backed up by mnx_backup:

Directory	Backup disk
/usr/src/kernel		1	Kernel Sources
/usr/src/fs		2	File System
/usr/src/tools		2	Kernel image and scripts
/usr/src/mm		3	Memory Manager
/usr/include		3	C-include files
/usr/src/extra		3	Miscellaneous Extra
/usr/src/.*		3	.profile etc.

Study this list carefully. Notice that the library sources (/usr/src/lib) are not backed up! They are simply too big. It is better to put files that you would normally put in the library in the /usr/src/extra directory, and directly link them in with the commands that need them.

The extra directory is initially empty, you can put any data in it you want and it will be backed up too. Nothing else in /usr/src is backed up, except for the files starting with a '.' (.profile, etc.).

The backup disks are normal MINIX file systems, and the files and directories on them are just like the files in /usr. Nothing stops you from mounting a backup disk and do whatever you want with the files.

Backup Security

Floppies happen to fail, a bit of dust or a bad drive and they are gone. So you really need a backup's backup. This can be done by using a second set of floppies and calling mnx_backup twice, or by using mnx_backup on the oldest of two sets of floppies. The latter is faster, a little less secure, and you need to be very careful to reload the proper set the next day.

Virtual Consoles

Try ALT-F1 / ALT-F2 or the synonyms ALT-leftarrow / ALT-rightarrow to switch between the primary console and virtual console 2. Note that debug output (printf's in kernel, mm, or fs) end up on the primary console. So run your tests on console 2, and switch to the primary console to see if there are any messages and then switch back, etc.

SEE ALSO

mkfs(1), tar(1), synctree(1), format(1).

DIAGNOSTICS

Mnx_fresh, mnx_backup, and mnx_restore are shell scripts. Any errors are reported by programs such as tar, mkdir, mount, and synctree. Synctree is very disaster tolerant, it will continue to the end. You can easily interrupt and restart it, that's no problem. Note that if you interrupt mnx_backup or mnx_restore then a floppy is likely to still be mounted, use df(1) to check.

BUGS

It would have been nice if ordinary files in /usr/src were also backed up.

If anything goes wrong, you will have to restart with diskette 1.

AUTHOR

Kees J. Bot (kjb@cs.vu.nl)


Markup created by unroff 1.0,    August 19, 1997.