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. It's important to unmount the filesystems cleanly and shut down anything else that would otherwise appear 'dirty' at next boot. Anything to avoid a hard shutdown. I have a feeling that since the subdirectories defaults/, rc.conf.d/, and rc.d/ are missing, a normal "shutdown -p now" would probably error out somewhere along the way. The good news is that I have a recent backup of the whole root partition, so I can restore any missing files, but I have a feeling that trying to write to the drive may only cause further corruption. Would there be a list of commands I can run to manually shut down as much as possible? I also came up with the idea of an overlay mount of a ramdisk (mount_mfs(8)) over /etc; I can restore the original contents of /etc there and use mount_union(8) to map it to /etc. Would that work? At what point would the shutdown script try to unmount it? Do you have any other suggestions?
