none
DIR /S difference in file size same folder

    Question

  • We are encountering something strange on our Windows 2008R2 servers.
    When we do a DIR /S to a network share in quick succession, the file size from some folders differs between 2 of the results.

    Here's an example, all the file sizes of the individual files are the same.
    But when you look at the total size of TestDIr1 you can see a difference in the bytes:

    C:\>dir /s z:
     Volume in drive Z has no label.
     Volume Serial Number is 1A4E-101A

     Directory of Z:\

    28.02.2014  16:16    <DIR>          .
    28.02.2014  16:16    <DIR>          ..
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (2) - Kopie - Kopie - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (2) - Kopie - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (2) - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (2).log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (3) - Kopie - Kopie - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (3) - Kopie - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (3) - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (4) - Kopie - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (4) - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (5) - Kopie - Kopie.log
    28.02.2014  16:16    <DIR>          TestDIr1
                  10 File(s)         62.550 bytes

     Directory of Z:\TestDIr1

    28.02.2014  16:16    <DIR>          .
    28.02.2014  16:16    <DIR>          ..
    12.06.2013  05:19             6.255 10138 - AVIS20130612.log
    13.06.2013  05:20             6.255 10138 - AVIS20130613.log
    14.06.2013  05:21             6.255 10138 - AVIS20130614.log
                   3 File(s)         18.765 bytes

         Total Files Listed:
                  13 File(s)         81.315 bytes
                   5 Dir(s)  16.070.938.624 bytes free

    C:\>dir /s z:
     Volume in drive Z has no label.
     Volume Serial Number is 1A4E-101A

     Directory of Z:\

    28.02.2014  16:16    <DIR>          .
    28.02.2014  16:16    <DIR>          ..
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (2) - Kopie - Kopie - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (2) - Kopie - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (2) - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (2).log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (3) - Kopie - Kopie - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (3) - Kopie - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (3) - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (4) - Kopie - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (4) - Kopie.log
    12.06.2013  05:19             6.255 10138 - AVIS20130612 - Copy (5) - Kopie - Kopie.log
    28.02.2014  16:16    <DIR>          TestDIr1
                  10 File(s)         66.646 bytes

     Directory of Z:\TestDIr1

    28.02.2014  16:16    <DIR>          .
    28.02.2014  16:16    <DIR>          ..
    12.06.2013  05:19             6.255 10138 - AVIS20130612.log
    13.06.2013  05:20             6.255 10138 - AVIS20130613.log
    14.06.2013  05:21             6.255 10138 - AVIS20130614.log
                   3 File(s)         18.765 bytes

         Total Files Listed:
                  13 File(s)         85.411 bytes
                   5 Dir(s)  16.070.938.624 bytes free
                   
                   
    If we do the same from a server running 2008R2 to a network share on a sever running 2003R2 there's no difference in the file size.
    Also locally on the 2008R2 there's no difference.

    Does anybody know what can explain this behavior?
    Thursday, April 10, 2014 8:55 AM

Answers

  • Hi Hendrik,

    Please check if there is any log file still being written to, and you can also start Windows powershell cmdlet to list all folder and file size on windows server 2008 R2:

    dir z: -Recurse
    
    # calculate the folder total size
    dir z: -Recurse |Measure-Object -Sum Length

    Best Regards,

    Anna

    Sunday, April 13, 2014 6:09 AM