diff --git a/scripts/wk/clone/ddrescue.py b/scripts/wk/clone/ddrescue.py index 3f31cb6d..43834004 100644 --- a/scripts/wk/clone/ddrescue.py +++ b/scripts/wk/clone/ddrescue.py @@ -226,8 +226,6 @@ def finalize_recovery(state: State, dry_run: bool = True) -> None: return # Run functions - if menu.options['Relocate Backup GPT']['Selected']: - relocate_backup_gpt(state, dry_run=dry_run) if menu.options['Zero-fill Gaps']['Selected']: zero_fill_gaps( state, @@ -235,6 +233,9 @@ def finalize_recovery(state: State, dry_run: bool = True) -> None: dry_run=dry_run, extend_to_end=menu.options['Zero-fill Extra Space']['Selected'], ) + if menu.options['Relocate Backup GPT']['Selected']: + # NOTE: This needs to be run last to avoid corrupting/erasing the backup GPT + relocate_backup_gpt(state, dry_run=dry_run) def is_missing_source_or_destination(state) -> bool: @@ -361,7 +362,6 @@ def relocate_backup_gpt(state: State, dry_run: bool = True) -> None: and state.source.size < state.destination.size and not state.source.parent and str(state.source.raw_details.get('pttype', 'Unknown')).lower() == 'gpt' - and cli.ask('Relocate backup GPT to the end of the device?') ): LOG.warning('Refusing to attempt a backup GPT relocation.') return