diff --git a/ogclient/lib/python3/DiskLib.py b/ogclient/lib/python3/DiskLib.py index dc47b89..4c1b781 100644 --- a/ogclient/lib/python3/DiskLib.py +++ b/ogclient/lib/python3/DiskLib.py @@ -156,6 +156,7 @@ def ogCreatePartitions (disk, parts): return None # Comprobar tamaño numérico y convertir en sectores + ORIG_SIZE = SIZE ## para reportar en un error if 512 == IOSIZE: SIZE *= 2 else: SIZE = (SIZE+3)//4 ## sumamos 3 para que la división entera "redondee al alza" @@ -195,7 +196,7 @@ def ogCreatePartitions (disk, parts): pass ## sin problema, la partición 5 es simplemente una más else: if not EXTSTART: - SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, 'PART==5 and not EXTSTART') + SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, 'la partición 5 es lógica pero no hay ninguna EXTENDED definida antes') return None START = EXTSTART SECTORS = EXTSTART+EXTSIZE @@ -212,7 +213,7 @@ def ogCreatePartitions (disk, parts): # Error si se supera el nº total de sectores. if START > SECTORS: - SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, f'{START//2} > {SECTORS//2}') + SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, f'partición "{TYPE}:{ORIG_SIZE}" no cabe') return None PART += 1 @@ -226,7 +227,8 @@ def ogCreatePartitions (disk, parts): # Si se define partición extendida sin lógicas, crear particion 5 vacía. if 5 == PART and EXTSTART: - sfdisk_input += f'{DISK}5 : start={EXTSTART}, SIZE={EXTSIZE}, type=0\n' + ID = ogTypeToId ('WINDOWS', PTTYPE) + sfdisk_input += f'{DISK}5 : start={EXTSTART}, SIZE={EXTSIZE}, type={ID}\n' # Desmontar los sistemas de archivos del disco antes de realizar las operaciones. FileSystemLib.ogUnmountAll (ND)