In our article Serial Port Multiplexer, we documented a design for a shoestring budget console sharing device. Basically, if you have a bunch of servers that can run their consoles via a serial port, you can use our device to monitor all of these consoles remotely. Well, one of our boxes is sick, and we thought you might like to see what you can do via the serial port, and provide an example of recovering a corrupt ext2 filesystem. Without console access via the serial port, we would have to hook up a monitor to the video card to resolve this, and certainly couldn’t do this remotely. One thing that is cool, is that you can hook up a network attached Linux box to control the Serial Port Multiplexer. That way, you could manage your servers remotely over the network. Do be careful about security, OK? Also, for a datacenter, you might want to consider a real Console Access Server like this product from Cyclades.
Here is what you will see on a Linux console if you have a corrupt ext2 filesystem:
Give root password for maintenance (or type Control-D for normal startup):
Let’s just try Control-D for a normal startup:
Unmounting file systems umount: automount(pid503): not found umount: /misc: not mounted Cannot MOUNTPROG RPC: RPC: Port mapper failure - RPC: Unable to send umount: /share: not mounted umount: none: not found umount: /dev/pts: not mounted Automatic reboot in progress. Restarting system. LILO Loading linux............. . . . /: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (i.e., without -a or -p options) [/sbin/fsck.ext2 -- /] fsck.ext2 -a /dev/sda1 [FAILED] *** An error occurred during the file system check. *** Dropping you to a shell; the system will reboot *** when you leave the shell. Give root password for maintenance (or type Control-D for normal startup):
Well, this time let’s enter the root password, run fsck, and reboot:
(Repair filesystem) 2 # fsck.ext2 /dev/sda1 e2fsck 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09 / contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes . . . Inode 91027, i_blocks is 64, should be 8. Fix? yes Pass 2: Checking directory structure Free inodes count wrong (49347, counted=49378). Fix? yes /: ***** FILE SYSTEM WAS MODIFIED ***** /: 51198/100576 files (0.2% non-contiguous), 142471/200804 blocks (Repair filesystem) 3 # (Repair filesystem) 3 # reboot