I have a Debian machine that is only accessible remotely via SSH (no keyboard or monitor attached). In order to perform filesystem maintenance with e2fsck, I believe I need to put the machine into single-user mode, but with SSH running. (Currently when I try to run e2fsck in run level 2 I receive messages that the “device is busy.”)
It would seem that the best way to do this would be to remove the K20ssh script from /etc/rc1.d and replace it with the S20ssh script from run level 2. When I tried this, however, I still lost my ssh connection and had to (shutter) reboot the machine via power-cycle.
Can someone give me a hand and tell me what they are doing that accomplishes this safely?
Thanks in advance,