LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   I cannot do fsck. Why is that? Repairing Linux ext2 or ext3 file system (https://www.linuxquestions.org/questions/linux-general-1/i-cannot-do-fsck-why-is-that-repairing-linux-ext2-or-ext3-file-system-562424/)

LinuxCrazy 06-17-2007 08:59 AM

I cannot do fsck. Why is that? Repairing Linux ext2 or ext3 file system
 
I found this great tutorial on repairing my ext3 file system.
http://www.cyberciti.biz/tips/repair...le-system.html

The only problem is I don't know while file system I should unmount?


[root@localhost ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hdc2 152696708 1433536 143506592 1% /
/dev/hdc1 101086 11291 84576 12% /boot
none 387788 0 387788 0% /dev/shm

Brian1 06-17-2007 09:32 AM

Type the command ' /bin/mount ' and see the filesystems each mount has. Then of course the partition to be fixed needs to be unmonted. From the looks if /dev/hdc2 requires fixing then you will need to boot with a bootable linux floppy, live cd, or live usb with fsck tools on it.

Brian

LinuxCrazy 06-17-2007 01:55 PM

Quote:

Originally Posted by Brian1
Type the command ' /bin/mount ' and see the filesystems each mount has. Then of course the partition to be fixed needs to be unmonted. From the looks if /dev/hdc2 requires fixing then you will need to boot with a bootable linux floppy, live cd, or live usb with fsck tools on it.

Brian


so I can never run a fix on the / without the live cd?
While I can always run a fix on /boot without the cd?

makuyl 06-17-2007 02:14 PM

If you reboot with "shutdown -F -r now" the -F forces a fsck on the bootup.

EDIT: btw, if your / line in /etc/fstab ends with a "1" as in:
"/dev/hdb1 / ext3 defaults,errors=remount-ro 0 1"
fsck runs automagically on that partition every n mounts, usually 30. You can adjust the amount with tune2fs, see "man tune2fs" for information.

Brian1 06-18-2007 03:42 PM

I need to read my man pages more often. Never knew that option for shutdown. Thanks for the info.

Brian

makuyl 06-18-2007 04:01 PM

No problem, and from the shutdown man page:
Quote:

The -F flag means `force fsck'. This only creates an advisory file /forcefsck which can be tested by the system when it comes up again. The boot rc file can test if this file is present, and decide to run fsck(1) with a special `force' flag so that even properly unmounted filesystems get checked. After that, the boot process should remove /forcefsck.
So basically you can do the same thing with:
Code:

touch /forcefsck
shutdown -r now

If it for some obscure reason won't remove that file and continues to run fsck on bootup, just rm the file.


All times are GMT -5. The time now is 02:53 AM.