Tuesday, June 24, 2008

How to Use FSCK???

How do I fsck the root partition of an IDE drive? Resolution:Warning: You should never fsck a mounted filesystem. You will have problems running fsck on a root partition as you will normally need to have the root filesystem mounted to access the fsck application.

Requirements: To begin the troubleshooting process, find out what the root partition is. For IDE drives, your root partition could be /dev/hdaX where X is an integer (e.g. /dev/hda2). Know the major and minor device numbers of your drive as these will be needed later on. Additionally, read and be familiar with the /usr/src/linux/Documentation/devices.txt document.

Solution:
Use installation CD #1 and boot into rescue mode. Boot from CD #1 just like a normal installation. At the installation boot prompt, type:

linux rescue nomountHit Enter and follow the prompts. The nomount option is necessary or else the root partition will be mounted in rescue mode where you cannot unmount it. There is no need to start the network interface. You will be given a minimal shell.

Assume that the root partition is /dev/hda2 for the following example. Create the device /dev/hda which has the major number 3. Execute the following commands:

mknod /dev/hda b 3 0
mknod /dev/hda2 b 3 2
Now you can execute e2fsck on /dev/hda2:

e2fsck /dev/hda2

No comments: