disParity » Bug Reports

Wrong Free Space - Parity Drive mounted in C:\Folder

(14 posts)
  1. dldummy
    Member

    Hi ...

    First thanks for this fine pice of SW.
    I use disParity sice 2 or 3 month and it works fine ...
    I tried some othe Progs like this (FlexRaid, UnRaid,..)
    but they are Limited (UnRAID) or diddnt recognize moved renamed Files like yours.

    But ..

    I mounted my DataDrives (Partitions) under XP as Folders on Drive C:

    C:\HDMEDIA001, C:\HDMEDIA002, ......

    and at first try C:\HDPAITY01 ...

    But this diddent workd .. cause he said im missing free space on Parity Drive ...
    OK its clear as from first sight it is only a folder on Drive C: so your prog take the free space from drive C: , and diddent see that its an mounted Drive with 1TB free space.

    So i mounted the Parity Drive aqs Letter P: so it works ...

    Ok my Question is ... do you know this "Bug" or is it now fixed !?
    The last version i used (and get the Error) was 0.16.
    If you can tell me its fixed or not i dont have to change my System configuration and risk to lose my Parity, to try it.

    Thanks ...

    Sorry for my English .. my German is better ...

    Posted 5 years ago #
  2. Roland
    Roland

    Hi dldummy,

    this is a known issue. disParity is not aware of mounted drives. The fact that different folders on the same logical drive could actually be on different physical drives breaks some assumptions I made while writing disParity. So, I haven't been eager to address this since it could mean re-writing a lot of the code.

    In fact, at the moment I'm not even sure how to detect a mounted drive in .NET. The framework doesn't seem to have any methods I can find for this.

    Posted 5 years ago #
  3. Killroy
    Member

    Is he referring to drives mounted as NTFS folders?

    Posted 5 years ago #
  4. Roland
    Roland

  5. Killroy
    Member

    I have ALL my drives mounted (nested) in NTFS folders on my c:\ drive and they all work fine with disParity.

    My setup is c:\movies\#001 through #031 (as of now) and I have the parity drive at r:\.

    I have no problems with the config file seeing any of the drives as individual drives.

    Posted 5 years ago #
  6. Roland
    Roland

    Maybe the problem really is just limited to the free space check for the parity drive, which won't occur as long as the parity drive gets its own drive letter.

    I'm just worried because I never considered the mounted drive case when I wrote disParity and I wouldn't be surprised if it caused other problems too. But maybe not!

    Posted 5 years ago #
  7. Phatty2x4
    Member

    killroy, how is your config.txt set up then?
    dldummy, how is your config.txt set up then?

    I wonder what the difference between the two are. That might explain why it works with one and not the other.

    Posted 5 years ago #
  8. Killroy
    Member

    Here is what it looks like:

    parity=R:\

    data1=C:\movies\#001
    data2=C:\movies\#002
    data3=C:\movies\#003
    data4=C:\movies\#004
    data5=C:\movies\#005
    data6=C:\movies\#006
    data7=C:\movies\#007
    data8=C:\movies\#008
    data9=C:\movies\#009
    data10=C:\movies\#010
    data11=C:\movies\#011
    data12=C:\movies\#012
    data13=C:\movies\#013
    data14=C:\movies\#014
    data15=C:\movies\#015
    data16=C:\movies\#016
    data17=C:\movies\#017
    data18=C:\movies\#018
    data19=C:\movies\#019
    data20=C:\movies\#020
    data21=C:\movies\#021
    data22=C:\movies\#022
    data23=C:\movies\#023
    data24=C:\movies\#024
    etc.....

    Posted 5 years ago #
  9. Roland
    Roland

    I think it's pretty clear what went wrong for dldummy. He had his parity drive mounted as C:\HDPAITY01. Thinking this was just a regular folder, disParity chcked the C: drive for free space before the update, which in this case was the wrong drive to check. He said he then mounted the drive as P:, and that solved the problem. Killroy always had his parity drive mounted as a regular drive letter (R:) so he never saw the problem in the first place.

    I had originally thought that having the data drives as mounted drives under C:\ would cause additional problems, but now that I've thought about it more, I think this will be okay.

    Posted 5 years ago #
  10. dldummy
    Member

    Yes you are right Roland.

    First i mounted the Parity drive in a folder in C: and it dont worked.

    Then i mounted it as P: and that solved the problem.

    I know that it is not so easy to detect if a folder is mountpoint for a Drive.

    Microsoft himselfe diddent kow it ...
    Try to delete a folder on a under C:\FOLDER moted drive (under XP) ...
    He says you have no rights to delete ...
    Ive searchd a long time until i recogized i have to shift+delete ...
    He tries to MOVE the folder in the trashfolder on C ... and thats not possible from one Drive to another ...

    So i know it is not so easy to detect the right Parity FreeSize BUT ...
    An Option to disabel the FreeSpace for Parity check would help.
    My data Drives are now .. 1TB drives and my Parity is 1,5 TB , i use it only for parity and i dont think that there is a chance that the parity became 1,5 times so big as the data ... and if i Upgrade i by a 2TB Drive use it as Parity and reuse the 1,5TB Drive as Data ... so its safe that i ALWAYS have enoughe Parity Space.

    I dont want to assign Drive letters, its safer too becouse the Data and Parity Drives are somehow hidden. And its Ugly in Future if i have 10 or more Driveletters for Data.

    An option to disable check is faaaaar easier then check the right size (Default=ON).

    For the new version (0.20) i am happy that you integrated the ChecksumTest.
    Its important to test from time to time the Integrity of Data ...
    Drives dont always die from one second to another ... its bad to make a new Parity if you not can be shure that yor files are OK.

    And for the Config.txt ... my one NOW looks somthing like Killroys.
    The old one whitch diddent workd was someting like

    parity=C:\HDMOUNTPOINT\HDPARITY01

    data1=C:\HDMOUNTPOINT\HDMEDIA001
    data2=C:\HDMOUNTPOINT\HDMEDIA002
    ....

    OK in Real its now a little bit more Complicate couse i dont Parity all folders of my Data Drives ...

    I have mounted all my drives (now without the Parity) into C:\HDMOUNTPOINT
    C:\HDMOUNTPOINT\
    HDMEDIA001
    HDMEDIA002
    HDMEDIA003
    (HDPARITY01) im my current Configuration not used, mounted as P:
    ....

    Each Drive Consits of Root Folders like VIDE, AUDIO, FOTO, ...
    These are same on alll Drive so i can easily Jon them together if it is possible sometime in the future. ( IntersectDrive looks like a promising Candidate)

    Then i made hardlinks from the folders on each drive i want to RAID into the following folders (this is much more flexible as RAID direct the mounted drives):
    C:\HDRAID\
    HDRAID001 ... (have hardlinks to Some Folder on HDMEDIA001)
    HDRAID002 ... (have hardlinks to Some Folder on HDMEDIA002)
    HDRAID003 ... (have hardlinks to Some Folder on HDMEDIA003)
    (HDPAITY01) ... not used

    So my real config looks like:

    parity=P:\PARITY\DISPARITY\SET01\
    data1=C:\HDRAID\HDRAID001\
    data2=C:\HDRAID\HDRAID002\
    data3=C:\HDRAID\HDRAID003\

    and at last i have "C:\MEDIASAMMLUNG\", there i made hardlinks from each Category Folder from each Drive ( they are Now named VIDEO01, VIDEO02,...)
    and there are some other Folders wich are not RAID and some External Harddisks with not so important Media, they are all hardlinked into this folders ..
    So i have everything under only one SHARE for access over the Network.
    The share is read only ...

    OK it looks a little bit too complicated but i tried to be so flexible as possible for future Upgrades/Modifications ... so i can ..if i want (and know what i do) the strangest combinations as example join togheter one external HD and one Network share to RAID04 ... why ? i dont see a sense in it ... NOW ... but its possible without breaking my system.

    And thanks for the fast Answer ....
    ... and if possible the Option for one of the next versions !?

    EDITED:
    >>Roland: I'm just worried because I never considered the mounted drive case when I wrote disParity and I wouldn't be surprised if it caused other problems too. But maybe not!

    It works fine ... i diddent recognized other problems ...
    I dont think its a difference .. You handle Files ... nothing else ... so it dont mather for disparity how and where they are as long as you can acsess them and lastModtime work as usual ... or am i wrong !?
    Most of time even widows dont see a difference between them ... ;-)
    Windows diddnt correctly summarize free space too ...

    If you WANT (and have time) to fix the FreeSpace check ....
    .. But as said before its not SO important if you make an Option to disable ...

    I think first you have to check the full path, folder for folder and check each folder if its a real folder or if is an Junction (or how MS name it) ... then you have to get the path for the Partition something like \?\....{GUID} and get the real free space ... you cant use DriveLetters couse you dont have one ...
    Thats the way i think it have too work .... verrrry simply seeen ...

    Posted 5 years ago #
  11. Roland
    Roland

    I'll consider adding this option in the next release, however I think it is going to be a little while before I put out any new versions of disParity.

    Posted 5 years ago #
  12. dldummy
    Member

    Thanks ... for considering it ...
    disparity works ... and as long as do so , its ok for me ...
    if its done (the Option) ... then its done ...

    I did a little bit research on the possiblities to check the real size ....
    I diddnt found an easy way, there is a way to get the list of volume mountpoints over WMI (and so from .NET too) but not for XP only Win2003 Server and up.
    I did some research in registry .. there are some entries but you have to match entries against others by Serialnumber of drive ... i dont think this is a safe and good way ...
    OK and you can use MOUNTVOL in the shell to get the Paths and GUIDs ...

    So i think .. dont even waste your time to think about a way to check the real size.
    But if i find some easy way i tell you ...

    Posted 5 years ago #
  13. dldummy
    Member

    Ok ... i did a little bit more of research ....

    There IS a way to check the REAL free space ...

    I get some Clues for the right way from here http://msdn.microsoft.com/en-us/library/aa363940(VS.85).aspx

    So if you want take a look ...

    Here are some Code samples VB.NET, and VBA seperatly tested ....

    First we need To check if Path is a Mountpoint ....

    There is a Managed NET way - there is an file attribute which named somthing like SPARSE PONT or so ... but i diddent followed that way

    There is a Kernl32 Function named "GetVolumeNameForVolumeMountPoint" which returns the Name of the volumemountpoint which looks like:

    \\?\Volume{127a8f79-9a12-11dd-bab2-001e4f94e955}\

    All Drives / Partitions / Volumes not only the mounted Folders have a name like this (Try at commandline: mountvol)
    A Driveletter is also a Mountpoint, but at Root Level (C:\ or D:\ ...)

    then we take the Parity Path and Test it with the "GetVolumeNameForVolumeMountPoint" Function,
    if we get an empty string back then we strip the last folder from the Path and try it again.

    Until we reach the Root -> then we have a Volume mounted by Driveletter and you use your old way to check Free space.

    If we get something like \\?\Volume... back then we have fonde a mounted Folder and know the MountVolumeGUIDPath.

    At next we have to check the Free Space on the drive but how without Diveletter !?

    GetDiskFreeSpaceEx from also kernl32 do the Job.

    Important is to double the last Backslash at end as example if "GetVolumeNameForVolumeMountPoint" returns

    \\?\Volume{127a8f79-9a12-11dd-bab2-001e4f94e955}\

    then you have to extend it with a \ at the end so you get

    \\?\Volume{127a8f79-9a12-11dd-bab2-001e4f94e955}\\

    This path also works at commandline as example: dir \\?\Volume{127a8f79-9a12-11dd-bab2-001e4f94e955}\\

    by using GetDiskFreeSpaceEx(Drive, lFreeBytesAvailable, lBytesTotal, lFreeBytes)

    where Drive is the "\\?\Volume{GUID}\\" string we get the Free Bytes ... i didnt researchd whats the difference between FreeBytesAvailable and FreeBytes

    So the a little bit of Code To Get the VolumeGUIDPath form Path:

    Private Declare Function GetVolumeNameForVolumeMountPoint Lib "kernel32" Alias "GetVolumeNameForVolumeMountPointA" (ByVal lpszVolumeMountPoint As String, ByVal lpszVolumeName As String, ByVal cchBufferLength As Long) As Long

    Function GetVolumeFromDrive(sVolumeMountPoint As String) As String

    Dim buff As String
    Dim cbbuff As Long

    buff = Space$(1024)
    cbbuff = Len(buff)

    If GetVolumeNameForVolumeMountPoint(sVolumeMountPoint, buff, cbbuff) <> 0 Then
    GetVolumeFromDrive = TrimNull(buff)
    End If

    End Function

    And for the Free Space :

    Declare Auto Function GetDiskFreeSpaceEx Lib "kernel32" (ByVal lpDirectoryName As String, ByRef lpFreeBytesAvailableToCaller As Long, ByRef lpTotalNumberOfBytes As Long, ByRef lpTotalNumberOfFreeBytes As Long) As Long

    Public Function GetFreeSpace(ByVal Drive As String) As Long

    Dim lBytesTotal, lFreeBytes, lFreeBytesAvailable As Long

    Dim iAns As Long

    iAns = GetDiskFreeSpaceEx(Drive, lFreeBytesAvailable, lBytesTotal, lFreeBytes)
    return lFreeBytesAvailable

    End Function

    I diddnt tried both togeter , one i tested in VBA the other is VB.NET code, but i think ist easy to figur out how it works ...

    Another Possiblity to make it more simple is to extend the config file by something like:

    We keep the normal Parity= setting .... you need it to access the Files .... and extend by :

    ParityVolume=\\?\Volume{127a8f79-9a12-11dd-bab2-001e4f94e955}\

    If this Option exist you only have to use the last Funtion to get the free space ...
    If not you use your old way ....
    This Method is a little bit faster and every user can get the VolumeGUID simple by entering mountvol in commandline and copy the string ...

    And ... dont feel forecd by me to implemet this ... its only a suggestion ....

    Posted 5 years ago #
  14. Roland
    Roland

    Thanks for doing the research on this! I'll definitely refer back to the info you posted here when I have time to look into this particular issue more.

    Posted 5 years ago #

RSS feed for this topic

Reply

You must log in to post.