Jump to content











Photo
- - - - -

How can I re-order files on an NTFS volume?


  • Please log in to reply
2 replies to this topic

#1 steve6375

steve6375

    Platinum Member

  • Developer
  • 7027 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 20 January 2016 - 03:12 PM

I have two contiguous files on an NTFS USB drive - fileA and fileB.

 

I need to ensure that the start address of fileA always precedes the start address of fileB.

 

Any ideas on the best way to do this?

 

Ideally, I don't want to affect the position of any other files already on the NTFS volume. It would also be nice to keep them contiguous too (but I can run WinContig afterwards if required).

 

Currently, I have a batch file which renames and copies fileB and then checks it's position. If it is not past fileA then I loop again and repeat the fileB copy process. If this does not work within 100 passes, I re-copy both files to the same volume and then run the fileB loop again.

 

This seems to work, but it is quite slow and disk intensive.

 

P.S. fileA is usually quite large - e.g. 2GB-8GB, fileB is smaller, approx 40MB-200MB.

 

 



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14910 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 January 2016 - 06:13 PM

My guess is that the "right" way is to *somehow* interface with Ultradefrag:

http://ultradefrag.s...roup__Move.html

 

Or maybe easier find a way to use Mydefrag "Zones" and "Placement", see:

http://www.hofmannc....mdsc/howto.html

 

The web site for mydefrag is currently unavailable from here :w00t::

http://www.mydefrag.com/

 

 

What happens when a sparse file is created?

Maybe one can create a few sparse files and then overwrite two of them (found in the "right" order) with the contents of "fileA" and "fileB". :dubbio: (but a subsequent "contig" operation may possibly change the initial position? :unsure:)

 

What I would try however (provided that the volume is "new" or "built in the process") would be:

1. create a volume with just enough space on it to contain FileA

2. copy to it FileA

3. if needed defrag the volume/contig the file

4. extend the volume size to "full size"

5. copy to it FileB

 

:duff:

Wonko



#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 7027 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 20 January 2016 - 08:44 PM

Thanks for the reply.

The volume is already created with files on it, so I cannot mess with resizing partitions, etc.

Not to sure about the ultradefrag stuff... looks tricky.. :dubbio:






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users