Problems with setup_harddisks

Brian Sutherland jinty at web.de
Thu Jul 22 23:36:47 CEST 2004


I would like to know what crazy thing I am doing that I have
to modify my setup_harddisks so that it only gets the partition
tables of one disk at a time and not all in the beginning (patch
below, quick hack to get things working and I have never
programmed before in perl, so don't shoot me).

Basically a fai install dies with:

parsing config file: /fai/disk_config/SMALL_SCSI (see below)
ERROR: could not read device /dev/sda
setup_harddisks did not create /tmp/fai/disk_var.sh file

I think that the problem is that sfdisk(v3.07) doesn't like to
be called without an destination disk parameter when there are no
ide hard disks...

At least for me, 
#sfdisk -d -q 

produces this error on my vmware virtual machine with 1 IDE cdrom
(bootable made with some help from fai-bootcd) and 1 SCSI hdd:

sfdisk: ERROR: sector 0 does not have an msdos signature
 /dev/hda: unrecognised partition
No partitions found

with the patch below, this disappears and all goes well.

More generally, wouldn't it be more robust only to get to info for
the partitions we intend to do something with? i.e. only the
partitions in the relevant disk_config/* file. That way unforseen
things with other partitions can be avoided.

Thanks,

Brian


SMALL_SCSI:

disk_config sda
primary  /             50-200      rw,errors=remount-ro ;-c -j ext3
logical  swap          50-500      rw                   
logical  /var          50-1000     rw                   ; -m 5  -j ext3
logical  /tmp          50-1000     rw                   ;-m 0 -j ext3
logical  /usr          300-4000    rw                   ; -j ext3
logical  /home         50-4000     rw,nosuid            ;-m 1 -j ext3

PATCH:

Index: setup_harddisks
===================================================================
RCS file: /cvs/debian-boot/fai/scripts/setup_harddisks,v
retrieving revision 1.34
diff -r1.34 setup_harddisks
232d231
< &GetAllDisks;
258,259c257,258
< sub GetAllDisks{
<     my $line=""; my $disk=""; my $device=""; my $rest; my $result; my $divi;
---
> sub GetOneDisk{
>     my $line=""; my($disk)=@_; my $device=""; my $rest; my $result; my $divi;
261c260
<     $result = `sh -c "LC_ALL=C sfdisk -g -q"`;
---
>     $result = `sh -c "LC_ALL=C sfdisk -g -q /dev/$disk"`;
271c270
<     $result = `sh -c "LC_ALL=C sfdisk -d -q"`;
---
>     $result = `sh -c "LC_ALL=C sfdisk -d -q /dev/$disk"`;
351a351
> 		   &GetOneDisk($disk);



More information about the linux-fai mailing list