This is a cut & paste of one of my documents that may help you recover. (the second part willl probably do it "Hint" edit the password file"
Good Luck,
Laurie.
Ok so you walk into the comms room and some one has been playing with your Linux PC and now it won't boot into the OS !
So where do we start?
Right the system comes up and you get the LILO boot loader screen and after 5 or so seconds the system begins to start the secondary bootloader process but stops at the point of "Checking root filesystem (NULL):" and informs you that it was unable to continue as there is a problem with the superblock .....
You are dropped to a prompt and informed to:
"Give root password for maintenance"
(or type Control-D for normal startup):
So where do we go from here? From the information on the screen we can deduce that the root partition cannot be loaded so "IF" the system had been working before then whoever had been playing with it has changed something in a file that has prevented it from knowing where to load root
If that person is available then the first thing to do is to ask them what files they have been looking at or modifying, we can make an educated guess or do some analysis to see what has been modified?
So lets do just that... issue the root password and you are dropped into a shell command weird as it may look this is an ordinary Bash shell with access to usual commands, this is what I get ....
(Repair filesystem)1#
Lets do the mount command
(Repair filesystem)1# mount <CR>
and we get the following back: /dev/hda1 on / type ext2 (rw)
none on /proc type proc (rw)
now this is misleading because you could assume that the / partition of the first disk is mounted read/write BUT as the boot process failed then the disk is mounted but in single user as read only (as it is only later in the boot sequence that the disks get mounted read write)
So now lets do a bit more analysis .... as you know most of the startup and configuration files in linux live in /etc YES? so lets look there
(Repair filesystem)2# cd /etc; ls -lrt <CR>
This changes us into the etc directory and then does a long listing of the files in an order that shows us what was the most recently modified files and what do we find ? third from bottom is the file "fstab" now isn't this where the mount information is defined? that's suspicious why would have that been modified ? I think we may have found our problem.
So we cat the fstab file and low-and-behold look here someone has hashed out the first line no wonder it can't mount it correctly at boot time.
Ok so all we have to do is vi the file and reboot ? ...........
Oh dear! we cant write the file because it's read only ! so what can we do ?
Ok so here's the quick way ...... No lets leave that for later. Here's the long way and useful instructions for using linux rescue.
What you need is the Linux boot disk and CD-ROM, throw both of them into the PC and reboot (remember what disk you have ?? /dev/hda1 ?).
The system starts from floppy and takes you to the first bootloader, at the prompt type linux rescue <CR>
the system goes off and comes back asking you to choose a language.. do so and <CR>, then prompts you for keyboard type choose and <CR>, you are then informed that you will be taken to a shell and the system will reboot when this shell is terminated <CR>
Now you should be at a prompt, Right POINTS TO REMEMBER we are running a VIRTUAL OS from the CD-Rom the only place that we can write to is /tmp
So lets get to work, what we want to do is mount the hard drive and modify the /etc/fstab file?, so this how we do it:
ext2:> mkdir /tmp/pewe <CR>
ext2:>mount -f ext2 /dev/hda1 /tmp/pewe <CR>
ext2:>cd /tmp/pewe/etc <CR>
ext2:>pcio fstab (modify the file save the file "into its original name" and exit)
ext2:>cd /; reboot (remove the floppy disk & CD-ROM in the process)
Now you will probably find that the system will boot BUT it may stop at the same place and ask for you to run fsck so
(Repair filesystem)1# fsck /dev/hda1 <CR>
and reply YES to the prompts NOW hopefully the system will reboot normally.
Now Here's the quick way, issue the root password then remount the disk read/write modify the file and reboot.
(Repair filesystem)1# mount -o remount,rw / <CR>
(Repair filesystem)2# vi /etc/fstab ...... :wq!
(Repair filesystem)3# init 6 <CR>
Done.
Laurie Baker.