From owner-freebsd-small Thu Apr 6 12:48:17 2000 Delivered-To: freebsd-small@freebsd.org Received: from raven.webgroup.ch (webgroup.ch [194.191.122.98]) by hub.freebsd.org (Postfix) with ESMTP id D140837BF4E; Thu, 6 Apr 2000 12:48:09 -0700 (PDT) (envelope-from ast@marabu.ch) Received: (from uucp@localhost) by raven.webgroup.ch (8.9.3/8.9.2/ast-20000114) with UUCP id VAA81620; Thu, 6 Apr 2000 21:48:02 +0200 (CEST) Received: (from uucp@localhost) by hawk.marabu.ch (8.8.8/8.8.8) with UUCP id VAA28879; Thu, 6 Apr 2000 21:41:02 +0200 (MEST) (envelope-from ast@marabu.ch) Received: by marabu.marabu.ch (8.7.5/990131-ast-8.0) id VAA08298; Thu, 6 Apr 2000 21:39:24 +0200 (CEST) Message-Id: <200004061939.VAA08298@marabu.marabu.ch> MIME-Version: 1.0 (NeXT Mail 3.3 v124.8483.6) Content-Type: text/plain In-Reply-To: <200004042047.OAA70876@harmony.village.org> X-Nextstep-Mailer: Mail 3.3 (Enhance 2.0b6) Received: by NeXT.Mailer (1.124.8483.6) From: Adrian Steinmann Date: Thu, 6 Apr 2000 21:39:23 +0200 To: freebsd-small@FreeBSD.ORG Subject: Re: Mounting and Corruption Rehashed Cc: "Jonathan M. Bresler" , jss@subatomix.com, Warner Losh References: <20000404204324.3155E37B8D6@hub.freebsd.org> <200004042047.OAA70876@harmony.village.org> X-Organization: Steinmann Consulting, Apollostrasse 21, 8032 Zurich X-Phone-Numbers: Switzerland, Tel +41 1 380 30 83 Fax +41 1 380 30 85 Sender: owner-freebsd-small@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello small free-bsd-ers! "Jonathan M. Bresler" recently asked: : how about sending out at how-to on this?? I can't stand lurking anymore, so here goes: This is my special /etc/rc.conf: root_rw_mount=NO rootdev=fla0 diskless_mount=/etc/rc.readonly etc_size=1536 home_size=1024 var_size=32768 and this is my special /etc/rc.readonly: if [ -f /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf elif [ -f /etc/rc.conf ]; then . /etc/rc.conf fi echo -n "Making writable mfs filesystems:" mount_mfs -s ${var_size:=65536} -T qp120at dummy /var while [ -e /var/.readonly ]; do sleep 1; done for d in root log run db msgs cron cron/tabs spool spool/mqueue \ tmp tmp/vi.recover at at/jobs at/spool do mkdir /var/$d && chmod 755 /var/$d done chmod 755 /var chmod 1777 /var/tmp /var/tmp/vi.recover chown daemon /var/at/jobs /var/at/spool touch /var/run/utmp && chmod 644 /var/run/utmp touch /var/log/wtmp && chmod 664 /var/log/wtmp (cd /root && tar cBf - . | (cd /var/root && tar xBf -)) echo -n " var" cp /dev/MAKEDEV /var/tmp mount_mfs -s 256 -i 512 -T qp120at dummy /dev while [ -f /dev/.readonly ]; do sleep 1; done cp /var/tmp/MAKEDEV /dev && rm -f /var/tmp/MAKEDEV cd /dev && sh MAKEDEV std ${rootdev} ${rootdev}s1h vty12 pty0 ttyd0 ttyd1 echo -n " dev" for d in etc home do (cd /$d && tar cBf - .) > /var/tmp/$d.tar eval mount_mfs -s \${${d}_size:=1024} -T qp120at dummy /$d while [ -e /$d/.readonly ]; do sleep 1; done (cd /$d && tar xBf /var/tmp/$d.tar) rm -f /var/tmp/$d.tar && echo -n " $d" done echo You should see this when you come up: $ mount -p /dev/fla0s1a / ufs ro 1 1 mfs:28 /var mfs rw,async 0 0 mfs:73 /dev mfs rw,async 0 0 mfs:816 /etc mfs rw,async 0 0 mfs:822 /home mfs rw,async 0 0 It's not so surprising that by turning just those two knobs we have a flash system which doesn't gradually self destruct since its mounted read-only. When you remount / rread-write to update, just reboot and get on with it (remounting ro works, but can we trust it?). Shall we get /etc/rc.readonly and a special /etc/rc.conf section mentioning "how to" put into the main distribution? _________________________________________________________________________ Dr. Adrian Steinmann Steinmann Consulting Apollostrasse 21 8032 Zurich Tel +41 1 380 30 83 Fax +41 1 380 30 85 Mailto:ast@marabu.ch To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-small" in the body of the message