NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: corrupt /etc: how to gracefully shut down?
hhaamu%gmail.com@localhost writes:
> Greetings
>
> I have a NetBSD installation where the flash drive I installed it on is
> failing and managed to corrupt some directories residing in /etc
>
> Specifically, these directories:
> /etc/atf/
> /etc/defaults/
> /etc/fonts/
> /etc/rc.conf.d/
> /etc/rc.d/
> /etc/skel/
> /etc/sliphome/
>
> None of the files within those directories are readable.
>
> As far as I can tell, that is the whole extent of the corruption.
> The /bin, /sbin, and /usr directories in particular seem to be fine.
>
> I'm trying to shut down the computer as gracefully as possible. It is
> running in a NAS role, running an NFS server and raidframe, mostly.
[snip]
What I am going to suggest assumes you have console access. If you do
not, then it may be more challenging.
On the console as root:
kill -15 1 - this will bring you down to single user
umount -a - this will unmount as many of the filesystems as it can.
In particular the root filesystem won't be unmounted with this.
poweroff - or equivalent... shuts the system down
If the kill complains about unkillable processes, take its suggestion
and try to find out what is running before you do the umount part. If
you do have a hung processes any particular filesystem may not be
unmountable.
In theory, you could just try the poweroff part, as that should really
bring all of the processes down and umount everything, but I have been
able to cleanly shut systems down in the past by doing the above steps
when just poweroff by itself would hang up.
I would not suspect that a NAS role based system would need to run any
shutdown scripts, but given that /etc/rc.d is messed up, that probably
isn't possible anyway.
--
Brad Spencer - brad%anduin.eldar.org@localhost
Home |
Main Index |
Thread Index |
Old Index