Jump to content

How to shift all (defragmented) files to the beginning a partition?


thoste

Recommended Posts

I want to shift all files to the beginning of the disk partition. With normal defrag or optimize only defragmentation
took place. But there are still huge space/sector gaps between files after defrag+optimize.

How can I tell Defraggler tool to shift all files without gaps to the partition beginning?

Link to comment
Share on other sites

  • Moderators

Note that none of this should normally be done with a SSD, they work differently to spinning HDDs.
SSDs should be Optimised and not defragmented (or consolidated).

So as long as we are talking about a HDD then:

What you are looking for is the 'Holy Grail' of hard drive consolidation - it can hardly ever be achieved.
You can get close, but there is usually something that Windows says can't be moved. (For example the Windows pagefile stays in a set location on disc, as do some other files).

To try and achieve it though what you need is drive consolidation rather than file defragmentation.
Confusingly although they are different processes and do very different things most people still call both of them 'defragging'.
There are historic reasons for that, in the days when discs had much less capacity than they do now consoildation then was normally what was wanted, so it's what 'defragmenters' did (and still do).
With todays larger capacity drives consolidation is not that important, there is usually plenty of free space so it's more advantageous to have the files in one piece and not to care too much about where they are physically located on the disc.

(PS. You may have noticed that the Windows built in defragmenter/optimiser no longer even shows a 'drive map' of where the files are, that's simply because it's no longer that important where files are on the disc).

So, How to (try and) do it with Defraggler:

By default Defraggler does a mixture of both defragmentation and consolidation as it sees being the best for your drive, but you can make it do either one or the other.

To do a whole disc consolidation of a HDD and attempt to get your files all at the start of the disc/partition what you need is the 'Defrag Freespace' option which can be found on the menu under Action>Advanced.
image.png

Note that there are 2 options there - 'Defrag Freespace' and 'Defrag Freespace (allow fragmentation)'.
The first tries to put all your files in the smallest number of clusters while keeping the files themselves in one piece.
The second one allows files to be packed-in to the available clusters by fragmenting some files to fill up empty space in the clusters - so although you will get them into the least number of clusters that is at the expense of some files being fragmented to fill the clusters completely.

Also note that this process can take a long time, especially if your drive is 500GB or bigger - that's another reason why consolidation is not done much with todays larger capacity drives, it just takes so long.

Again though, having said all that, what you are looking to achieve is something that is rarely ever accomplished.
You may get close with a few runs of 'Defrag Freespace (allow fragmentation)', if you have the time, but there will always be some files that Windows won't allow to be moved.

And also note that as soon as you use your computer the files will start getting fragmented again as Windows and yourself use them.
 

*** Out of Beer Error ->->-> Recovering Memory ***

Worried about 'Tracking Files'? Worried about why some files come back after cleaning? See this link:
https://community.ccleaner.com/topic/52668-tracking-files/?tab=comments#comment-300043

 

Link to comment
Share on other sites

@nukecad:

Thank you for your explanation.

Just one more question:

You talked about "unmovable" files.

Yes, I know.

These are MFT tables and registry files (beside pagefile).

To defragment these some defragmenters offer "Boot time" defragmentation at next reboot which does the job when there is no file lock on these critical sectors/files.

Does Defraggler have such an Option?

I cannot find it.

Maybe users can easily setup such a job by using Task Scheduler?

Do you have *.reg Script which injects a corresponding One-Time Task into Registy?

Thank you

 

Link to comment
Share on other sites

  • Moderators
13 hours ago, thoste said:

Here (Win10) this menu ("Boot time Defrag") is DISABLED (=greyed out).

I've not heard of that happening before, it's available on both of my Win 10 machines.

One thought: Are you using a Windows Admin account? I could see it not being available if you were not a Windows administrator.

Just to note though - I've used Boot Time Defrag in the past to rejoin a pagefile that had become split into two blocks for some reason, but it didn't move the pagefile just defragmented it into one block at the same starting location as previously.
ie. Boot Time Defrag defragments the system files (as it says it will) but it doesn't consolidate the disc; it's the same with the other system files they'll be defragmented but not moved from their original starting locations.
 

*** Out of Beer Error ->->-> Recovering Memory ***

Worried about 'Tracking Files'? Worried about why some files come back after cleaning? See this link:
https://community.ccleaner.com/topic/52668-tracking-files/?tab=comments#comment-300043

 

Link to comment
Share on other sites

  • Moderators
  • Moderators

I think that I see why it's greyed out now - from the look of the drive map I assume that is your 1TB Data drive? (A big clue is that there is no pagefile showing there).

