Posix.py: function getHarddisks

Antworten
uncle_scrooge
Beiträge: 650
Registriert: 21 Feb 2012, 12:03
Wohnort: Mainz

Posix.py: function getHarddisks

Beitrag von uncle_scrooge »

Bug? Jein.

Folgende Konstellation:
Server mit zwei FC-HBA.
Redundant angebunden an eine IBM DS4800 (Ja,ja, ich weiß, Heimanwender-SAN).
Dem Server ist SAN-Storage zugewiesen (partitioniert und formatiert).

Das Gemeine an der Sache ist, daß das System ohne entsprechende Treiber das Laufwerk über beide Pfade gleichzeitig sieht, aber nicht wirklich etwas damit anfangen kann.

Das führt dazu, daß die setup.py bei getHarddisks() aussteigt.
Weil der dort genutzte sfdisk völlig verwirrt murmelt: read error on /dev/sdb - cannot read sector 0

Besteht die Möglichkeit, die Funktion umzuschreiben, daß der Fehler von sfdisk abgefangen wird?

Danke und Gruß
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Posix.py: function getHarddisks

Beitrag von n.wenselowski »

Hallo uncle_scrooge,

ich vermute mal du willst den Server per OPSI installieren.
Um welches Produkt handelt es sich und welche Version wird eingesetzt?

Gruß

Code: Alles auswählen

import OPSI
uncle_scrooge
Beiträge: 650
Registriert: 21 Feb 2012, 12:03
Wohnort: Mainz

Re: Posix.py: function getHarddisks

Beitrag von uncle_scrooge »

Hallo Herr Wenselowski.

Vermutung ist richtig ;-)

Produkt ist eigentlich egal, da er im boot image (20130207) aussteigt.

In der o.g. function wird /sbin/sfdisk -s -uB aufgerufen.
Was noch anstandslos funktioniert:
[7] [Jul 03 11:19:17] >>> /dev/sda: 143256576 (Posix.py|742)
[7] [Jul 03 11:19:17] >>> /dev/sdb: 78643200 (Posix.py|742)
[7] [Jul 03 11:19:17] >>> /dev/sdc: 78643200 (Posix.py|742)
[7] [Jul 03 11:19:17] >>> total: 300542976 blocks (Posix.py|742)

