.pn 24 .if \nh=0 .so macros .LP .de Op .ti -0.15i \\&\\fB\\$1\\fR \\$2 .br .. .CP 3 "\*(M0 ON THE ATARI ST" .PP In this chapter we will describe how to boot and install \*(Mx on the Atari ST. It is assumed that the reader is already familiar with \*(Mx in general, and has at least some knowledge of .Ux . .PP Booting and installing \*(Mx on the Atari ST is complicated by a variety of factors: .HS .Bu Atari STs are sold with a wide variety of incompatible keyboards .Bu Some versions can only handle 360K diskettes; others can handle 360K and 720K diskettes .Bu Some people have winchester disks (hard disks); others do not .Bu The amount of memory available ranges from 512K to 4M .Bu The Mega ST differs in some ways from the Atari ST 520 and 1040 .HS .PP Together, these different configurations give problems. Our solution has been to provide a base version that will require at least 1MB of memory and one 720K disk drive, and make it possible for people with larger configurations to adapt the system to take advantage of their extra hardware. This chapter explains how that is done. .PP It is possible to run .MX on a system with 512K of memory, but that leaves very little space for applications. In this case the best thing to do is to work without a ram disk at all, and keep the root filesystem on either hard disk or diskette. Running .MX on a system with only a 360K disk drive is also possible. However in that case you must first split each 720K diskettes in the distribution into two 360K ones. Since you do not have a disk drive capable of dealing with 720K diskettes, you should do this on a friends system. Sec. 3.6 describes how to split a 720K diskette into two 360K ones. .SP 1 .SE "THE MINIX-ST DISTRIBUTION" .SP 1 .PP The \*(Ms distribution consists of ten diskettes. One of them contains a binary of the operating system and is used for booting \*(Ms. Eight others contain \*(Mx file systems. Only one of them contains a \s-2TOS\s0 file system. (We use \s-2TOS\s0 as the name for any combination of BIOS, XBIOS, GEMDOS, GEM, AES and VDI). .PP All distribution diskettes are double-side, and formatted on both sides. However, two diskettes contain only 360K of information written on one side of the diskette. In other words, these two diskettes are written as if they were single sided diskettes. Here is the list of the diskettes: .sp 1 .SP 0.5 .TS center,box; c c c c c l l l l l. \fBName Sides Size File sys. Description\fR _ 00.TOS \0DS 720K TOS utilities that run as \s-2TOS\s0 programs 01.BOOT \0DS 360K special used for booting \*(Mx 02.ROOT \0DS 360K \*(Mx root file system copied to RAM disk 03.USR1 \0DS 720K \*(Mx most commonly used commands 04.USR2 \0DS 720K \*(Mx commands part 2 of 3 05.USR3 \0DS 720K \*(Mx commands part 3 of 3 06.ACK \0DS 720K \*(Mx compiler binaries and libraries 07.SRC1 \0DS 720K \*(Mx sources of the \*(Mx operating system 08.SRC2 \0DS 720K \*(Mx sources of commands part 1 of 2 09.SRC3 \0DS 720K \*(Mx sources of commands part 2 of 2 .TE .SP 0.5 .sp We will refer to these diskettes in the rest of this manual by their name in the first column of this table, for example, 01.BOOT. .PP Before you start working with these diskettes we urge you to copy all of them. You can use normal \s-2TOS\s0 procedures, like dragging icon FLOPPY DISK A onto icon FLOPPY DISK B, to make the copies. Whenever we refer to diskettes as 01.BOOT, 02.ROOT, 03.USR1 etc. we always mean a write-enabled copy of the original diskettes. Store the original diskettes after copying and keep them write protected under all circumstances. Do not use your originals as work diskettes. .SE "NATIONAL KEYBOARDS" .PP The Atari ST comes with different keyboards in different countries. This lack of standardization is a major nuisance. Atari solved the problem by providing a different version of their operating system for each country. We have chosen a different strategy: a single version that can be adapted to the various keyboards. This section describes how to set up \*(Mx for your keyboard. .PP Unless you have an Atari ST with a United States version of the keyboard, you .I must first adapt \*(Mx to your particular version of the keyboard. Even with a United States version this procedure can do no harm, so if in doubt proceed. If you skip this procedure, it is assumed that the keys generate the characters that are engraved on the key tops of the United States keyboard, that is, the key below the DEL will generate the ASCII backslash character (\e) unshifted, and the ASCII bar (|) if shifted, irrespective of the character engraved on the key tops of your keyboard. .PP \*(Mx cannot handle the national characters themselves, like o-umlaut for Germany. The adaptations described below only allow you to enter the ASCII characters in the way you are used to with \s-2TOS\s0. In this respect \*(Mx behaves like most versions of .Ux . .PP \*(Mx has its own keyboard translation tables build into the operating system. A special tool is provided to extract the keyboard tables from a running version of \s-2TOS\s0 and to adapt the tables in the binary version of the \*(Mx kernel accordingly, without the need to recompile the \*(Mx kernel. Note that the \*(Mx keyboard translation tables have exactly the same format as used by \s-2TOS\s0. .PP Some keyboard versions need so many keys for special non-ASCII characters that combinations with the Alternate (ALT) key are used to generate some ASCII characters. For instance, in France the key below the Delete (DEL) generates the ASCII sharp sign (#), SHIFT-# generates the bar (|), ALT-# generates the at-sign (@), and ALT-SHIFT-# generates the tilde. The keyboard tables do not take the ALT key into account, so Atari delivers several national versions of the \s-2TOS\s0 operating system to cope with these problems, as mentioned above. In order to avoid national versions of \*(Mx, we have built into the keyboard driver a little table of special ALT and ALT-SHIFT combinations for the limited number of national keyboard versions that we knew of: United States, United Kingdom, Germany, France and Spain. If you happen to have another version you can make a simple modification in the keyboard driver of the kernel, but that takes effect only after recompiling the kernel. Refer to the chapter on kernel recompilation. .PP To adapt the keyboard tables proceed as follows: .HS .LI .IT Boot \s-2TOS\s0 and insert 00.TOS in drive 0. .IT Open a window onto drive 0 by double clicking the FLOPPY DISK A icon. .IT Run \fICOMMAND.TOS\fR found on diskette 00.TOS by double clicking. \fICOMMAND.TOS\fR is a simple line-oriented command interpreter. .IT Run \fIFIXKEYS.PRG\fR by typing .HS .Cx "fixkeys a:" .IT Insert unprotected 01.BOOT when you are asked to do so, and confirm by hitting the RETURN key. .IT Wait for the program to reply with .HS .Cx "Done" .HS .LX .PP You are now ready to boot \*(Mx. .SP 1.5 .SE "BOOTING MINIX-ST .SP 1.5 .PP This section presents a boot procedure for \*(Ms that works on all configurations of the Atari ST. Following sections describe how to adapt the set of diskettes so that you can use \*(Mx effectively on your particular combination of memory and disk drives. For example, if you have more than 512K you can increase the size of the RAM disk from 160K to 300K, if you have 1M of memory, or to 1M or more if you have even more memory. If you have a hard disk, all of the diskettes can be copied onto one or more of its partitions. Finally, some of the options for booting \*(Mx will be explained. But first the procedure for booting that works on all configurations is described. .PP Throughout the discussion below, lines printed in the \s-2\f5Helvetica typeface\fR\s0 are either commands you should type on the keyboard, or are lines that the computer will display for you. In a few of the examples, \fIitalics\fR characters or words appear in a command. These represent values that you are to fill in. .PP Booting is a three stage procedure. First the operating system itself is loaded into memory. Then the ROOT file system is copied to a RAM disk allocated in memory. Finally, the script .I /etc/rc is executed and a message will be displayed on the screen asking you to log on. .PP To boot \*(Ms, proceed as follows: .HS .LI .IT Turn off the ST and then insert diskette 01.BOOT in drive 0. You could push the RESET button as well, but that may not free memory occupied by a crash resistant \s-2TOS\s0 RAM disk you may have running. Moreover, it fails if you normally boot from the winchester. .IT Wait ten seconds, then turn on the ST. It will read the operating system (about 153K) from diskette in a few seconds. The screen will turn black and it will show on the top two lines the message: .HS .Cx "Booting MINIX 1.5. Copyright 1990 Prentice-Hall, Inc." .br .Cx "Insert ROOT diskette and hit RETURN (or specify bootdev)" .IT Replace 01.BOOT by diskette 02.ROOT and hit RETURN. Alternatives will be explained later. The system will respond with: .HS .na .Cx "Memory size\^=\^992K MINIX\^=\^153K RAM disk\^=\^160K Available\^=\^679K" .ad .HS for a system with 1M of RAM (numbers might deviate a little). Adding 32K (the size of the video memory) to the first number should give the amount of memory in your ST. .IT A fourth line will be displayed that reads: .HS .Cx "RAM disk. To load: 120K Loaded: 0K" .HS (The number 120 may vary a little). In rapid succession the number 0 will be increased in steps of 18K, until the whole line is replaced by: .HS .Cx "RAM disk loaded. Please remove root diskette." .IT When the RAM disk is loaded, the system initialization file, .I /etc/rc, is executed. It asks you to remove the root file system and insert the .I /usr file system (03.USR1) in drive 0 and type a RETURN. Do so. .IT After .I /usr has been mounted, you will next be requested to enter the date (and time). Enter a 12-digit number in the form MMDDYYhhmmss, followed by a RETURN. For example, 9:35 p.m. on June 01, 1990 was 060190213500. .IT You will now get the message: .HS .Cx "login:" .HS on the screen. Type: .HS .Cx "root" .HS and wait for the system to ask for your password. Then type: .HS .Cx "Geheim" .HS being careful to type the first letter in upper case. Lower and upper case letters are always distinct in \*(Mx. Alternatively, you could have used the name \*(OQast\*(CQ together with the password \*(OQWachtwoord\*(CQ. This is much preferred when you use the system normally, but for now it is troublesome. .SP 1 .IT If you have successfully logged in, the shell will display a prompt (sharp sign for root, dollar sign otherwise) on the screen. Try typing: .HS .Cx "ls \(enl" .HS to see what is in the root directory. Note that you need six keystrokes: \*(OQl\*(CQ, \*(OQs\*(CQ, space, \*(OQ\(en\*(CQ, \*(OQl\*(CQ, and a RETURN. Then type .HS .Cx "ls \(enl /bin" .HS to see what is in the .I /bin directory on the root device (RAM disk). After that, try: .HS .Cx "ls \(enl /usr/bin" .HS to see what is on the drive 0 diskette. To stop the display from scrolling out of view, type CTRL-S; to restart it, type CTRL-Q. (Note that CTRL-S means depress the \*(OQControl\*(CQ key on the keyboard and then hit the .I S key while \*(OQcontrol\*(CQ is still depressed.) .SP 1 .IT You can now edit files, compile programs, or do many other things. The reference manuals given in chapters 8 and 9 of this manual give a brief description of the programs available. However, before rushing off we advise you to adapt the system to your hardware configuration first, as described in the next sections. .SP 1 .IT When you are finished working, and want to log out, type CTRL-D. The .HS .Cx "login:" .HS message will appear, and you or another user can log in again. .SP 1 .IT When you want to shut the computer down, make sure all processes have finished, if need be, by killing them with .I kill . Then type .I sync or just log out. When the disk light goes out, you can turn the computer power off. Never turn the system off without first running .I sync or logging out (which does an implied .I sync ). Failure to obey this rule will generally result in a garbled file system and lost data. .LX .SE "INCREASING THE SIZE OF YOUR RAM DISK" .PP If you have 1M or more of memory, we advise you to increase the size of the RAM disk from 160K to 300K or more. A larger ramdisk allows you to use the RAM disk to copy complete or partial file systems from one diskette to another. It also gives you plenty of space to add a few more utilities to the ROOT file system. Finally, it allows you to compile much larger programs without running out of disk space for the intermediate results. On the other hand it leaves you with less memory to run your \*(Mx applications. Choosing a RAM disk of 300K leaves you enough memory to recompile most the sources and perform many other tasks. .PP It is easiest, to use a 360K diskette to carry this enlarged ROOT file system. However, it is a little tricky, to use a 360K diskette to carry a larger ROOT file system. Say you want to make a 512K RAM disk. You may wonder how a 512K RAM disk can be initialized by reading it in from a 360K diskette during the boot procedure. The secret is that the 512K RAM disk is not completely full. Part of it is initially empty so it can be used for scratch files. Only the initialized part (up to 360K) has to be read in. The only problem with this approach is that if you make new root file systems, you should be careful that they do not exceed 360K of data. Failing to do so may damage the file system on your diskette severely. .PP To install a 512K RAM disk, you must first make a 512K root file system diskette as described below. When \*(Mx is booted, it looks at the size of the root file system and sets its size accordingly. If you have more than 1 MB, you might even consider making a RAM disk larger than 512K, although only 360K can be initialized at start-up time. To do this, proceed as follows. .LI .IT Take an empty, formatted diskette and label it 10.R512 .IT Boot \*(Ms as described above and login as root. Then type: .HS .Cx "for i in cpdir mkfs; do cp /usr/bin/$i /bin; done" .br .Cx "/etc/umount /dev/dd0" .IT Insert 10.R512 in drive 0 and type: .HS .Cx "mkfs \(ent /dev/fd0 512" .br .Cx "/etc/mount /dev/fd0 /user" .br .Cx "cpdir \(enmsv / /user" .IT Logout by typing CTRL-D. .IT Insert 01.BOOT in drive 0 and type CTRL-ALT-DEL to reboot using 01.BOOT, 10.R512 and 03.USR1. .LX .PP Do not forget the \fB\(ent\fR option to \fImkfs\fR. It suppresses the check if the new file system fits on the medium. The program .I cpdir will tell you that it skipped the directory .I /user to avoid recursion. .PP By changing the argument .I 512 to .I mkfs you can adapt the size of the RAM disk. However, if you take a value less than 250 you will run into the problem that \fImkfs\fP allocates not enough inodes to store all the entries of the root file system. If you have 1M of memory and you want to recompile the system a RAM disk of 300K is recommended. Replace the last two occurrences of .I /dev/fd0 by .I /dev/dd0 if you prefer to use 720K diskettes, or by .I /dev/hd3 , or any other hard disk partition, if you want to load the RAM disk from the winchester. Read the section on boot options below if you do. .PP Note that a copy of the programs .I cpdir and .I mkfs will be present in .I /bin on your new ROOT diskette. .SE "ADAPTING PROGRAMS TO USE EXTRA RAM" .PP As distributed, the C compiler is tuned to work on even the smallest Atari ST configuration. This causes problems if you want to recompile (parts of) \*(Mx. The first part of the C compiler proper, .I /usr/lib/cem , as distributed is configured for a stack size of 40K, but it needs about 70000 bytes more to compile some of the larger source files on the distribution diskettes. It is possible to compile small programs on a 512K machine with the default memory allocation of the compiler. .PP If you have at least one of the following: .Bu more than 512K of memory .Bu two drives, either diskette or hard disk .HS .LP there are ways to recompile all of \*(Mx. Note that it is impossible to recompile some parts of \*(Mx on an ST with only 512K of memory and a single drive. .PP You are strongly advised to execute the following procedure now if you have more than the minimal 512K of memory. .LI .IT Boot \*(Ms and login as root. .IT Type: .HS .Cx "cp /usr/bin/chmem /bin" .br .Cx "chmem =35000 /usr/bin/make" .br .Cx "/etc/umount /dev/dd0" .IT Insert 06.ACK in drive 0 and type: .HS .Cx "/etc/mount /dev/dd0 /usr" .br .Cx "chmem =110000 /usr/lib/cem" .LX .HS .PP A similar procedure can be executed if you encounter any other program that needs more memory. .SP 0.5 .SE "USING SINGLE-SIDED DISKETTES" .SP 0.5 .PP The distribution contains several 720K diskettes. Most, but not all, Atari ST machines, have a disk drive that can handle 720K diskettes. Only a few older systems can only handle 360K diskettes. If you have one of these systems do not despair. You can split a single 720K diskette into a pair of 360K diskettes on a system with a 720K disk drive. Since you do not have such a system you will have to borrow one from a friend or perhaps your local dealer. .PP To split 04.USR2 into 13.USR2A and 14.USR2B proceed as follows: .LI .IT Boot \*(Ms using 01.BOOT, 10.R512 and 03.USR1; login as root. .IT Type: .HS .Cx "for i in cpdir mkfs rmdir; do cp /usr/bin/$i /bin; done" .br .Cx "/etc/umount /dev/dd0" .IT Insert 04.USR2 in drive 0 and type: .HS .Cx "/etc/mount /dev/dd0 /user" .br .Cx "mkdir /tmp/a" .IT Now copy files from \fI/user\fR to \fI/tmp/a\fR. You should add files to /tmp/a until the command .HS .Cx "du \(ens /tmp/a" .HS reports a value just below 355. .IT Unmount using: .HS .Cx "/etc/umount /dev/dd0" .IT Remove 04.USR2 and insert an empty, single-side formatted disk labeled 13.USR2A in drive 0 and type: .HS .Cx "mkfs /dev/fd0 360" .br .Cx "/etc/mount /dev/fd0 /user" .br .Cx "cpdir \(enmsv /tmp/a /user" .br .Cx "/etc/umount /dev/fd0" .br .Cx "rm \(enrf /tmp/a" .IT Repeat the same process for the second half of the files on 04.USR2, using an empty, single-side formatted disk labeled 14.USR2B. .LX .PP Be careful about the subtle difference between .I /usr and .I /user , between .I /dev/fd0 and .I /dev/dd0 , and between .I 13.USR2A , .I 14.USR2B and .I 04.USR2 . The result is two 360K diskettes that contain all of 04.USR2. Similarly, you can divide others. .PP It may happen that you need more than two 360K disks to contain all files of one 720K disk, because the file system itself imposes some overhead that is now doubled. Use three 360K diskettes in those cases. .PP After you have divided all other 720K diskettes and you have verified your work, you should make another copy of your root diskette (02.ROOT or 10.R512) and modify the file \fI/etc/rc\fR on that new copy, replacing the line .CC "/etc/mount /dev/dd0 /usr" by .CC "/etc/mount /dev/fd0 /usr" Now you can use this new 360K version of .MX just like the original one. However exercise some care when dealing with examples in this chapter or section 7.2, since they assume a 720K version. .SE "USING A HARD DISK" .PP If you have a hard disk and one or more partitions free for \*(Mx, you can use it to keep (part of) the distributed diskettes on line. If you have any choice, use a small (512K to 1M) partition 3 (\fI/dev/hd3\fR) to hold the ROOT file system that is copied to the RAM disk at boot time. See the section on boot options below. One of the other partitions, for example 4 (\fI/dev/hd4\fR), can be as big as 32M and can be mounted on \fI/usr\fR. It is also possible to keep the root file system on diskette and only use a partition to store the usr file system. In that case you can skip step 6 below. The penalty for keeping the root file system on diskette is an additional disk swap and some additional delay when booting the system. There is no difference in behavior after booting. You could use the whole disk (\fI/dev/hd5\fR) (up to 32 MB) as one single \*(Mx file system, but that would make the disk useless for \s-2TOS\s0. .PP This section describes the steps to set up \*(Mx on such a system. .PP .SS "Step 1: Backup the Hard Disk" .PP If you are already used your hard disk for \s-2TOS\s0, before even .I contemplating installing .MX , you should make a complete backup of the contents of your hard disk onto diskette or another medium. As a bare minimum, installing .MX will require erasing one partition of your hard disk, and possibly two. However, to prevent disaster in the event that you make an error during the setup procedure, it is highly desirable that you backup the .I entire disk before you even start. Your files are too valuable to put at risk. .PP It is worth noting that .MX has a program, .I tos , that can read \s-2TOS\s0 diskettes. Thus if you make your backup on diskettes, you will be able to read the files into the .MX file system after you have completed the hard disk installation. .SS "Step 2: Verify that Your Hard Disk is Atari Compatible" .PP There are a number of different hardware vendors for the Atari ST. Most of their disks work with \*(Mx. However, some hard disks will not co-operate with \*(Mx. For example it is known that some of the very first Supra disk controllers will not work with \*(Mx, due to a bug in the controller. Newer Supra disks (the ones with a SCSI out port) do not have this problem. .PP To verify that .MX is indeed able to correctly access your hard disk, boot .MX as described above, but instead of logging in as .I ast , log in as .I root , using .I Geheim as password (note the upper case \fIG\fR). If you are already logged in as .I ast , use CTRL-D to log out, then log in again as .I root (without rebooting). Logging in as .I root makes you the superuser and gives you the sharp sign (#) as prompt instead of the usual dollar sign. The superuser is the system administrator and has special privileges denied ordinary users. To install .MX on your hard disk, you will need these privileges. Once the installation is complete, you should always log in as .I ast , or create your own login name as described later in this manual. .PP Once you are successfully logged in as .I root , type: .CC "dd if=/dev/hd5 of=/dev/null count=200" After a short time, you should get the message: .HS .Cx "200+0 records in" .br .Cx "200+0 records out" .HS If you get an error message or no response, .MX cannot use your hard disk controller. .PP .SS "Step 3: Partition the Hard Disk" .PP Initialize the hard disk (formatting and partitioning) using the tools supplied by Atari, notably the \fIHDX.PRG\fR utility. If you have already partitioned your disk before, and you are happy with the partition sizes you can skip this step. Be warned that partitioning the hard disk will destroy all information on that disk. \*(Mx is not equipped to initialize your disk. The \*(Mx disk driver requires no special settings of the .I pi_flag and .I pi_id fields (see the Atari hard disk manual), mainly because the Atari hard disk driver code is deficient in properly maintaining the hard disk information found in sector 0. This requires you not to mix up which operating system should operate on which partition, unfortunately. \*(Mx checks the super block on mounts and it is unlikely that a \s-2TOS\s0 partition will be accepted. However, writing to a \s-2TOS\s0 partition by accessing \fI/dev/hd?\fR directly, although superuser only, is not prevented. Be careful. Similarly, avoid \s-2TOS\s0 accesses to \*(Mx partitions. It is a good idea to remove the icons for the \*(Mx partitions from the \s-2TOS\s0 desktop. .PP Another problem is that the \fIHDX.PRG\fR seems not to format the last sector on the disk properly, so never use the last sector of the last partition. This is probably a bug in \fIHDX.PRG\fR. So, whenever you make a \*(Mx file system on the last partition, subtract 1 from the real number of sectors of that partition when calling .I mkfs . .PP If you have any choice, allocate a small partition 3 of 512K, and a large partition 4 of at least 10M. This setup is assumed in the rest of this section. .SS "Step 4: Make a MINIX File System on Each MINIX Partition" .PP Now that the disk is physically partitioned, it is time to put a .MX file system on each .MX partition. To do this, determine the number of sectors in each partition. \fIHDX.PRG\fR will have told you the number of sectors when partitioning. The number may not be quite what you had expected due to the use of entire cylinders and rounding effects. Compute the number of 1K blocks in each .MX partition by dividing the number of sectors by 2 (one block is two 512-byte sectors). .PP An alternative is to use the command .I readall with the option \fB\(ent\fR on each partition. For example: .HS .Cx "readall \(ent /dev/rhd4" .HS will tell you the number of 1k blocks on \fI/dev/hd4\fR. It is possible that during the execution of readall you get a few error messages about unrecoverable disk errors. These error messages can be ignored safely. .PP To create a file system of, say, 512 blocks of 1K on partition 3 and 10239 blocks of 1K on partition 4, log in as root and type: .HS .Cx "mkfs /dev/hd3 512 .br .Cx "mkfs /dev/hd4 10239 .HS Notice the 10239 (10240 minus 1) due to the bug in \fIHDX.PRG\fR mentioned before. For other .MX partitions (or sizes) type the analogous commands. Do not run \fImkfs\fR on \s-2TOS\s0 or other partitions. Be very careful not to make a typing error here, as making a new file system destroys all information on the partition specified. .PP You can verify that the file systems have been made by typing: .HS .Cx "df /dev/hd3" .br .Cx "df /dev/hd4" .HS which will report on the i-nodes and blocks present on each file system. The total number of blocks should agree with the number you used in the \fImkfs\fR command. .PP You can now mount your new file systems. To mount \fI/dev/hd3\fR (partition 3) on \fI/user\fR, type: .CC "/etc/mount /dev/hd3 /user" To change to \fI/dev/hd3\fR, type: .CC "cd /user" This puts you in the root directory of the partition 3 file system. .SS "Step 5: Check for Bad Blocks" .PP With current manufacturing technology, it is nearly impossible for disk vendors to deliver perfect drives. Almost every drive has some bad blocks on it. If .MX were to use a bad block in one of your files, you might lose some valuable data, so it is important to locate all the bad blocks before putting any files on the disk and make sure they do not cause trouble. .PP The scheme used in .MX is to put all the bad blocks into dummy files, so that the disk space allocator will think they are in use and leave them alone. This method is more efficient than wasting entire tracks as spares, as is sometimes done. Suppose that you have allocated partitions 3 and 4 for .MX . To locate the bad blocks on partition 3, first log in as .I root , go to the root directory, and unmount the partition, if mounted, by typing: .SP 0.25 .HS .Cx "cd /" .br .Cx "/etc/umount /dev/hd3" .HS .SP 0.25 It is important that the next commands be executed on the root device, since they will attempt to mount and unmount \fI/dev/hd3\fR, which will fail if your working directory is there. To locate all the bad blocks, type: .SP 0.25 .HS .Cx "readall \(enb /dev/rhd3 >bad.3" .HS .SP 0.25 .PP Depending on the size and speed of your disk, this operation may take a substantial fraction of an hour. Please be patient. It is possible that during the execution of \fIreadall\fR you get a few error messages about unrecoverable disk errors. These error messages can be ignored safely. When it is finished, a prompt will appear on the screen. When it does, you can examine the output files using \fIcat\fR, \fImore\fR, or an editor, for example, by typing: .SP 0.25 .HS .Cx "cat bad.3" .HS .SP 0.25 The output will be a shell script that calls \fIbadblocks\fR with up to seven arguments, each one the number of a bad block. Bad blocks often cluster together. This is normal. .PP To mark the blocks as bad, type: .SP 0.25 .HS .Cx "sh bad.4 # find the bad blocks on partition 4" .Cx "sh