The code and data behind xeiaso.net
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

add note about zvols and lvm

Signed-off-by: Xe Iaso <me@xeiaso.net>

Xe Iaso 09b163d6 07682d65

+49
+5
lume/src/notes/2024/_data.yml
··· 1 + layout: blog.njk 2 + type: blog 3 + index: true 4 + is_note: true 5 + year: 2024
+44
lume/src/notes/2024/delete-zfs-zvol-sometimes.md
··· 1 + --- 2 + title: "How to delete a ZFS zvol when it claims to be busy but you're sure it isn't" 3 + date: 2024-01-05 4 + --- 5 + 6 + Sometimes when you delete ZFS datasets you get this error: 7 + 8 + ``` 9 + $ sudo zfs destroy -rf arsene/vms 10 + cannot destroy 'arsene/vms/oracle-linux-9': dataset is busy 11 + cannot destroy 'arsene/vms/rocky-linux-9': dataset is busy 12 + cannot destroy 'arsene/vms': dataset already exists 13 + ``` 14 + 15 + The "dataset is busy" error is thrown when deleting a zvol if 16 + something has the file open. This can happen with zvols for linux 17 + systems when your kernel's LVM stack is autodetecting the LVM groups 18 + in the zvols. You can confirm this with the `lvdisplay` command: 19 + 20 + ``` 21 + $ lvdisplay 22 + 23 + --- Logical volume --- 24 + LV Path /dev/vg_main/lv_swap 25 + LV Name lv_swap 26 + VG Name vg_main 27 + LV UUID 0phfZx-OYpN-EHUe-11Gs-8fzl-iuwf-jgh9Nl 28 + LV Write Access read/write 29 + LV Creation host, time localhost.localdomain, 2023-05-22 05:50:13 -0400 30 + LV Status NOT available 31 + LV Size 4.00 GiB 32 + Current LE 1024 33 + Segments 1 34 + Allocation inherit 35 + Read ahead sectors auto 36 + ``` 37 + 38 + You can disable them with the `dmsetup` command: 39 + 40 + ``` 41 + $ sudo dmsetup remove -f /dev/vg_main/lv_swap 42 + ``` 43 + 44 + This will let you delete the offending zvols.