LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how exactly surface-fixing "chkdsk /F /R c:" at every single boot for linux? (https://www.linuxquestions.org/questions/linux-general-1/how-exactly-surface-fixing-chkdsk-f-r-c-at-every-single-boot-for-linux-639758/)

frenchn00b 05-04-2008 04:50 AM

how exactly surface-fixing "chkdsk /F /R c:" at every single boot for linux?
 
Hello,
I would like that at every single boot, the linux box does cluster per cluster the typical wonderful windows :

Code:

chkdsk /F /R /dev/hda1

gilead 05-04-2008 02:57 PM

On my Slackware boxes, the boot scripts check for the file /etc/forcefsck - if it exists fsck is run. I'd expect most distros do something like that, but I'm not a Debian user so I don't know specifically what you'd check for.

frenchn00b 05-04-2008 03:54 PM

is
Code:

tune2fs -c 2 /dev/sda1
tune2fs -c 2 /dev/hde2
tune2fs -c 2 /dev/hde6
tune2fs -c 2 /dev/hdf3
tune2fs -c 2 /dev/hdf4

a possibility to check all the drives at boot?
I am so sure it does not only the first when is linux /dev/hde2... and if it is cluster per cluster like does chkdsk for windows

gilead 05-04-2008 04:53 PM

Using -c 2 with tune2fs sets the number of mounts after which the filesystem will be checked by e2fsck to 2. It does not force a check on each re-boot.

I'm not sure what the windows chkdsk does but maybe using something like e2fsck -c to check for bad blocks is the same thing.

In the Slackware boot script /etc/rc.d/rc.S the following is used to test for the check flag:
Code:

if [ -r /etc/forcefsck ]; then
  FORCEFSCK="-f"
fi

The following is used to check the root file system:
Code:

/sbin/fsck $FORCEFSCK -C -a /
This is used to check the others:
Code:

/sbin/fsck $FORCEFSCK -C -R -A -a


All times are GMT -5. The time now is 07:47 AM.