From owner-freebsd-questions Fri Sep 1 08:40:55 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id IAA06211 for questions-outgoing; Fri, 1 Sep 1995 08:40:55 -0700 Received: from cmc.eng.comsat.com (cmc.eng.comsat.com [134.133.169.1]) by freefall.FreeBSD.org (8.6.11/8.6.6) with SMTP id IAA06204 for ; Fri, 1 Sep 1995 08:40:53 -0700 Received: from cmc (cmc.eng.comsat.com) by cmc.eng.comsat.com (4.1/SMI-4.1) id AA06638; Fri, 1 Sep 95 11:39:45 EDT Date: Fri, 1 Sep 1995 10:58:25 -0400 (EDT) From: MARC Giannoni Subject: Re: Help! I blew away init To: questions@FreeBSD.org In-Reply-To: Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: questions-owner@FreeBSD.org Precedence: bulk Well for anyone who is interested, there is an answer here. I know what I did was relly dumb, but that is how I learn stuff. Creating a boot floppy which will also contain a single user root file system is quite a trick. First you will need a kernel - the smallest possable. If you have access to a kernel source tree, create one which has the minimum you will need to mount your hard disk. Tough to do if your root file system is blown away, this may be something you will want to set up for emergencies! Use the pseudo-device 'gzip' so that you can have the support programs on the floppy compressed. (Who cares about performance now!) The floppy disk will need three directories, /dev, /bin, /sbin. In /dev you will have to have all your device nodes. These are small so you can afford to have quite a variety. Next you will need to have a copy of init in /sbin, and a copy of sh in /bin. Most importantly you will need a copy of mount and umount along with fsck to get access to the hard disk for repairs. If you have the pseudo-device 'gzip' in your kernel, these can be gzipped. By this point the floppy will be filling up, possably overfull. The question here is how can we allow for a floppy disk change following bootup and before init does a chroot to the floppy? I have seen boot disks do this, they will pause and request that a root floppy be placed in the drive. This two disk alternative would provide much more space. With this skeletal setup, the trick is to boot the floppy and try to mount something which will provide you with much support. A cdrom is nice, so is another floppy disk. One more thing that I noticed during this exercise is that init announced that it was changing to root device fd0c. So when I setup the floppy, for the 10th time, I edited the disk label to have partition c equivalent to partition a. For a 1440 disk: 3 partitions: # size offset fstype [fsize bsize cpg] a: 2880 0 4.2BSD 512 4096 16 # (Cyl. 0 - 79) b: 2880 0 unused 512 4096 # (Cyl. 0 - 79) c: 2880 0 4.2BSD 512 4096 16 # (Cyl. 0 - 79) | Marc V. Giannoni | Voice: (301) 428-2547 | | COMSAT Mobile Communications | Fax: (301) 601-5959 | | 22300 Comsat Drive | Internet: marc@cmc.eng.comsat.com | | Clarksburg, MD 20871 | Title: Software Engineer |