How to set up a ZIP disk for use with NetBSD/mac68k Nico van Eikema Hommes (hommes@ccc.uni-erlangen.de), Colin Wood (ender@rice.edu) v1.0, 12 April 1997 This is a document explaining how to set up a ZIP removable cartridge for use with NetBSD/mac68k. 11.. IInnttrroodduuccttiioonn aanndd PPuurrppoossee Setting up a ZIP disk for use under NetBSD/mac68k is easy, once you have collected all the tools and found out how to do it. This "HOW-TO" describes what you need and what you must do. All steps have been tested while I was writing, to assure highest possible accuracy. Everything worked for me, and I hope that it will do for others as well. You can use a ZIP disk in two ways with NetBSD/mac68k: 1. use it to install NetBSD on; 2. use it as an additional filesystem. For both, you will need Apple's HD-SC Setup 7.3.5, patched to recognize every disk drive. You can download a patched version, or do it yourself using ResEdit. See the FAQ. For installing NetBSD/mac68k on the ZIP, you will further need the following MacBSD tools: mkfs_1.4, Installer 1.1d, and BSD/Mac68k Booter 1.9.6. Note: these version numbers were the ones available when this document was prepared. They may change as time passes. Of course, you can use another partitioning tool if you have one (e.g. the one that came with your non-Apple hard disk). However, HD SC Setup is free, and does the job well. 22.. IInniittiiaalliizziinngg tthhee ZZIIPP ddiisskk The first step is to reinitialize the ZIP disk with HD SC Setup. Reboot your Mac with extensions off (keep the shift key pressed). Insert the ZIP into the drive. It will not mount. Start HD SC Setup, click on the button "Drive" until you found the ZIP (SCSI ID 5 or 6, depending on the drive setting), and click on "Initialize". Confirm that you want to initialize the disk and have a coffee/tea break while the formatting is running. After some time, you have to enter the name of the disk. Just click OK. Then quit HD SC Setup. Back in the Finder, drag the newly formatted drive to the trash. Confirm that you want to unmount the volume. Note that the disk is not ejected, since the driver treats it as a normal hard disk, not a removable. Start HD SC Setup again, select the ZIP drive,and click on "Partition". In the partition window, click on "Custom". You get an overview of the disk layout. The first part is called "Mac Driver" and should be left as it is. Most of the rest is the HFS filesystem generated during the initialization. Select it, click "Remove", confirm that you want to delete it. You now have 98256 k at your disposal. 33.. SSeettttiinngg uupp tthhee ZZIIPP aass aann aaddddiittiioonnaall ffiilleessyysstteemm.. Drag from the top over the gray area to create a new partition. The partition type is not important, "Scratch" will do. Set the size to 98255 k (1 k less than the maximum given underneath, otherwise mkfs_1.4 will not recognize the partition), click "Done", and quit HD SC Setup. Start mkfs_1.4 and select your "IOMEGA ZIP 100" as the drive you want to work on (the "root SCSI ID"). The window with the list of partitions will show one partition: Scratch->Scratch Select this partition and click "Change". Select "NetBSD Usr" as the partition type and click "Do It!". Now the list will show: UNIX_SVR2->NetBSD Usr Select the partition again and click "Format". A dialog window appears, in which you can add various parameters. You have to enter two values: Sectors/Track should be set to 32 (instead of the suggested value of 40) Tracks/Cylinder should be 64 Click OK and confirm that you want to "Format". In the console window, you will see the following, or something very similar: optimization space nsectors 32, ntracks 96, cylspares 0 Warning: calculated sectors per cylinder (3072) disagrees with disk label (0) Disk parameters and geometry is reasonable enough to proceed formatting..... Warning: 98 sector(s) in last cylinder unallocated disk: 196510 sectors in 64 cylinders of 96 tracks, 32 sectors 100.6MB in 4 cyl groups (16 c/g, 25.17MB/g, 5760 i/g) super-block backups (for fsck -b #) at: 32, 49216, 98400, 147584, formatting complete Click "I read it" in the small alert window, click on "Done" in the main window, quit mkfs, and boot into NetBSD. When the system is run- ning, log in as "root" (you need to be superuser to create the filesystems) and check at the end of /var/log/messages. The ZIP drive will show up like this: sd2 at scsibus0 targ 5 lun 0: SCSI2 0/direct removable sd2: 96MB, 96 cyl, 64 head, 32 sec, 512 bytes/sec The drive number may be different, depending on the number of drives you have and their SCSI IDs. Replace "sd2" in the following part by the drive number on your system. Now type the command: disklabel sd2 This will give you an overview of the drive parameters and the avail- able partitions on the disk. The partition list will be as follows: 7 partitions: # size offset fstype [fsize bsize cpg] a: 32 64 unknown # (Cyl. 0*- 0*) b: 2 196606 unknown # (Cyl. 95*- 95*) c: 196608 0 unused 0 0 # (Cyl. 0 - 95) g: 196510 96 4.2BSD 0 0 0 # (Cyl. 0*- 95*) The partition you just generated with mkfs is then one named "g", of type "4.2BSD", with a size of 196510 blocks and starting at block 96. The first 64 blocks contain the partition map, the Mac driver lives in partition "a", 32 blocks (16k) in size. Further, "c" means the whole disk, and "d", "e", and "f" were not created. The ZIP disk is now almost ready for use. You will need to check the file system, create a "mount point" (the directory that will be used to access the drive) and mount it. In addition, you may want to change the amount of space that is reserved from 10 % (default) to a lower value, e.g 2 %. Enter the following commands (remember, you are superuser, any error may destroy valuable data!): fsck -f -y /dev/rsd2g tunefs -m 2 -o space /dev/sd2g mkdir /zip mount /dev/sd2g /zip If you now type df, you will see that partition /dev/sd2g on your ZIP disk is mounted as "/zip", with a size of 95294 k. 93373 k of that are available for your files. 44.. IInnssttaalllliinngg NNeettBBSSDD//mmaacc6688kk oonn tthhee ZZIIPP.. Decide how much swap space you want to have. Add 2 Mb for the necessary mini MacOS partition (useful to put the installer and the booter on). Subtract this from the available space. For example, if you choose to have 16 Mb swap space, you get: available on disk 98256 k reserved for swap 16384 k reserved for MacOS 2048 k - 18432 k size of root partition 79824 k Drag from the top over the gray area, select "A/UX Root&Usr slice 0" as partition type, and enter the size. Click OK. Again drag from the top over the gray area for the swap space. Select "A/UX Swap slice 1", enter the size, and click OK. Now create the third partition, select "Macintosh Volume" as type. The size will be set to 2048 k. Click OK, enter the name for the partition, click OK, click Done, and quit HD SC Setup. Your ZIP disk is now correctly partitioned for NetBSD. The next step is to prepare the filesystems on the partitions. Start mkfs_1.4 and select your "IOMEGA ZIP 100" as the drive you want to work on (the "root SCSI ID"). The window with the list of partitions will show the following information: UNIX_SVR2->A/UX Root UNIX_SVR2->A/UX Swap Select the first partition, click "Change", "NetBSD Root & Usr" will already be selected, click "Do It!". Select the second partition (swap), click change, "NetBSD Swap" is selected, click "Do It!". Now the list is as follows: UNIX_SVR2->NetBSD Root & Usr UNIX_SVR2->NetBSD Swap Select the first partition again and click "Format". A dialog window appears, in which you can add various parameters. You have to enter two values: Sectors/Track should be set to 32 (instead of the suggested value of 40) Tracks/Cylinder should be 64 Click OK and confirm that you want to "Format". In the console window, you will now see something like: optimization space nsectors 32, ntracks 64, cylspares 0 Warning: calculated sectors per cylinder (2048) disagrees with disk label (0) Disk parameters and geometry is reasonable enough to proceed formatting..... Warning: 96 sector(s) in last cylinder unallocated disk: 159648 sectors in 78 cylinders of 64 tracks, 32 sectors 81.7MB in 5 cyl groups (16 c/g, 16.78MB/g, 3840 i/g) super-block backups (for fsck -b #) at: 32, 32832, 65632, 98432, 131232, formatting complete The numbers may be different, depending on the size of you swap parti- tion. Click "I read it" in the small alert window, click on "Done" in the main window, and quit mkfs. Your ZIP disk is ready for the NetBSD installation. Start Installer 1.1d. Select your ZIP drive as the root SCSI ID. For the ZIP, the console window will show something like: sd2a: Root 'NetBSD Root & Usr' at 96 size 159648 sd2b: Swap 'NetBSD Swap' at 159744 size 32768 sd2d: Other (APPLE_DRIVER43) 'Macintosh' at 64 size 32 sd2e: HFS 'MacOS' at 192512 size 4096 You may get another drive number, e.g. sd1, depending on how many drives, with which SCSI IDs, are connected to your system. Select "Build Devices" from the File menu. This will generate all the neces- sary device files on your ZIP disk. It will also create the file /etc/fstab, already set up for your ZIP disk: /dev/sd2a / ufs rw 1 1 /dev/sd2b none swap sw 0 0 kern /kern kernfs rw 0 0 proc /proc procfs rw 0 0 Note that older versions of the installer do not correctly set the drive numbers. Version 1.1d does. You can now install NetBSD/mac68k. See the installation instructions on what is necessary, how much space it needs, etc. When everything is installed, quit the installer, start the MacBSD Booter, set the parameters in the "Booting..." dialog (the drive number, sd2 in the example, and the SCSI ID must be entered here), and boot the system.