It is possible move a specific file to the beginning of the disk? I want to move my virtual machine disk files (virtual disk) to the beginning of the disk to improve disk access performance. I believe that this is possible because some defragmentation softwares use this technique to move system files to the beginning of the disk. What I want is a practical way (a script or a program) to do the same but moving the files that I choose.
I think the best way is to create a logical disk at the beginning of the separate physical HDD. There are programs that can move existent partitions and create a new one at the beginning of the disk (google for "partition magic free alternatives")
I think you should be able to do that with the scripting feature of MyDefrag. I haven't tried to do what you want, but
AddGap
andMoveDownFill
are possibly among the actions you'd need to take within aFileSelect/FileAction
clause.As Dennis said you can use MyDefrag scripting for this task. Anyway I think you have to move the file to the end of the disk for performance improvement.
Some HDDs first cylinder si in the inner part, so less data stored per rotation, so lower speed on lower cylinders.
Most modern HDD (all that has park heads since i know) use the oposite, the first cylinder is on the outer part, so much more data stored per rotation, so higher speed on outer cylinders.
That is based in the concept that HDD rotates at a constant R.P.M., among not all HDD works like that.
I own a vry expensive HDD that can move each head to a different cylinder at the same time, so can read at same time from different cylinders, and it uses an internal Buffer not of 8MiB or 16MiB, it uses a full GigaByte Buffer. The disk is so fast that a Sata III controller is the one that limits the transfer sustained speed... physical disk could do a 10GiB/s read (from surface to Buffer) and 6GiB/s write (from Buffer to surface).
So the question of where to put files is simple, do a zone speed test (read and write), that way you will know where is better to put files.
Beware there are new HDDs that use another technique to 'fake' such different speed depending on the cylinder... they swap cylinders and heads, so if you ask it to write a whole cylinder it will use only one head and a lot of cylinders, that way the speed is more or less uniform along all the cylinders, so they 'fake' most tools to benchmark speed (speed seems to be constant all along the disk), what is the real is that the disk is storing what external is asked to be done in one cylinder, in multiply cylinders so the speed is (per external asked cylinder): fast, medium, slow
That trick is quite good for sustained performance... if copying a lot of GiB to it, the ETA (estimated time of arrive) is very well calculated, since speed goes as this: fast, medium, slow, fast, medium, slow, ... so the media is constant... but they are really as fast as a normal one... real time to end is quite similar, the difference is that you can calculate better the needed time to finish.
So as i insist, make fine speed tests, then move files to where you want.
And if you do not plan to use HDD in Windows XP or lower, neither on TV's, SetTopBoxes, etc... in other words, where a GPT partition is not understood... it is much better to create a GPT scheme of 20 or more Primary partitions, so you put only and only one file per partition (big files and of course, ones that will not change, like movies), and partition will be filled to 99.99% so no space left... for Virtual machine HDDs, the best is use a Fixed size (not dynamic) and since file will not grow use the same aproach as for movies, etc... i tend to use 20GiB per Windows System partition Virtual HDD.
How to do such thing (make 99.99%) is not easy, but it is easy to follow the steps... create a very small NTFS partition (1/100 the size that is needed) on GPT scheme (this will make a $MFT file to be really very small), defragment it while it is near empty, so $MFT etc will go to start of the partiton, enlarge the partition to the double of what will be needed (this does not change $MFT file size), copy there such file (only one file), defragment it, shrink it to the max so 99.99% is not free, the move it to the part of the disk you want.
It is much better to do such in order, from both sides to the middle, one by one.
Yes, it is too much work... but i do not know any tool that avoid Windows moving a file.
Yes, it is true, i have seen Windows fragmenting a file when such file is not even accesed... in other words, put, move, grow one file and Windows can make any other file on same partition to get fragmented... i had also tried marking at low level (with System account privileges, aka hacking) a non-fragmented file as not moveable, and i saw such file get fragmented while copying from another disk to that parttion a really hde file... yes it sound ridiculus, a non-moveable file that is not fragmented gets fragmented because there is another file written onto same partition... so never ever have a file on a partition with free space and hope it will not ever get fragmented or moved to another part of the partition...
The only trick i saw that works for makeing a file not be moved / fragmented is having it, and only that one, on its own partition... GPT allows a lot of partitions, but not so many (limit i think is 128).
Yes, the big problem, how i access such partitions, if only around 20 letters are free to use... easy, not using letter, using \??\ access.
Here is how, create a shotcut to
start \\?\Volume{...}\
, the{...}
part can be obtained by runningmountvol.exe
without parameters.That is also a very good trick to access partitions on USB strick or MemoryCards... windows only allow to mount (assign a drive letter) the first partition on the partition table... but you can access any of them with that trick, je je, at least that works where i had tested, i have messages from friends telling that they can not; obviously i create such parttion schemes as MBR under Linux with linux fdisk and re-writting the 'master', aka create a new scheme, i never use that one that cames on sticks among they seem a good MBR, i preffer to overwrite it with Linux fdisk tool, then create multiple partitions, format them, etc... with fdisk + mkfs... or with GParted, never ever with Windows (it will not allow you on USB stick / memory cards) and not on all USB sticks can be changed the Removable Bit.
So, use the trick of GPT with very small NTFS, grow to fit double size of file, put the file, shring to the max you can, move partition where you want (between steps defragment it, till step of shrink, after that one no future defragment will be ever needed). That works really great for files that do not change in size, no matter if they are only read or also write (for VirtualBOX not dynamic .VDI file is perfect).
Remember, only one file per NTFS partition is the big trick, creating the NTFS as small as possible is the other trick to make $MFT very small and do not loose/waste space).
The bad part... time to put each file, and access by .lnk (shortcuts) that opens explorer
start \\?\Volume{...}\
instead of having a letter assigned.Not to mention it is better on such NTFS to get rid of "$Recycle.Bin" and "System Volume Information" doing one by one: take owner of it (
takeown /F ... /A /R /D [Y|S|... depends on language]
command, see command parameters on google or by calling it with /?), then delete it (RD /S /Q ...
command), then create a file with Notepad with such name (so size is exactly zero and so they fit inside the $MFT so take no space at all); that way Windows will not be able to re-create such folders, and if you do not want to see the two zero size files, mark them with +R +H +S ussingattrib +R +S +H ...
command, so system will think they are system hidden read-only files and will not be shown on explorer (if hide system files is checked, of course); do not forget such commands must be run in an admin console.Hope now you can, as i can, have files on the part of the disk we want, not where windows want or will want in the future, and ensure they will not get moved nor fragmented never ever again.