3

I have a 4Gb FAT32 usb stick that I use to boot several iso images using grub4dos. Any iso image I add turns as contiguous however there is one iso that no matter what I do it always show up as non-contiguous. This image is the largest from the stick, having almost 300mb.

I tried moving it from hdd to stick and everytime is the same result: from hdd -- file is contiguous but from usb -- file not contiguous.

Tried WinContig to defragment the stick and it says no fragments found. Even if they are fragments, none of them are this iso image.

What can I do?

6
  • 3
    Does it matter? Fragmentation affects flash memory very little, since it doesn't actually need to seek from one place to another, unlike magnetical media. May 11, 2012 at 20:00
  • 1
    Yes, it matter because if a file is not contiguous then grub4dos or any other loader cannot boot from it. May 11, 2012 at 20:03
  • @grawity: IIRC, ISO images will not work when they are fragmented. It's been a while I read up about this, so I cannot remember the details. I use a separate USB flash drive for ISO images, which I do not do anything else with, for this reason.
    – paradroid
    May 11, 2012 at 20:04
  • deleted my answer, did not know that grub4dos was that picky ;)
    – Baarn
    May 11, 2012 at 20:21
  • Does it always fragment, even if you rename the old image and add a new copy behind it?
    – ott--
    May 11, 2012 at 20:58

3 Answers 3

2

I don't think it is a good idea to use a defragmenter on a flash drive, as it will continuously keep on moving data and wearing the drive out while it is working.

If the images no longer work, I think the easiest solution would be to just make the ISO compilation drive again, which you could do overnight, as it takes a long time in my experience.

I use XBoot to do this.

XBoot

5
  • The images works fine from the hdd. grub loads it without problems. But when rying to load it from the stick it gives me the non-contiguous problem. Also reformatted the drive and copied the images to it, same problem. Could the unit size allocation be the cause? May 11, 2012 at 20:11
  • @AlexanderCeed: Yes, which is why you need to rebuild it again, as I said in my answer. If you use XBoot you only need to drag and drop the ISO images, press 'Create USB' and come back a few hours later.
    – paradroid
    May 11, 2012 at 20:14
  • @AlexanderCeed: If you say the files are no longer contiguous, that is the problem. Rebuild the drive.
    – paradroid
    May 11, 2012 at 20:14
  • It worked, thank you! For the future, whenever i will remove/add/edit stuff on the drive, i'll need to repeat the procedure (format and re-copy everything)? May 12, 2012 at 20:41
  • @AlexanderCeed: I think I read somewhere that you do need to, but I am not entirely sure. I do not change the ISO images on my multi-boot flash drive very often, so when I do, I do rebuild the whole drive, just to make sure that it does work when I need to use it. You can try changing images to see if it still works, and you can always rebuild it again if it fails. Cheers.
    – paradroid
    May 12, 2012 at 22:09
3

I've used Contig, a command line tool to make an iso contiguous on a ufd for grub4dos to map correctly

http://technet.microsoft.com/en-gb/sysinternals/bb897428.aspx

1
  • Nice. I had the same problem as the querent, and this solved it in a few minutes and with less disk writes and a full rebuild would have entailed. Raises a UI point, in that many defrag tools won't insist on all files being contiguous (excessive) and/or allow defragging of USBs (generally more harm than good), but this shows a case where a "I really know what I'm doing" option pays off.
    – Jon Hanna
    Oct 8, 2014 at 22:14
0

You can do this in linux with rsync:

rsync --preallocate /path/to/source/file /path/to/destination/

With that flag, rysnc preallocates a contiguous block of storage and copies the file into it. Works for FAT too.

Just make sure the file does not already exist at the destination, or rsync won't reallocate and re-copy it. If it is, delete it, Empty Trash to make sure it's really gone, then run this command.

You can then verify if it copied contiguously:

filefrag /path/to/destination/file

"1 extent found" means the file is contiguous. More than one means it's fragmented.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .