mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-24 00:00:19 +03:00
37 lines
669 B
Bash
37 lines
669 B
Bash
|
#!/usr/bin/env bash
|
||
|
set -euxo pipefail
|
||
|
|
||
|
blkdev="/dev/vdb"
|
||
|
mnt="/tmp/mnt"
|
||
|
uuid=$(uuidgen)
|
||
|
|
||
|
bcachefs format \
|
||
|
--verbose \
|
||
|
--uuid "$uuid" \
|
||
|
--fs_label test-fs \
|
||
|
"$blkdev"
|
||
|
|
||
|
udevadm settle
|
||
|
|
||
|
mkdir -p "$mnt"
|
||
|
mount "$blkdev" "$mnt"
|
||
|
|
||
|
touch "$mnt/file1"
|
||
|
|
||
|
bcachefs subvolume create "$mnt/subvol1"
|
||
|
bcachefs subvolume delete "$mnt/subvol1"
|
||
|
|
||
|
(
|
||
|
cd "$mnt"
|
||
|
|
||
|
bcachefs subvolume create subvol1
|
||
|
bcachefs subvolume create subvol1/subvol1
|
||
|
bcachefs subvolume create subvol1/subvol2
|
||
|
touch subvol1/file1
|
||
|
|
||
|
rm subvol1/file1
|
||
|
bcachefs subvolume delete subvol1/subvol2
|
||
|
bcachefs subvolume delete subvol1/subvol1
|
||
|
bcachefs subvolume delete subvol1
|
||
|
)
|