Die Funktion muß denke ich angepaßt werden:
Code: Alles auswählen
def getPartitionDevicePath(diskDevice = "", partitionNumber = ""):
# determine if disk.device file is like /dev/cciss/c0d0
# if this device filename is detected, the partition numbers
# has to extend with a p: /dev/cciss/c0d0p1
partitionDevicePath = ''
unixDevicePath = re.compile("c\dd\d").search(diskDevice)
#logger.notice(u"unixDevicePath = %s" % bool(unixDevicePath))
raidDevicePath = re.compile("md\d").search(diskDevice)
#logger.notice(u"raidDevicePath = %s" % bool(unixDevicePath))
nvmeDevicePath = re.compile("nvme\dn\d").search(diskDevice)
mmcDevicePath = re.compile("mmcblk\d").search(diskDevice)
if unixDevicePath:
# extending PartitionNumber with a starting p
partitionDevicePath = "%sp%s" % (diskDevice, partitionNumber)
elif raidDevicePath:
# extending PartitionNumber with a starting p
partitionDevicePath = "%sp%s" % (diskDevice, partitionNumber)
elif nvmeDevicePath:
# extending PartitionNumber with a starting p
partitionDevicePath = "%sp%s" % (diskDevice, partitionNumber)
elif mmcDevicePath:
# extending PartitionNumber with a starting p
partitionDevicePath = "%sp%s" % (diskDevice, partitionNumber)
else:
partitionDevicePath = "%s%s" % (diskDevice, partitionNumber)
#logger.notice(u"partitionDevicePath = %s" % partitionDevicePath)
return partitionDevicePath
EDIT: Hier ist noch das richtige Log:
Code: Alles auswählen
(3341) [6] [Mai 11 09:13:35] Executing: /usr/sbin/sgdisk -p /dev/vda (Posix.py|926)
(3342) [6] [Mai 11 09:13:35] Using encoding 'ANSI_X3.4-1968' (Posix.py|959)
(3343) [7] [Mai 11 09:13:35] >>> Disk /dev/vda: 146800640 sectors, 70.0 GiB (Posix.py|1003)
(3344) [7] [Mai 11 09:13:35] >>> Sector size (logical/physical): 512/512 bytes (Posix.py|1003)
(3345) [7] [Mai 11 09:13:35] >>> Disk identifier (GUID): B3700AD2-24F6-4B12-BB73-1455ACD8BBA4 (Posix.py|1003)
(3346) [7] [Mai 11 09:13:35] >>> Partition table holds up to 128 entries (Posix.py|1003)
(3347) [7] [Mai 11 09:13:35] >>> Main partition table begins at sector 2 and ends at sector 33 (Posix.py|1003)
(3348) [7] [Mai 11 09:13:35] >>> First usable sector is 34, last usable sector is 146800606 (Posix.py|1003)
(3349) [7] [Mai 11 09:13:35] >>> Partitions will be aligned on 2048-sector boundaries (Posix.py|1003)
(3350) [7] [Mai 11 09:13:35] >>> Total free space is 146597820 sectors (69.9 GiB) (Posix.py|1003)
(3351) [7] [Mai 11 09:13:35] >>> (Posix.py|1003)
(3352) [7] [Mai 11 09:13:35] >>> Number Start (sector) End (sector) Size Code Name (Posix.py|1003)
(3353) [7] [Mai 11 09:13:35] >>> 1 2048 204800 99.0 MiB EF00 EFI system partition (Posix.py|1003)
(3354) [7] [Mai 11 09:13:35] Exit code: 0 (Posix.py|1010)
(3355) [5] [Mai 11 09:13:35] Make file system on EFI system partition on /dev/vda1 (opsipreparelib.py|373)
(3356) [6] [Mai 11 09:13:35] Executing: /sbin/mkfs.vfat /dev/vdap1 (Posix.py|926)
(3357) [6] [Mai 11 09:13:35] Using encoding 'ANSI_X3.4-1968' (Posix.py|959)
(3358) [7] [Mai 11 09:13:35] >>> mkfs.fat 4.1 (2017-01-24) (Posix.py|1003)
(3359) [7] [Mai 11 09:13:35] >>> mkfs.vfat: unable to open /dev/vdap1: No such file or directory (Posix.py|1003)
(3360) [7] [Mai 11 09:13:35] Exit code: 1 (Posix.py|1010)
(3361) [2] [Mai 11 09:13:36] Traceback: (Logger.py|798)
(3362) [2] [Mai 11 09:13:36] File "/usr/local/bin/master.py", line 1641, in <module>
(3363) execfile(actionScript)
(3364) (Logger.py|798)
(3365) [2] [Mai 11 09:13:36] File "/tmp/ubuntu.py", line 72, in <module>
(3366) prepareDisk()
(3367) (Logger.py|798)
(3368) [2] [Mai 11 09:13:36] File "/tmp/opsipreparelib.py", line 377, in prepareDisk
(3369) execute('/sbin/mkfs.vfat %sp1' % (disk.device))
(3370) (Logger.py|798)
(3371) [2] [Mai 11 09:13:36] File "/usr/lib/python2.7/dist-packages/OPSI/System/Posix.py", line 1017, in execute
(3372) raise RuntimeError(u"Command '%s' failed (%s):\n%s" % (cmd, exitCode, u'\n'.join(result)))
(3373) (Logger.py|798)
(3374) [2] [Mai 11 09:13:36] ==>>> Command '/sbin/mkfs.vfat /dev/vdap1' failed (1):
(3375) mkfs.fat 4.1 (2017-01-24)
(3376) mkfs.vfat: unable to open /dev/vdap1: No such file or directory (master.py|1693)