Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > file fragmentation project

Reply
Thread Tools

file fragmentation project

 
 
Bart Nessux
Guest
Posts: n/a
 
      06-02-2004
Python may not be suitable for this, but I thought I'd ask the experts:

I'm doing a summer project that will attempt to measure exactly how file
fragmentation affects disk drive and OS performance. I'd like to use
Python for some of this. In particular, I'd like to write a file
fragmentor in Python that will randomly fragment x% of files on a NTFS
filesystem into y number of fragments. For example, assuming that we
start with a 100% defragmented drive, run the program to randomly
fragment 20% of the drive's files into 7 different fragments (may also
base the number of fragments on the file's size).

Anyway, would Python be acceptable for this type of project? Speed is
somewhat important, but not extremely.

All comments and advice are welcomed.

Bart
 
Reply With Quote
 
 
 
 
Kirk Strauser
Guest
Posts: n/a
 
      06-02-2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 2004-06-02T21:10:02Z, Bart Nessux <(E-Mail Removed)> writes:

> In particular, I'd like to write a file fragmentor in Python that will
> randomly fragment x% of files on a NTFS filesystem into y number of
> fragments.


You may or may not be able to do so, depending on how smart your exact
version of NTFS decides to be on that given day. Still, the standard
algorithm to fragment a file m bytes long into n pieces is:

1) Create n * 2 files, each (m/n) bytes long.
2) Delete every other file.
3) Write the file to be fragmented, and hope that the filesystem naively
shoves it into the empty holes.
4) Delete the remaining "pad" files.

A similar algorithm is to replace step 1 with:

1) Fill the entire drive with files (m/n) bytes long.

If the filesystem isn't smart enough to rearrange empty blocks, then that
should to the trick.

> Anyway, would Python be acceptable for this type of project? Speed is
> somewhat important, but not extremely.


You bet. Filesystem speed will be the limiting factor.
- --
Kirk Strauser
The Strauser Group
Open. Solutions. Simple.
http://www.strausergroup.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAvky35sRg+Y0CpvERAkm9AKCOeYJZ3aEbgcFERo8Iy5 dxAKD6aQCeMWEO
bnwx/bkTjkWo+JE/pCrMjvU=
=CmhE
-----END PGP SIGNATURE-----
 
Reply With Quote
 
 
 
 
Bart Nessux
Guest
Posts: n/a
 
      06-03-2004
Thanks for the advice Kirk, I appreciate it.

Kirk Strauser wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> At 2004-06-02T21:10:02Z, Bart Nessux <(E-Mail Removed)> writes:
>
>
>>In particular, I'd like to write a file fragmentor in Python that will
>>randomly fragment x% of files on a NTFS filesystem into y number of
>>fragments.

>
>
> You may or may not be able to do so, depending on how smart your exact
> version of NTFS decides to be on that given day. Still, the standard
> algorithm to fragment a file m bytes long into n pieces is:
>
> 1) Create n * 2 files, each (m/n) bytes long.
> 2) Delete every other file.
> 3) Write the file to be fragmented, and hope that the filesystem naively
> shoves it into the empty holes.
> 4) Delete the remaining "pad" files.
>
> A similar algorithm is to replace step 1 with:
>
> 1) Fill the entire drive with files (m/n) bytes long.
>
> If the filesystem isn't smart enough to rearrange empty blocks, then that
> should to the trick.
>
>
>>Anyway, would Python be acceptable for this type of project? Speed is
>>somewhat important, but not extremely.

>
>
> You bet. Filesystem speed will be the limiting factor.
> - --
> Kirk Strauser
> The Strauser Group
> Open. Solutions. Simple.
> http://www.strausergroup.com/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
>
> iD8DBQFAvky35sRg+Y0CpvERAkm9AKCOeYJZ3aEbgcFERo8Iy5 dxAKD6aQCeMWEO
> bnwx/bkTjkWo+JE/pCrMjvU=
> =CmhE
> -----END PGP SIGNATURE-----

 
Reply With Quote
 
JanC
Guest
Posts: n/a
 
      06-06-2004
Bart Nessux <(E-Mail Removed)> schreef:

> Python may not be suitable for this, but I thought I'd ask the experts:
>
> I'm doing a summer project that will attempt to measure exactly how file
> fragmentation affects disk drive and OS performance. I'd like to use
> Python for some of this. In particular, I'd like to write a file
> fragmentor in Python that will randomly fragment x% of files on a NTFS
> filesystem into y number of fragments. For example, assuming that we
> start with a 100% defragmented drive, run the program to randomly
> fragment 20% of the drive's files into 7 different fragments (may also
> base the number of fragments on the file's size).
>
> Anyway, would Python be acceptable for this type of project? Speed is
> somewhat important, but not extremely.
>
> All comments and advice are welcomed.


Read this: <http://www.sysinternals.com/ntw2k/info/defrag.shtml>

--
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Will memory upgrade help my SOHO77 fragmentation problems? Arnoud Helmantel Cisco 13 10-18-2004 06:57 PM
packet fragmentation with ipsec users edward Cisco 0 06-29-2004 10:25 AM
The proper size of ping packet (is fragmentation allowed) Yang Jun Cisco 6 12-20-2003 01:42 PM
Re: tough question: MTU Path discovery , IPsec, VPN, Pre-fragmentation. Nick Bailey Cisco 0 10-20-2003 07:57 PM
l2tp fragmentation prob mac Cisco 1 07-12-2003 02:20 PM



Advertisments