Adverts

Every once in a while it is necessary to check your dirves for problems. If you are using ext3 (which I would recommend you do) you can switch drive checking off but it is advisable to check it once in a while anyway. The default is once every 30 boots or 180 days which is pretty good if you have a very stable system.

Should you need to do an emergency drive check for any reason here is the best way I have found to do it.

  1. Shut the computer donw as cleanly as you can. The last time I had to do this the machine wouldn't shutdown so it was the big reset swtich int he sky for it.
  2. When the machine boots run memtest86 on it. This isn't strictly necessary but it only takes a couple of minutes and ensures peace of mind. I have had memory go bad and corrupt a drive so you have been warned.
  3. Assuming the memory test goes well reboot again and at the LILO propmt press the shift key (I forget what you do with Grub but it is similar and IIRC there is a prompt line telling you what to do). This will allow you to pass parameters to the kernel for start up.
  4. Assuming your main kernel image has the boot name linux type "linux emergency" if it has a different name replace the linux part. This will boot you into the the most minimal system possible with your root drive mounted read-only.
  5. Run e2fsck on all your drives. There is no point in skimping and only doing a couple of them. I suggest you use the command "e2fsck -f -y <device>". The -f forces a check even if the drive is marked clean the -y answers yes to all questions. In my experience a drive with one error is likely to have quite a few and a big drive may have thousands. For the vast majority of errors your only option is to say yes so sitting there pressing return is quite pointless.
  6. Once you have checked all your drives (and some may need multiple checks depending on the errors found) you need to reboot. Because you started up with out going through the init scripts (thats one of the things emergency does) you can use the normal shutdown. You have to add and extra flag -n to say don't attempt to go through init on shutdown. Thusly the command you want is "shutdown -r -n now".

Adverts

Donate and Help

Please support this site and
Bandwidth doesn't grow on trees y' know :o)

Adverts

Get Adsense