Subject: Re: towards a NetBSD LiveCD: /etc/rc.d/mountcritmem
To: David Young <>
From: Jeremy C. Reed <>
List: tech-install
Date: 12/02/2005 17:57:30
On Fri, 2 Dec 2005, David Young wrote:

> I use the attached rc script, mountcritmem, to make "Live" CD-ROMs.
> mountcritmem makes copies select directories from a read-only root to a
> read-write memory filesystem, and null-mounts the read-write copies at
> the root.

It looks like the attachment is missing.

My fstab had:

/dev/cd0a / cd9660 ro 0 0
swap            /var/tmp        mfs     rw,-s=20m       0 0

Here's my /etc/rc.d/LIVECD that I used with 1.5.x and 1.6.x live CDs I 
used to make:

# PROVIDE: mountcritlocal

. /etc/rc.subr

echo 'Making devices in background'
cp /usr/local/bin/MAKEDEV.real /dev/MAKEDEV
(cd /dev ; sh /dev/MAKEDEV all ) &

echo -n 'Creating critical read-write directories...'

cd /

filelist="tmp var/log var/run var/db var/cron var/at var/account var/mail var/spool etc usr/pkg/etc usr/X11R6/etc home root"

for directory in $filelist
         echo -n " $directory"
         if [ -e $directory ]
                 tar -cf - $directory | (cd /var/tmp; tar -xpf -)
                 mount -t null /var/tmp/${directory} $directory

   chmod 1777 /tmp # maybe mount_null(8) lost this?

echo '.'

And my MAKEDEV.real only makes some devices as needed for minimal use.

  Jeremy C. Reed

  	  	 	 BSD News, BSD tutorials, BSD links