Quote:
Originally posted by 60cents
I forced a shutdown of FC3 the other day and now I can't get it to boot.
I get a message that says system shut down uncleanly
checking root filesystem
followed by
Inexpected inconsistency, fun fsck manually
That says failed
then it says an error occurred during the file system check
dropping you to a shell, the system will reboot when you leave the shell
Thanks
|
OK, No Problemo. Piece of cake.
Prepare yourself for an introductory course of Physical Hacking (don't do this on other peoples machines).
First of all get a LiveCD like Knoppix, Ubuntu or the one which you find most appealing (it really doesn't matter much as least as they have a complete distro in it).
In case you don't have a way of burning/getting such a live CD your FC install CD 1 will also help saving the day. What you have to do in this case is booting from the CDROM as if you where going to install again. Hit F2 and look for a boot option called "Rescue". Normally it's just this "rescue". Once found out which, simply type it on the prompt:
But for now let's go back to the LiveCD.
If you have booted from the LiveCD you will get straight into the graphical interface. No problem with this, but in order to keep it simple and explain the things so that it's the same if you use a LiveCD or the rescue kernel on your FC install CD I will explain how to do it from a console.
So if you are using a LiveCD and are inside the graphical environment, jump out of it to a console with this key sequence:
CTRL+ALT+F1. Note that you can choose among 6 consoles. You can select which using the function keys F1-F6.
OK, now you are in the so-called TTY-mode or 'console', and we are also root at no cost. This is why I told this was a way of physical hacking as you can do it on any machine able to boot from the CDROM.
What you need now is a list of your hardisk's partitions. With this command you will get the correct partitions and filter out unnecessary stuff:
Code:
fdisk -l | grep Linux | grep -v swap | gawk '{ print $1 }'
What you see here is a list of partitions you must repair. As we don't know which are OK and which not, we will check them all.
To check and repair an EXT3 or EXT2 filesystem we need to use
e2fsck. As I'm more or less convinced that you are using the default filesystem type, I will stick on it (I can't also remember all of them right now).
So what you need to do is:
Code:
e2fsck -vaf /dev/hdXY
Where XY are the letters and numbers you got with the fdisk -l program above.
So run the program once for each partition and watch the result.
It could happen that e2fsck complains about the journal telling you that it should be replayed.
What you have to do is mounting and unmounting the drive again:
Code:
mount -t ext3 -o rw /dev/hdXY
umount /d/ev/hdXY
Once all the filesystems are ready we need an extra step to ensure everything is OK. What we are going to do now is changing the root password on your distro for the case you forgot to set it. The first thing you need to know is where your root partition resides. As an example I will use /dev/hda2, but remember to change it to your own root partition. First of all we need to know where to mount it. LiveCD's have a special place to put it all, it's called /mnt. Rescue systems have nothing inside /mnt, so let's first create a mount point:
Now we need to mount the root partition:
Code:
mount -t ext3 -o rw /dev/hda2 /mnt/rescue
And now the magic: We will turn /mnt/rescue into your old partition on the hardisk so we can work as if we were in the normal OS:
Code:
chroot /mnt/rescue /bin/bash
OK, we are now ready to repair stuff or wreak havoc if we were bad guys. Let us change the password. Of course it's not necessary that you literally change it, we are just going to ensure that everything works, so you can use the same password you already used.
This command says that you will change root's passwd. It's not necessary to pass him the user name, as you are root. But if you would like you can use it in this way:
After issuing the command the program will ask you for the new password twice. That's all, no security measure, no asking for your older password. Nothing. So be careful.
So, that's all. You can now reboot and enter your distro w/o problems. Keep this procedure in mind. EXT3 filesystem doesn't need much attention and does not fragment (the same as NTFS). But it's a good idea to check it if you experience power failures.
Things which can go wrong:
* It's possible that the partitions on your harddrive are already mounted. The solution is to simply unmount them:
* If your keyboard is not US, you will need to set the keymap:
where XY is your ISO countrycode: es, de, fr...
* E2fsck can report bad blocks. This can also be repaired, but it will take some good amount of time:
Code:
e2fsck -ckv /dev/hdXY
c checks for bad blocks,
k writes to the current badblock list (the default one in this case) and
v stays for 'verbose'.
I hope this helps. If you have any more trouble just tell us.