Dann werden die gefundenen Laufwerke abgeklappert und hier
hd = Harddisk(dev)
durchgejagt.
Da wiederum wird /sbin/sfdisk -D aufgerufen was zum Abbruch führt:
" | /sbin/sfdisk -D /dev/sdb (Posix.py|661)
[6] [Jul 03 11:19:23] Using encoding 'ANSI_X3.4-1968' (Posix.py|692)
[7] [Jul 03 11:19:38] >>> Checking that no-one is using this disk right now ... (Posix.py|742)
[7] [Jul 03 11:19:38] >>> BLKRRPART: Input/output error (Posix.py|742)
[7] [Jul 03 11:19:38] >>> OK (Posix.py|742)
[7] [Jul 03 11:19:38] >>> (Posix.py|742)
[7] [Jul 03 11:19:38] >>> Disk /dev/sdb: 9790 cylinders, 255 heads, 63 sectors/track (Posix.py|742)
[7] [Jul 03 11:19:38] >>> Old situation: (Posix.py|742)
[7] [Jul 03 11:19:38] >>> New situation: (Posix.py|742)
[7] [Jul 03 11:19:38] >>> Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 (Posix.py|742)
[7] [Jul 03 11:19:38] >>> (Posix.py|742)
[7] [Jul 03 11:19:38] >>> Device Boot Start End #cyls #blocks Id System (Posix.py|742)
[7] [Jul 03 11:19:38] >>> /dev/sdb1 0 - 0 0 0 Empty (Posix.py|742)
[7] [Jul 03 11:19:38] >>> /dev/sdb2 0 - 0 0 0 Empty (Posix.py|742)
[7] [Jul 03 11:19:38] >>> /dev/sdb3 0 - 0 0 0 Empty (Posix.py|742)
[7] [Jul 03 11:19:38] >>> /dev/sdb4 0 - 0 0 0 Empty (Posix.py|742)
[7] [Jul 03 11:19:38] >>> read: Input/output error (Posix.py|742)
[7] [Jul 03 11:19:38] >>> (Posix.py|742)
[7] [Jul 03 11:19:38] >>> sfdisk: read error on /dev/sdb - cannot read sector 0 (Posix.py|742)
[7] [Jul 03 11:19:38] >>> /dev/sdb: unrecognized partition table type (Posix.py|742)
[7] [Jul 03 11:19:38] >>> No partitions found (Posix.py|742)
[7] [Jul 03 11:19:38] >>> Warning: no primary partition is marked bootable (active) (Posix.py|742)
[7] [Jul 03 11:19:38] >>> This does not matter for LILO, but the DOS MBR will not boot this disk. (Posix.py|742)
[7] [Jul 03 11:19:38] >>> Re-reading the partition table ... (Posix.py|742)
[7] [Jul 03 11:19:38] >>> read: Input/output error (Posix.py|742)
[7] [Jul 03 11:19:38] >>> (Posix.py|742)
[7] [Jul 03 11:19:38] >>> sfdisk: read error on /dev/sdb - cannot read sector 0 (Posix.py|742)
[7] [Jul 03 11:19:38] >>> BLKRRPART: Input/output error (Posix.py|742)
[7] [Jul 03 11:19:38] >>> (Posix.py|742)
[7] [Jul 03 11:19:38] >>> If you created or changed a DOS partition, /dev/foo7, say, then use dd(1) (Posix.py|742)
[7] [Jul 03 11:19:38] >>> to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1 (Posix.py|742)
[7] [Jul 03 11:19:38] >>> (See fdisk(8).) (Posix.py|742)
[7] [Jul 03 11:19:38] Exit code: 1 (Posix.py|749)
[2] [Jul 03 11:19:39] Traceback: (Logger.py|742)
[2] [Jul 03 11:19:39] line 1389 in '<module>' in file '/usr/local/bin/master.py' (Logger.py|742)
[2] [Jul 03 11:19:39] line 191 in '<module>' in file '/tmp/setup.py' (Logger.py|742)
[2] [Jul 03 11:19:39] line 780 in 'getHarddisks' in file '/usr/lib/pymodules/python2.6/OPSI/System/Posix.py' (Logger.py|742)
[2] [Jul 03 11:19:39] line 1070 in '__init__' in file '/usr/lib/pymodules/python2.6/OPSI/System/Posix.py' (Logger.py|742)
[2] [Jul 03 11:19:39] line 1199 in 'readPartitionTable' in file '/usr/lib/pymodules/python2.6/OPSI/System/Posix.py' (Logger.py|742)
[2] [Jul 03 11:19:39] line 756 in 'execute' in file '/usr/lib/pymodules/python2.6/OPSI/System/Posix.py' (Logger.py|742)
[2] [Jul 03 11:19:39] ==>>> Command '/bin/echo -e "0,0

Und noch einmal zum Verständnis:
Das Problem rührt von der zweipfadigen Anbindung her.
Ohne entsprechenden Treiber wird das SAN-Volume doppelt präsentiert.
Hier einmal als /dev/sdb und einmal als /dev/sdc.
In diesem Zustand ist kein wirklicher Zugriff möglich. Selbst lesend nicht.
Und das bringt sfdisk aus dem Tritt (ich seh's, aber kann nicht lesen?)

Da wir die Maschinen nicht vom SAN booten, ist das kein ernsthaftes Problem für uns. Wir hängen die SAN-Volumes dann nach der Installation an. Zwar nicht schön, aber nichts was uns umbringt.

Aber wenn Sie mal viel Zeit und Langeweile haben.....
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3319
Registriert: 04 Jun 2008, 14:27

Re: Posix.py: function getHarddisks

Beitrag von d.oertel »

Hi,

interssant aber - das ist so ein typischer Fall für bezahlten Support.
Und ist (glücklicherweise) alles andere als Langweilig ...

gruß
d.oertel
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org
Antworten