Comment 4 for bug 926312

Revision history for this message
Jeff Lane  (bladernr) wrote :

No, you were fine. It DOES work either way:

bladernr@klaatu:~/development/cr3-max-diskspace/scripts$ sudo ./max_diskspace_used /dev/sda
[sudo] password for bladernr:
Checking maximum disk space available on : /dev/sda
Disk space available : 500GB
Disk space used : 254GB
216GB
Difference ( > 0.15 fails ) : 0.0638298

I think the problem was just in how it was handling multiple partitions. I put data in the merge request thread but not this one, but on my system, it was initially showing the same awk traces you saw on my hard drive which is partitioned as so:

Number Start End Size Type File system Flags
 1 32.3kB 41.1MB 41.1MB primary fat16 diag
 2 41.9MB 15.8GB 15.7GB primary ntfs boot
 3 15.8GB 231GB 216GB primary ntfs
 4 231GB 500GB 269GB extended
 5 231GB 489GB 258GB logical ext4
 6 489GB 500GB 10.9GB logical linux-swap(v1)

It was successful on my server box that had a fresh install of Precise server using default partitioning... But now it should handle the more common user scenario where they've done wonky things like I have... granted, in my own defense, Windows did the wonky thing, I just shrunk partition 3 down so I could install Ubuntu way back when...