mirror of https://git.48k.eu/ogclient
live: call wipefs if partition or format fails
wipe disk if partition or format fails to leave the disk in consistent state.master
parent
0ca16bc46c
commit
6503d0ffe7
|
@ -528,7 +528,12 @@ class OgLiveOperations:
|
|||
raise OgError(f'Invalid disk number {disk}, {len(get_disks())} disks available.')
|
||||
|
||||
diskname = get_disks()[disk-1]
|
||||
self._partition(diskname, table_type, partlist)
|
||||
try:
|
||||
self._partition(diskname, table_type, partlist)
|
||||
except Exception as e:
|
||||
ret = subprocess.run(['wipefs', '-af', f'/dev/{diskname}'])
|
||||
logging.warning(f'wipefs on /dev/{diskname} after failure for consistency, reports {ret.returncode}')
|
||||
raise
|
||||
|
||||
ret = subprocess.run(['partprobe', f'/dev/{diskname}'])
|
||||
logging.info(f'first partprobe /dev/{diskname} reports {ret.returncode}')
|
||||
|
|
Loading…
Reference in New Issue