diff options
| author | Ahmed Abdelhalim <[email protected]> | 2026-07-25 23:57:38 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2026-07-25 23:57:38 +0200 |
| commit | d008d693ca16960dc65127b44b9c09384fa08f16 (patch) | |
| tree | 3f97f333cfa6d98b732ff7386b37db00dc2849e6 | |
| parent | 4b3822a44b604894a0b02c057bf2f811b2096c04 (diff) | |
Fix repeated umount failures from leftover arch-chroot bind mounts
If a previous bootstrap run fails mid-chroot, /dev, /proc, /sys, and
/run stay bind-mounted under the root partition's mount path. Those
aren't tracked in partition_list, so the per-partition unmount loop
never touches them and fails with "target is busy" on every retry.
Co-Authored-By: Claude.ai
| -rw-r--r-- | roles/partition/tasks/main.yml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/roles/partition/tasks/main.yml b/roles/partition/tasks/main.yml index e044578..8c5c512 100644 --- a/roles/partition/tasks/main.yml +++ b/roles/partition/tasks/main.yml @@ -30,6 +30,15 @@ failed_when: false when: partition_swap.dev is defined +- name: "Ensure chroot bind mounts are unmounted" + # arch-chroot bind-mounts /dev, /proc, /sys, /run into partition_root.mount_path. + # If a previous bootstrap run failed mid-chroot, these are left mounted and + # block unmounting the root partition below with "target is busy". + ansible.builtin.command: + cmd: "umount -R {{ partition_root.mount_path }}" + changed_when: true + failed_when: false + - name: "Ensure partitions are not mounted" ansible.posix.mount: path: "{{ item.mount_path | default('') }}" |
