Wednesday, 11 December 2013

Having trouble making files contiguous on a USB drive?

Easy2Boot (and many other grub4dos boot drives) require the files on the bootable USB drive to be contiguous for certain features to work.

RMPrepUSB has an option to run WinContig (included in the RMPrepUSB download) using the Ctrl-F2 hotkey in RMPrepUSB to make all the files on the E2B drive contiguous. Sometimes WinContig may fail to make all files contiguous however and this is usually due to the lack of free space available on the drive.

  • In the diagram above, FILE 4 is 1.3GB in size and is not contiguous.
  • Since there is not 1.3GB of contiguous free space on the drive, WinContig cannot copy the FILE 4 to an area of contiguous free space because there is no free space large enough.
  • If you copy a new 1.3GB file to this drive, it will have to occupy the unused free space and so the new file will also be non-contiguous
A nice tool you can use to help you look at the files on the USB drive and understand what is happening is the free Piriform Windows utility Defraggler.

Defraggler also asks if you want to erase the Recycle Bin files when you Analyze or Defrag a drive.

As you can see from the screenshot above, you can select a drive, click Analyze and then immediately see the fragmented files (shown by the red squares). You can then select a red square and Defraggler will list what files are in that block. You can then tick the checkbox next to any of these files and defragment them separately by clicking the 'Defrag checked' button. Nice!

WinContig does not consolidate the unused free space on a drive volume. This means that if there is not a contiguous run of free clusters on the drive, WinContig and Defraggler will not be able to defrag a large file.

However, you can use the Defraggler - Defrag Freespace option to collect all the unused clusters into one or two large blocks. This is a very useful feature and will often fix any WinContig issues you may have (run WinContig afterwards).

Defraggler is not a good tool to use on the whole USB drive however. It attempts to move all the files to the beginning of the drive as well as make them contiguous. This can take a longggg time and is also unnecessary. What is more, if you Stop Defraggler during a defrag operation, it can prevent the drive from being defragged again and prevent WinContig from being able to make all the files contiguous unless you first delete a large file from the USB drive to make more room or use the Defrag Freespace option! So I would advise that you only use Defraggler to defrag single files and don't interrupt it once it has started. If you need to make all files on a drive contiguous use WinContig (or Ctrl+F2 in RMPrepUSB).

P.S. In case you missed it, in a previous blog post, I describe a case where a 6GB ISO could not be copied and then defragged on an empty 8GB USB drive and the reason why this happens.

No comments:

Post a Comment