From d008d693ca16960dc65127b44b9c09384fa08f16 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Sat, 25 Jul 2026 23:57:38 +0200 Subject: 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 --- roles/partition/tasks/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'roles/partition/tasks/main.yml') 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('') }}" -- cgit v1.2.3