[ug-bosug] Some info requested
Sriram Narayanan
sriramnrn at gmail.com
Wed Jun 14 12:13:12 PDT 2006
Hi :
Here's a Perl script that I tried, and which reports an incorrect
partition size. I've used code from /usr/foss/lib/site_perl/disk.pm
use lib "/usr/foss/lib/site_perl";
use disk;
my $diskdrive = "c0d0";
my @diskDimensions = getDiskDimensions("c0d0");
print STDOUT @diskDimensions;
my $bytes_sector = shift(@diskDimensions);
print STDOUT "\n bytes/sector : " ;
print STDOUT $bytes_sector;
my $sectorstart = getSectorstart($diskdrive);
print STDOUT "\n sector start : " ;
print STDOUT $sectorstart ;
my $sectorcount = getSectorcount($diskdrive, $sectorstart);
print STDOUT "\n sector count : " ;
print STDOUT $sectorcount ;
my $partitionsize = ($sectorcount - $sectorstart)*($bytes_sector)/(1024*1024);
print STDOUT "\n partition size : " ;
print STDOUT $partitionsize ;
====================
51216065
bytes/sector : 512
sector start : 48195
sector count : 11631060
partition size : 5655.69580078125
==================
As you see above, the partition size is calculated at some 5655 MB.
However, I've created via fdisk an approx 20 GB partition.
Is there something wrong with these calculations ? Or is the prtvtoc
tool reporting incorrect values ?
My OS is Belenix 0.4.3a
-- Sriram
More information about the ug-bosug
mailing list