diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-07-08 15:40:30 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-07-08 15:40:30 +0300 |
commit | 06ac0657810477156a74aa002254d426c0e159dc (patch) | |
tree | 3409eecf76aba5c6f024cf60ac7966852b5430d2 /v-i | |
parent | 5b316ce234a1ac5a79d60da0ba4070258789eff2 (diff) | |
download | v-i-06ac0657810477156a74aa002254d426c0e159dc.tar.gz |
fix: if secure blkdiscard fails, try insecure
Sponsored-by: author
Diffstat (limited to 'v-i')
-rwxr-xr-x | v-i | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -131,11 +131,17 @@ def clean_up_disks(drives): for drive in drives: log(f"blkdiscard {drive}") - run( + p = run( ["blkdiscard", "--force", "--secure", drive], - check=True, capture_output=True, ) + if p.returncode != 0: + log("secure blkdiscard failed, trying insecure") + run( + ["blkdiscard", "--force", drive], + check=True, + capture_output=True, + ) def mklabel(device): |