Server hanged. Called up datacentre to reboot, and it never came up. That is a dreadful scenario.
One of the worst problem is to have a faulty harddisk.
What I would like to cover here though, is human errors, eg. the case where /etc/fstab is misconfigured.
I have clients who changed /etc/fstab, do mount -a and see no problems. Later on, probably weeks or months
later, the server does not come up after reboot. On the console, we would see error messages like the following
fsck.ext3: Unable to resolve 'LABEL=/boot'
fsck.ext3: Unable to resolve 'LABEL=/home'
*** 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 you have a server that has hardware failure, other than the disk, and you want to mount the disk in
another server, only to find that both disks have the same paritions! eg. / /boot /usr etc and the
server refuses to boot.
ok, so you enter in the root password. What next?
A few useful commands here; just in brief, enough as keywords for you to go googling for details,
or check the man pages.
|fdisk -l||(to find out the partitions on the disks)|
|e2label /dev/sda1||(find out or write the label for a partition. in this case,
partition 1 of /dev/sda. of course, IDE disks will show as /dev/hda etc)|
|mount -o remount,rw /||(remount a readonly filesystem readwrite so changes
can be made, especially to files like /etc/shadow, /etc/fstab, /boot/grub/menu.lst etc)|
|passwd||(change the root password if you have forgotten)|
Sometimes it is useful to go into single user mode, especially if the server hangs when it tries
to bring up the network. To do so, when grub comes up, press the up or down arrow keys, select one of the
kernel, press 'e' for edit, and append "single" to the end of the line. come out of the editing
by pressing enter, and press 'b' for boot. Also useful when you have SCSI RAID drivers, other than provided
on the installation disk, on the server. So you really want the server to boot up with the drivers.
Usually, if you have access to the console, it is easy to boot up using CD. example, the server cd of centos.
key in linux rescue at the prompt, and you will get a nice environment to use for fixing your server.