|
LOL.
It was a challenge. It looked like cool functionality. The
fact that it actually worked when I tapped the API was nice.
I am not positive the change is on the Disk itself, it may
be something within the OS (which I guess eventually gets to the disk). I am
starting to wonder if this is why we saw the results you saw.
Basically the tool locks the volume (or Basic Disk),
dismounts it, modifies the setting for the disk within the OS, then unlocks it.
The next attempt at accessing it forces it to automount.
joe From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael B. Smith Sent: Sunday, August 08, 2004 5:37 PM To: [EMAIL PROTECTED] Subject: RE: [ActiveDir] [OT] NTFS Read-only Status Joe, You just
rock. I have NO idea (other
than the pleasure of a challenge?) that led you to put this much effort in… but
I do appreciate it. So... let me ask you
this – what signals NTFS to know that it has to read the underlying
disk/volume/whatever to know that the file/directory structure has
changed? I’ll be putting this
onto a webfarm tomorrow AM. Thanks, Michael From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of joe New update.
Everything needed is
in the Platform SDK and DDK to do this. The only DDK file needed
is the ntddvol.h header file. I have done it.
Quick notes... Dean
helped me work out why I tapped two volumes instead of one... Both volumes were
on the same physical drive (physical as defined by the OS). This wouldn't have
happened had I been running Dynamic disks though. A dynamic disk will let you do
any single volume, a Basic disk makes you do the whole
disk. This works on FAT and
NTFS volumes. The command line
joeware tool is called WriteProt. You can find it in the usual place... I
am wondering if I should make a GUI version of this.... And if I do, how
much should I charge for it. :o) C:\temp\disktest>writeprot /mviewWriteProt V01.00.00cpp Joe Richards ([EMAIL PROTECTED]) August 2004Volume: C: READ/WRITEVolume: D: READ/WRITEVolume: E: READ/WRITEVolume: F: READ/WRITEVolume: G: READ/WRITEVolume: H: READ/WRITEVolume: I: READ/WRITEVolume: J: READ/WRITEVolume: K: READ/WRITEVolume: L: READ/WRITEVolume: M: READ/WRITEVolume: N: READ/WRITEThe command completed successfully.C:\temp\disktest>writeprot /ro /vol d:WriteProt V01.00.00cpp Joe Richards ([EMAIL PROTECTED]) August 2004Configuring read-only status for volume d:..The command completed successfully.C:\temp\disktest>echo Joe Rocks > d:\joe.txtThe media is write protected.C:\temp\disktest>writeprot /mviewWriteProt V01.00.00cpp Joe Richards ([EMAIL PROTECTED]) August 2004Volume: C: READ/WRITEVolume: D: READ-ONLYVolume: E: READ/WRITEVolume: F: READ/WRITEVolume: G: READ/WRITEVolume: H: READ/WRITEVolume: I: READ/WRITEVolume: J: READ/WRITEVolume: K: READ/WRITEVolume: L: READ/WRITEVolume: M: READ/WRITEVolume: N: READ/WRITEThe command completed successfully.C:\temp\disktest>writeprot /rw /vol d:WriteProt V01.00.00cpp Joe Richards ([EMAIL PROTECTED]) August 2004Configuring read-write status for volume d:..The command completed successfully.C:\temp\disktest>echo Joe Rocks > d:\joe.txtC:\temp\disktest>
joe From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of joe Update on this.
I chatted with Molly a
little more then started playing... As my initial thoughts were ("there might be
something in the DeviceIoControl function that could be leveraged"), there are
some iocontrol codes you can play with and I started playing with them...
Let's just say I have
just recovered my machine from write-protecting two of my volumes (I was
shooting for one empty one but someone also got the 80gb ( with 8GB free) volume
I was running from which had all my crap on it including the program that I was
playing with...). So now the goal is to
see if I can get it to hit just one volume when I say I want one volume and to
see if I can do it safely, my machine was rebooted more in the last 30 minutes
than it has been in the last 12 months... Also no more playing on
my dev machine with this kind of code, only in virtual
sessions.... From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of joe Chat with your SAN
people and see if they can somehow have it report the volume as read only.
Sounds like earlier versions of the OS would be say no-way jose and refuse top
mount, but XP/K3 should be ok with it. From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of That was what I wanted.
:-) I'm building web farms
on top of a couple of SANs. I want to share static data as
read-only. From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of joe I bugged Molly.
Extremely nice person. :o) The VSS driver
underlying the file system is doing it. The driver tells the file system the
volume is read only and as mentioned below about the I/O Subsystem enhancement
when the file system sees that, it mounts as read-only instead of failing to
mount. So sounds like this
would be a heavy duty exercise for an arbitrary volume.
Now if this was through
a SAN though... I would wonder if you could have the SAN tell the OS the volume
is read-only and the OS would be ok with it...
joe From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of It was Molly Brown’s
posts that led me to believe it was possible. To
wit: http://www.osronline.com/lists_archive/ntfsd/thread1636.html
(message 7 in thread) and others by
her… Dan Lovinger (danlo)
also has a number of posts on the topic and says it’s documented in the “IFS
Kit” (and while I can presume what IFS means, I’m certainly not up to
writing a filesystem for this purpose). I guess it’s just over
my head and not generally available at this time. I’m not well enough
connected to bug the folks you mention. Thanks for your
reply. From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of joe This one had me poking
around as this would be interesting functionality. I found one hit in the
newsgroups from a Molly Brown (mollybro) saying it is possible and a one liner
in MSDN around I/O Subsystem enhancements . "NTFS will
now mount read-only on an underlying read-only volume. If the volume requires a
log restart or a Chkdsk, the mount will fail." That would seem to mean
to me that it will do it automatically if the volume itself is somehow read only
through the hardware versus failing to mount at all.
Otherwise I
looked at the obvious candidates for doing that like fsutil and mountvol
and see nothing. The root api that I am aware of is SetVolumeMountPoint and it
doesn't have way to specify optional params like that...
http://msdn.microsoft.com/library/default.asp?url=""> Possibly there is
something in the Shadow Copy API which MS is hiding from normal people at
the moment, you have to be an ISV (and under NDA) to see them or alternatively,
there might be something in the DeviceIoControl function that could be
leveraged. I will admit to not messing around in that area at all. Might be a
good question to send to Solomon or Russinovich...
joe From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of I've tried this on other groups, and
it is not A/D related. But you guys know so
much... I want a way to mount an NTFS volume
read-only. I want a magic command like "mode e: read-only".
:-) It is clear to me (and I've found
references) that this is supported with NTFS (Windows XP and above), but I
cannot figure out/find out how to set it. Any
ideas? Thanks, Michael |
- RE: [ActiveDir] [OT] NTFS Read-only Status Narkinsky, Brian
- RE: [ActiveDir] [OT] NTFS Read-only Status Michael B. Smith
- RE: [ActiveDir] [OT] NTFS Read-only Status Michael B. Smith
- RE: [ActiveDir] [OT] NTFS Read-only Status Brian Desmond
- RE: [ActiveDir] [OT] NTFS Read-only Status Michael B. Smith
- RE: [ActiveDir] [OT] NTFS Read-only Status Michael B. Smith
