PDA

View Full Version : Script to increase MFT allocation size



mbucari1
03-06-2008, 10:20 PM
Ok, I wrote this script to increase the allocation size of window's Master File Table. It's useful to have a buffer in the MFT so that it won't fragment as easily. A fragmented MFT leeds to slower file access time. If you've just formated a Hard Drive and want to give your new MFT a buffer, or want to keep your OS disk running fast, give this a try :)

Copy the script and paste it into a text file.
Save it as something.bat.
Run the batch file.
You will be asked by how much you want to increase the MFT. For system drives I'd suggest ~50000. Storage Drives I'd suggest 100000 if you plan for MANY small files or 30000 if you plan for fewer large files.




@echo off
set /p input="Enter Size of desired MFT padding in KB "
cls
set percent=%input%
set /a percent/=100
set c=1
mkdir mft
cd mft
:s
set /a n+=1
echo. > %n%
if %n%==%input% goto e
set x=%percent%
set /a x*=%c%
if %n%==%x% goto math
goto s
:math
cls
echo %c%%% Complete
set /a c+=1
goto s
:e
cd ..
rmdir mft /s /q

peat moss
03-07-2008, 02:20 AM
Did n't Diskeeper use to have this option ? I don't see it in the latest version 2008 . I think its controlled by Frag Shield now . It was one of the first things I did after installing tho .

I'd like to try this mbucari1 on a clean install just for shits and giggles , thank you . :)


Oh great now I have that Iron Butterfly tune running thru my head ......:yup:

mbucari1
03-07-2008, 03:31 AM
Did n't Diskeeper use to have this option ? I don't see it in the latest version 2008 . I think its controlled by Frag Shield now . It was one of the first things I did after installing tho .

I'd like to try this mbucari1 on a clean install just for shits and giggles , thank you . :)


Oh great now I have that Iron Butterfly tune running thru my head ......:yup:
Hope it works well for ya. Don'tcha know that I'll always be true, PM?

hdogg
02-13-2009, 12:08 AM
Great stuff mbucari1. I never would have thought to modify MFT in this manner.

I modified your original script slightly as I was making a 6.5GB MFT (i.e. 6.5 million files) and explorer/system didn't like that many files in one folder when I went to rename the folder (long story). So I decided to create a new folder whenever it reached 50000 files.

@echo off
set /p input="Enter Size of desired MFT padding in KB: "
cls
md mft
cd mft
set /a fc=1
set /a n=1
call :mkdir

:s
echo. > %n%
set /a percent=%n%*100/%input%
cls
echo %percent%%% Complete
if %n%==%input% goto :end
set /a n+=1
set /a c+=1
if %c%==50000 call :mkdir
goto :s

:mkdir
cd %~dp0
md mft%fc%
cd mft%fc%
set /a fc+=1
set /a c=0
goto :eof

:end
cd %~dp0
pause
for /D %%a in (%~dp0\mft*) do rd /s /q %%a