Adding a check to see if the disk contains a parition table already. has_partitions() TBI

This commit is contained in:
Anton Hvornum 2021-02-07 12:34:39 +01:00
parent 3e261c4033
commit a618ebd611
1 changed files with 9 additions and 0 deletions

View File

@ -104,6 +104,15 @@ while (disk_password := getpass.getpass(prompt='Enter disk encryption password (
archinstall.storage['_guided']['disk_encryption'] = True
break
archinstall.storage['_guided']['harddrive'] = harddrive
print(harddrive)
if archinstall.has_partitions(harddrive):
archinstall.log(f" ! {harddrive} contains existing partitions", fg='red')
if (option := input('Do you wish to keep existing partition setup or format the entire disk? (k/f): ')).lower() in ('k', 'keep'):
print("We're keeping it!")
else:
print('Formatting woop woop!')
exit(1)
# Ask for a hostname
hostname = input('Desired hostname for the installation: ')