How to Make a Contiguos File UnMovable.

Hello Gurus,
How can i make a File Unmovable from a position on the disk.
For example I have a File which is at a offset say 2000 on the Disk.
The File is 170 sectors long.
I position the File into contiguos sectors using Defrag APIs.
But i want to retain the File in the same sectors.
I also marked the File as System Hidden and Read only just to be cautious.
But i have seen 1 in 50 machines wherein the File moves to a different
location on the Disk.
To add to surprise the File gets moved exactly in contiguos mode as it was
originally on the disk.
Is it because of Disk Defrag? would Disk Defrag process move Contiguos
files.
I would like to get some Ideas from you.
Shud the Sectors be marked Bad for it to make it unmovable or is there any
other alternative?
Thanks for ur help.
Regards
Shal.

Doubts.

MS does not have the notion of “unmovable”, so, this notion is only
supported by particular defrag tool. So, this notion depends on defrag tool,
and files unmovable by one tool (say - Windows native) will be movable by
another (say - Symantec).

Nevertheless, SYSTEM bit in file attributes can be a good starting point.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Shalini”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Thursday, January 19, 2006 8:34 PM
Subject: [ntfsd] How to Make a Contiguos File UnMovable.

> Hello Gurus,
> How can i make a File Unmovable from a position on the disk.
> For example I have a File which is at a offset say 2000 on the Disk.
> The File is 170 sectors long.
> I position the File into contiguos sectors using Defrag APIs.
> But i want to retain the File in the same sectors.
> I also marked the File as System Hidden and Read only just to be cautious.
> But i have seen 1 in 50 machines wherein the File moves to a different
> location on the Disk.
> To add to surprise the File gets moved exactly in contiguos mode as it was
> originally on the disk.
> Is it because of Disk Defrag? would Disk Defrag process move Contiguos
> files.
> I would like to get some Ideas from you.
> Shud the Sectors be marked Bad for it to make it unmovable or is there any
> other alternative?
> Thanks for ur help.
> Regards
> Shal.
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

You might try FSCTL_MARK_HANDLE w/ MARK_HANDLE_PROTECT_CLUSTERS but the docs
say that only protects from the defrag api so YMMV.

  • Jeremy Boschen

“Shalini” wrote in message news:xxxxx@ntfsd…
> Hello Gurus,
> How can i make a File Unmovable from a position on the disk.
> For example I have a File which is at a offset say 2000 on the Disk.
> The File is 170 sectors long.
> I position the File into contiguos sectors using Defrag APIs.
> But i want to retain the File in the same sectors.
> I also marked the File as System Hidden and Read only just to be cautious.
> But i have seen 1 in 50 machines wherein the File moves to a different
> location on the Disk.
> To add to surprise the File gets moved exactly in contiguos mode as it was
> originally on the disk.
> Is it because of Disk Defrag? would Disk Defrag process move Contiguos
> files.
> I would like to get some Ideas from you.
> Shud the Sectors be marked Bad for it to make it unmovable or is there any
> other alternative?
> Thanks for ur help.
> Regards
> Shal.
>
>

I think that cyanoacrylate adhesive might do the trick as well.

The point people are making that the OP might be missing is that much of
this depends upon WHAT type of usage he’s trying to protect against.
Maybe he’s just trying to make sure there’s no defrag and that’s enough.
Maybe he’s concerned that someone will take the drive and plug it into a
different machine (in which case my solution works better.)

Not to pick on this particular poster, but often people ask what they
think are simple problems and are then confounded when they get no
answer or strangely qualified answers. (ergo, my recent rash of “reboot”
answers to “how do I purge the cache”.)

Perhaps we need some sort of “before you post” FAQ.

Personally, I prefer hyde glues - they have better resonance
characteristics, but I don’t know that it would matter when injected
into a hard disk drive.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Boschen
Sent: Thursday, January 19, 2006 10:23 PM
To: ntfsd redirect
Subject: Re:[ntfsd] How to Make a Contiguos File UnMovable.

You might try FSCTL_MARK_HANDLE w/ MARK_HANDLE_PROTECT_CLUSTERS but the
docs
say that only protects from the defrag api so YMMV.

  • Jeremy Boschen

“Shalini” wrote in message news:xxxxx@ntfsd…
> Hello Gurus,
> How can i make a File Unmovable from a position on the disk.
> For example I have a File which is at a offset say 2000 on the Disk.
> The File is 170 sectors long.
> I position the File into contiguos sectors using Defrag APIs.
> But i want to retain the File in the same sectors.
> I also marked the File as System Hidden and Read only just to be
cautious.
> But i have seen 1 in 50 machines wherein the File moves to a different

> location on the Disk.
> To add to surprise the File gets moved exactly in contiguos mode as it
was
> originally on the disk.
> Is it because of Disk Defrag? would Disk Defrag process move Contiguos

> files.
> I would like to get some Ideas from you.
> Shud the Sectors be marked Bad for it to make it unmovable or is there
any
> other alternative?
> Thanks for ur help.
> Regards
> Shal.
>
>


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com