How to run scandisk automatically

This howto is valid if your FREESCO is installed on a FAT or FAT32 partition only, so if you're using an EXT2 install, you cannot use this!

Sometimes you might find that you router is in read-only mode, after a power failure for instance.
The solution to fix this is to run scandisk 1) on the hard drive to return to a read/write file system.
However doing this manually every time on the router can be complicated (for instance if you have no monitor connected, or the router is in a distant place), so here is a solution that you can apply to do this automatically :


Boot your FREESCO to DOS and at the C:\> prompt create a CONFIG.SYS similar to this:

MENUITEM = FREESCO, Start FREESCO, normal mode
MENUITEM = Setup, Start FREESCO, setup mode
MENUITEM = Debug, Start FREESCO, debug mode
MENUITEM = Shell, Start FREESCO, shell mode


Prepare autoexec.bat

Your autoexec.bat should look like this:

@echo off



router.bat setup

router.bat debug

router.bat shell


Now boot your FREESCO using the new menu.

Finishing up

Make 2 copies of router.bat
name one router.faild
and one
For instance at the console type :

cd /mnt/bootdev/router
cp router.bat router.faild
cp router.bat

edit router.faild with :

edit router.faild

and add this line first :

scandisk /autofix /nosummary

Then edit rc_user, with :

edit /rc/rc_user

and in the start section (find this line) :

start) echo -n "Starting rc_user...                       "

add this line after :

cp /mnt/bootdev/router.faild /mnt/bootdev/router.bat

and a litlle further down the file search for (stop section) :

stop) echo -n "Stopping rc_user...                       "

and add this line after :

cp /mnt/bootdev/ /mnt/bootdev/router.bat

finally save the file with <alt+x>, y

This way if the router shuts down eg by power out or if the filesystem is readonly scandisk will run the next time you reboot your router and not every time you reboot. this to minemise the boot time if nothing is wrong with the filesystem.

1) scandisk must be installed on the hard-drive for this howto…
freesco/howtos/how-to_automatically_run_scandisk.txt (54653 views) · Last modified: 2007/01/20 21:27 (external edit)
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki