Singapore Dedicated Server Bandwidth (Uplink) | Network latency | Environment monitoring
Xssist™ Group Pte Ltd Singapore Dedicated Servers Client Testimonials Blog Community Frequently Asked Questions Contact Page
Singapore Dedicated Servers
Control Panel System
Control Panel System
Xssist Blog

Recover from mistakes in /etc/fstab or e2label usage

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.

[Sysadmin] Access to servers via mobile device and ssh
[Sysadmin] RAID 0 scaling on SCSI U320, Bonnie++ 1.93c benchmark results
[Sysadmin] TODO (Apr 2007)
[Sysadmin] Recover from mistakes in /etc/fstab or e2label usage
[Sysadmin] Server overloaded?
[Sysadmin] Server load high: CPU bound
[Sysadmin] Smokeping: deluxe latency measurement tool
[Sysadmin] Smokeping
[Sysadmin] Jul 08 to Oct 08 updates
[Sysadmin] Weak link - downtimes caused by the organic being
[Sysadmin] BIOS upgrades - uniflash - hotflash
[Sysadmin] Sizing for Virtual Private Server (VPS) & SSDs
[Sysadmin] iphone, ipod - bluetooth keyboard - Nokia e51
[Sysadmin] e2label, fdisk, /etc/fstab, mount, linux rescue, rescue disk, CentOS
[Sysadmin] opensuse, fix waiting for mandatory device, eth0, eth1, eth2, eth3
[Sysadmin] mount: could not find filesystem '/dev/root'
[Sysadmin] Parallels Virtuozzo Physical server to Container migration (vzp2v)
[Web hosting] DDOS (Distributed Denial of Service)
[Web hosting] Uptime for dedicated server, VPS and shared server
[Web hosting] Shared, Guaranteed and Dedicated Bandwidth
[Web hosting] Unmetered bandwidth
[Web hosting] Free domains?
[Web hosting] Joomla Scalability
[SPAM handling] Tracking applications which are exploited for mass spam mailing
[Buzzwords] Clusters, Clustering
[Security] Destruction of faulty hard disks
[Storage] Benchmark using iometer on linux
[SSD] Benchmark Intel X25-E and Intel X25-M flash SSDs
[SSD] Intel X25-E 64GB G1, 4KB Random IOPS, iometer benchmark
[SSD] Intel X25-M 160GB G2, 4KB Random IOPS, iometer benchmark
[SSD] Comparison of Intel X25-E G1 vs Intel X25-M G2
[cPanel] ClamAV version has reached End of Life! Please upgrade to version 0.95
[cPanel] How to install Java, ImageMagick and ffmpeg
[Perl] Opening text files for reading, and simple regexp (regular expressions)