Question about the code...
Paul Lussier
pll at lanminds.com
Wed Jun 12 19:47:32 CEST 2002
In Fai.pm, the following code segment
exists:
sub read_disk_info {
# disk_info set variables containing the information
my ($size,$bytes_per_block);
$bytes_per_block= 1024; # should be constant for /proc/partitions;\
# must be proofed !
while ($ENV{device_size}=~ /(\S+)\s+(\d+)/g) {
my ($device,$blocks) = ($1,$2);
$numdisks++;
push @devicelist,$device;
$blocks{$device} = $blocks;
$size = $blocks{$device} * $bytes_per_block / (1024*1024) ;
$sum_disk_size += $size;
$disksize{$device} = $size;
}
}
This code is called from class/S07disk.pl as:
read_disk_info();
When called, there is nothing passed to it, so there is no $_ for the
'while' look to operate on, therefore $ENV{device_size} remains
undefined, which therefore prevents that 'while' loop from doing
anything useful.
Should read_disk_info() be passed some parameter? What exactly is
this sub supposed to be doing?
I tried defining my S07disk.pl as:
($numdisks == 4) and
disksize(hda,70000,90000) and
disksize(hdb,70000,90000) and
disksize(hdc,70000,90000) and
disksize(hdd,70000,90000) and
class("80GB_NODE");
since I have 4 80GB drives in my client systems. disk_config/
80GB_NODE is defined as:
disk_config hda
primary /boot 128 rw ;-m 1 -j ext3
primary swap 500 sw ;
logical / 500 defaults,errors=remount-ro ;-m 1 -j ext3
logical /usr 5000 rw ;-m 1 -j ext3
logical /var 5000 rw ;-m 1 -j ext3
logical /spare 67031 rw ;-m 1 -j ext3
disk_config hdb
primary - 80000 ;
disk_config hdc
primary - 80000 ;
disk_config hdd
primary - 80000 ;
disk_config md0
primary /huge 160000-;reiser
but this doesn't seem to have any effect, since S07disk.pl never
results in any output.
Anyone have any ideas where I messed up?
Thanks!
--
Seeya,
Paul
----
It may look like I'm just sitting here doing nothing,
but I'm really actively waiting for all my problems to go away.
If you're not having fun, you're not doing it right!
More information about the linux-fai
mailing list