diff options
| author | Xe Iaso <me@xeiaso.net> | 2024-01-05 10:23:54 -0500 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2024-01-05 10:24:03 -0500 |
| commit | 09b163d67901c55387b7e2e198ebfb805ce5ef34 (patch) | |
| tree | 18b9e3a5b8f665a467cccf9a8aa23e785b0252a4 | |
| parent | 07682d65441379d3b68d7b72bac3f151ce61b7bc (diff) | |
| download | xesite-09b163d67901c55387b7e2e198ebfb805ce5ef34.tar.xz xesite-09b163d67901c55387b7e2e198ebfb805ce5ef34.zip | |
add note about zvols and lvm
Signed-off-by: Xe Iaso <me@xeiaso.net>
| -rw-r--r-- | lume/src/notes/2024/_data.yml | 5 | ||||
| -rw-r--r-- | lume/src/notes/2024/delete-zfs-zvol-sometimes.md | 44 |
2 files changed, 49 insertions, 0 deletions
diff --git a/lume/src/notes/2024/_data.yml b/lume/src/notes/2024/_data.yml new file mode 100644 index 0000000..e504f11 --- /dev/null +++ b/lume/src/notes/2024/_data.yml @@ -0,0 +1,5 @@ +layout: blog.njk +type: blog +index: true +is_note: true +year: 2024 diff --git a/lume/src/notes/2024/delete-zfs-zvol-sometimes.md b/lume/src/notes/2024/delete-zfs-zvol-sometimes.md new file mode 100644 index 0000000..3b145cf --- /dev/null +++ b/lume/src/notes/2024/delete-zfs-zvol-sometimes.md @@ -0,0 +1,44 @@ +--- +title: "How to delete a ZFS zvol when it claims to be busy but you're sure it isn't" +date: 2024-01-05 +--- + +Sometimes when you delete ZFS datasets you get this error: + +``` +$ sudo zfs destroy -rf arsene/vms +cannot destroy 'arsene/vms/oracle-linux-9': dataset is busy +cannot destroy 'arsene/vms/rocky-linux-9': dataset is busy +cannot destroy 'arsene/vms': dataset already exists +``` + +The "dataset is busy" error is thrown when deleting a zvol if +something has the file open. This can happen with zvols for linux +systems when your kernel's LVM stack is autodetecting the LVM groups +in the zvols. You can confirm this with the `lvdisplay` command: + +``` +$ lvdisplay + +--- Logical volume --- +LV Path /dev/vg_main/lv_swap +LV Name lv_swap +VG Name vg_main +LV UUID 0phfZx-OYpN-EHUe-11Gs-8fzl-iuwf-jgh9Nl +LV Write Access read/write +LV Creation host, time localhost.localdomain, 2023-05-22 05:50:13 -0400 +LV Status NOT available +LV Size 4.00 GiB +Current LE 1024 +Segments 1 +Allocation inherit +Read ahead sectors auto +``` + +You can disable them with the `dmsetup` command: + +``` +$ sudo dmsetup remove -f /dev/vg_main/lv_swap +``` + +This will let you delete the offending zvols. |
