File: show_orphaned_subvols.py

package info (click to toggle)
python-btrfs 15-1
  • links: PTS
  • area: main
  • in suites: sid, trixie
  • size: 620 kB
  • sloc: python: 4,772; makefile: 195
file content (11 lines) | stat: -rwxr-xr-x 216 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/python3

import btrfs
import sys

if len(sys.argv) < 2:
    print("Usage: {} <mountpoint>".format(sys.argv[0]))
    sys.exit(1)

with btrfs.FileSystem(sys.argv[1]) as fs:
    print(fs.orphan_subvol_ids())