locked
Can I manually create/write a file on the secondary storage drive? RRS feed

  • Question

  • Hi guys, I have a question about manually creating/writing a file on the secondary storage drive. The following is my case.

    I have 2 hard drives. HD1 is the main drive and was mounted as C: (System partition) and D: (Data partition). Before I add HD2 to the server storage pool, it was mounted to E:. After I add HD2 to the server storage pool, logical dirve E: disappeared from Windows Explorer. And the capacity of D: was extended. These are the correct behaviors of DriveExtender.

    My question is, at this point, can I manually create/write a file to HD2? Since it is not mounted to any drive letter, how can I send file I/O to the volume of HD2? Can I create a file by using something like \Device\HarddiskVolume3 as the volume name? How DriveExtender create a file to the secondary storage drive? Thanks.
    • Moved by Ken WarrenModerator Friday, March 12, 2010 12:50 PM development/extension question (From:Windows Home Server Software)
    Friday, March 12, 2010 3:59 AM

All replies

  • If you need to write files to a particular drive attached to your server, don't add that drive to the storage pool. It will be given a drive letter (as you've seen) and you can manually create and manage a share on that drive. Note that this is unsupported; Windows Home Server is not designed to be accessed via the desktop.
    I'm not on the WHS team, I just post a lot. :)
    Friday, March 12, 2010 4:05 AM
    Moderator
  • For sure I can do that before I add HD2 to the storage pool. But this is a requirement of one of my projects. I have to create/write a file to the secondary storage drive after I add it to the storage pool. I am sure there must be a way to implement this. Otherwise how DriveExtender can create/write a file to the secondary storage drive? I suspect that DriveExtender does this by issuing file I/O in kernel mode from DriveExtender FSD, DEFilter.sys. Any guys from MS WHS team can answer my question? Thanks.
    Friday, March 12, 2010 4:16 AM
  • You would then need to look into c:\fs though if you do the wrong thing in here it will generally make a mess.  You should read up on Drive Extender:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=40C6C9CC-B85F-45FE-8C5C-F103C894A5E2&displaylang=en&displaylang=en


    --
    Friday, March 12, 2010 10:33 AM
  • A file system filter driver is how Windows Home Server handles redirection from the reparse points to the real files, which are in other folders (and may be on other drives, but don't have to be). In order to do so, the drives themselves are exposed as mount points on the system drive.

    Perhaps if you would explain what it is you're trying to do we could give you better guidance?
    I'm not on the WHS team, I just post a lot. :)
    Friday, March 12, 2010 12:49 PM
    Moderator
  • Thanks Al and ken for your replies.

    To Ken: What is your meaning when saying "the drives themselves are exposed as mount points on the system drive."? Do you mean that the secondary storage drives are actually mounted to a specific NTFS directory on the system drive?

    Actually this is a full disk encryption project. I use a disk class upper filter (below all file system drivers) to do the encryption/decryption. I want to encrypt HD2 after it is added to the server storage pool. Before the encryption I need to save some of private info on the HD2 volume, such as the key etc. And that is why I want to create/write a file to the secondary storage volume.
    Friday, March 12, 2010 3:16 PM
  • Each secondary drive is mounted to a folder on the C: partition, under the FS folder. There is also a location on the D: partition which may contain files (it's guaranteed to in a single drive server). But (honestly) I would A) probably not proceed, because if you encrypt everything on the drive you will likely make it impossible for an end user to recover data in the event of a server failure (have you considered how you will be affecting the server recovery procedure?), and B) if I did proceed, I would look to handle it transparently to Windows Home Server itself, maybe (off the top of my head) by getting into the API chain that deals with drive formatting somehow.

    If you proceed, I think you should do a lot more reading, including everything you find on the Microsoft Windows Home Server site and the WHS SDK documentation, before you try to go too far. There is a lot that you probably don't know that you need to. You will probably be well served by reverse engineering at least some parts of the product. 

    I'm not on the WHS team, I just post a lot. :)
    Friday, March 12, 2010 3:48 PM
    Moderator
  • Thanks Ken. Yes. I just verified that the secondary drive is mounted to a folder on C:. In my case it is c:\fs\11\.

    Ken, one more question to you. Do you know how I can programmably get the following information? This is the output from mountvol.exe.

        \\?\Volume{fc70e48b-1516-11df-9f9a-806e6f6e6963}\
            C:\

        \\?\Volume{7dea02b2-155f-11df-843b-000c2922bd06}\
            D:\

        \\?\Volume{1d8ea97e-2d33-11df-9ffd-000c2922bd06}\
            C:\fs\11\

    Friday, March 12, 2010 4:15 PM
  • ...
    Ken, one more question to you. Do you know how I can programmably get the following information? 
    ...
    Consult the API documentation (previously linked).
    I'm not on the WHS team, I just post a lot. :)
    Friday, March 12, 2010 4:55 PM
    Moderator