Will do. But df -HmP actually wouldn't work. Instead I'll use 'df -PB 10**9', in which case we won't need to divide by 1000.
-Jongki On Mon, Feb 7, 2011 at 11:03 AM, Lucas Meneghel Rodrigues <[email protected]>wrote: > On Mon, 2011-02-07 at 10:55 -0800, Jongki Suwandi wrote: > > Ah, yes, that old confusion. But the problem is df -m reports in > > 2**20 blocks. So if we divide that by 1000, the result is not the > > right GB (10**9 blocks). Calling df -HmP probably would be another > > solution. > > Sounds good to me. Could you send a patch doing that, Jongki? > > Lucas > > > -Jongki > > > > On Mon, Feb 7, 2011 at 3:11 AM, Cleber Rosa <[email protected]> wrote: > > > > On 02/05/2011 07:22 PM, Jongki Suwandi wrote: > > > I noticed Host.check_diskpace() in > > > server/hosts/base_classes.py does this: > > > > > > logging.info('Checking for >= %s GB of space under % > > > s on machine %s', > > > gb, path, self.hostname) > > > df = self.run('df -mP %s | tail -1' % > > > path).stdout.split() > > > free_space_gb = int(df[3])/1000.0 > > > if free_space_gb < gb: > > > raise error.AutoservDiskFullHostError(path, gb, > > > free_space_gb) > > > else: > > > logging.info('Found %s GB >= %s GB of space > > > under %s on machine %s', > > > free_space_gb, gb, path, self.hostname) > > > > > > I just want to confirm before I change it, but isn't that > > > supposed to be 1024 instead of 1000? The difference between > > > those two values might not be much, but it could overinflate > > > the free space by several gigabytes. > > > > > > > > > Jongki, > > > > This is probably due to the fact that one GB is indeed 10**9 > > bytes (and one GiB is 2**30 bytes). > > > > See: http://en.wikipedia.org/wiki/Gibibyte > > > > Cheers. > > > > CR. > > > > > Thanks, > > > -Jongki > > > > > > _______________________________________________ > > > Autotest mailing list > > > [email protected] > > > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest > > > > > > > > _______________________________________________ > > Autotest mailing list > > [email protected] > > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest > > >
_______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