I think that Boot Time Defrag is only available for the boot drive, which has the system files on it.
(Select you Acer drive and BTD should be available for that).

So for the drive shown in that drive map:
I'd first run a 'files only' defrag (Ananlyze>View Files>tick the box at the top of the list>Defrag checked), and then a Defrag Freespace to consolidate the files on the drive.
You appear to have Defraggler set to move 'Large Files' to the end of the drive, there's a big chunk of consolidated files there - so before using Defrag Freespace go into Settings>Options>Defrag Tab and ensure that "Do not move 'Large Files' during Defrag Freespace" is ticked.
Note that doing all that defragmenting/consolidation is going to take time on a 1TB drive.

*** Out of Beer Error ->->-> Recovering Memory ***

Worried about 'Tracking Files'? Worried about why some files come back after cleaning? See this link:
https://community.ccleaner.com/topic/52668-tracking-files/?tab=comments#comment-300043

 

Link to comment
Share on other sites

  • Moderators
5 minutes ago, nukecad said:

I think that I see why it's greyed out now - from the look of the drive map I assume that is your 1TB Data drive? (A big clue is that there is no pagefile showing there).

 

That's why I posted my second link above.

 

Support contact

https://support.ccleaner.com/s/contact-form?language=en_US&form=general

or

support@ccleaner.com

 

Link to comment
Share on other sites

  • Moderators

Sorry, I hadn't seen your post because I was editing mine.

*** Out of Beer Error ->->-> Recovering Memory ***

Worried about 'Tracking Files'? Worried about why some files come back after cleaning? See this link:
https://community.ccleaner.com/topic/52668-tracking-files/?tab=comments#comment-300043

 

Link to comment
Share on other sites

7 hours ago, nukecad said:

I think that I see why it's greyed out now - from the look of the drive map I assume that is your 1TB Data drive? (A big clue is that there is no pagefile showing there).

I think that Boot Time Defrag is only available for the boot drive, which has the system files on it.
(Select you Acer drive and BTD should be available for that).

Good idea, but wrong.

I marked partition C: (with pagefile.sys and swapfile.sys on it) and......menu "Boot Time Defrag" is still disabled.

Maybe it plays a role that partition C: is on a SSD and partition D: on a hard disk?

Moreover it should be possible to boot time defrag partitions with NO pagefile.sys on them.

Think about (at runtime) unmovable MFT tables, or Registry Hive files, or System Volume Information folder (for System Restore Points) or RECYCLE BIN folders or ......

They need to be defragmented at boot time

What other reason could it be for greyed out menu?

Does Defraggler Boot Time Function depend on a (which?) Background Service?

 

How does Defraggler setup a Boot Time Defrag?

Maybe it has insufficient access (write) permissions to Task Scheduler or Registry or startup folder?

In this case Defraggler should show a corresponding warning

 

 

 

 

Link to comment
Share on other sites

  • Moderators

Are you using portable defraggler? It can't do boot defrag iirc

 

ADVICE FOR USING CCleaner'S REGISTRY INTEGRITY SECTION

DON'T JUST CLEAN EVERYTHING THAT'S CHECKED OFF.

Do your Registry Cleaning in small bits (at the very least Check-mark by Check-mark)

ALWAYS BACKUP THE ENTRY, YOU NEVER KNOW WHAT YOU'LL BREAK IF YOU DON'T.

Support at https://support.ccleaner.com/s/?language=en_US

Pro users file a PRIORITY SUPPORT via email support@ccleaner.com

Link to comment
Share on other sites

  • Moderators

Well remembered @Nergal

*** Out of Beer Error ->->-> Recovering Memory ***

Worried about 'Tracking Files'? Worried about why some files come back after cleaning? See this link:
https://community.ccleaner.com/topic/52668-tracking-files/?tab=comments#comment-300043

 

Link to comment
Share on other sites

  • Moderators
7 hours ago, thoste said:

Why is Boot time defrag not possible?

At a guess i would say either because portable doesn't write registry entries or because boot time happens before usb drives are initiated. These are pure conjecture though.

 

ADVICE FOR USING CCleaner'S REGISTRY INTEGRITY SECTION

DON'T JUST CLEAN EVERYTHING THAT'S CHECKED OFF.

Do your Registry Cleaning in small bits (at the very least Check-mark by Check-mark)

ALWAYS BACKUP THE ENTRY, YOU NEVER KNOW WHAT YOU'LL BREAK IF YOU DON'T.

Support at https://support.ccleaner.com/s/?language=en_US

Pro users file a PRIORITY SUPPORT via email support@ccleaner.com

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.