mirror of
https://github.com/nix-community/disko.git
synced 2026-01-14 18:28:45 +01:00
10 lines
467 B
Bash
Executable file
10 lines
467 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -efux -o pipefail
|
|
# dependencies: bash jq util-linux lvm2 mdadm zfs gnugrep sed
|
|
disk=$(realpath "$1")
|
|
|
|
lsblk -a -f >&2
|
|
# since we currently cannot recursively deactivate swaps on zfs volumes, we need to deactivate all of them.
|
|
lsblk --output-all --json | jq -r -f "$(dirname "$0")/zfs-swap-deactivate.jq" | bash -x
|
|
lsblk --output-all --json | jq -r --arg disk_to_clear "$disk" -f "$(dirname "$0")/disk-deactivate.jq" | bash -x
|
|
lsblk -a -f >&2
|