rwx/sh/fs/btrfs.sh

76 lines
865 B
Bash
Raw Normal View History

2025-07-06 07:05:55 +02:00
# functions to handle btrfs volumes
#= bfdf
2025-07-27 13:38:22 +02:00
rwx_btrfs_filesystem_d_f() {
btrfs \
filesystem \
df \
"${@}"
}
2025-07-06 07:05:55 +02:00
#= bfdu
2025-07-27 13:38:22 +02:00
rwx_btrfs_filesystem_d_u() {
btrfs \
filesystem \
du \
--summarize \
"${@}"
}
2025-07-06 07:05:55 +02:00
#= bfu
2025-07-27 13:38:22 +02:00
rwx_btrfs_filesystem_usage() {
btrfs \
filesystem \
usage \
"${@}"
}
2025-07-06 07:05:55 +02:00
#= bpg
2025-07-27 13:38:22 +02:00
rwx_btrfs_property_get() {
btrfs \
property \
get \
"${@}"
}
2025-07-06 07:05:55 +02:00
#= bsc
2025-07-27 13:38:22 +02:00
rwx_btrfs_subvolume_create() {
btrfs \
subvolume \
create \
"${@}"
}
2025-07-06 07:05:55 +02:00
#= bsd
2025-07-27 13:38:22 +02:00
rwx_btrfs_subvolume_delete() {
btrfs \
subvolume \
delete \
"${@}"
}
2025-07-06 07:05:55 +02:00
#= bsl
2025-07-27 13:38:22 +02:00
rwx_btrfs_subvolume_list() {
if [ -n "${1}" ]; then
btrfs subvolume list "${1}" |
cut --delimiter " " --fields 9 |
sort
fi
}
2025-07-06 07:05:55 +02:00
#= bss
2025-07-27 13:38:22 +02:00
rwx_btrfs_subvolume_snapshot() {
btrfs \
subvolume \
snapshot \
"${@}"
}
2025-07-06 07:05:55 +02:00
#= bssr
2025-07-27 13:38:22 +02:00
rwx_btrfs_subvolume_snapshot_r() {
btrfs \
subvolume \
snapshot -r \
"${@}"
}