Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Mounting a dump file



> I've now restored the contents of a dump file and it reported a
> problem:

> # restore -r -f dump-file
> ./var/db/dhcpd.leases~: not found on tape

> even though that file was present after restore(8) had finished.
> What might lead to that confusion?

dump(8) has race conditions when used to dump live filesystems: it's
possible to get skew between what dump reads at one point and what it
reads at a later point.  Under some conditions, this can lead to what
you describe.

> I finally realised that with the IDE disk connected when booting the
> restored 5.1.2 system, /etc/motd gets overwritten with 6.0.1's
> version during booting into multi-user mode [...]

> What's going on in the background when the `Updating motd' message
> appears when the machine is booting?

What's going on is that NetBSD decided that the admin's /etc/motd
should be automatically corrupted during boot, either prepending a line
giving the kernel version or replacing the first line with that line,
depending on whether the (former) first line begins with "NetBSD",
incidentally overwriting and then destroying /etc/_motd, if it existed,
in the process.  Mercifully, they provided a workaround, which you can
activate with update_motd=NO in rc.conf.

For full details, see the rc script that implements this.  I don't have
a 6.* system at ready hand to look at, but, on 5.2, /etc/rc.d/motd is
where it lives, and it's quite simple.  The core of it is

        ( umask 022
        T=/etc/_motd
        sysctl -n kern.version | while read i; do echo $i; break; done > $T
        sed '1{/^NetBSD.*/{d;};};' < /etc/motd >> $T
        cmp -s $T /etc/motd || cp $T /etc/motd
        rm -f $T
        )

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index