Expand description
§Subvolume and snapshot management: creating, deleting, and querying subvolumes
Subvolumes are independently snapshotable subtrees within a btrfs filesystem. Snapshots are subvolumes created as copy-on-write clones of an existing subvolume. This module covers the full lifecycle: creating and deleting subvolumes and snapshots, reading subvolume metadata and flags, listing all subvolumes in a filesystem, and getting or setting the default subvolume that is mounted when no subvolume is explicitly requested.
Structs§
- Subvolume
Flags - Flags on a btrfs subvolume (the
flagsfield of the root item /BTRFS_IOC_SUBVOL_{GET,SET}FLAGS). - Subvolume
Info - Subvolume metadata returned by
BTRFS_IOC_GET_SUBVOL_INFO. - Subvolume
List Item - A single subvolume entry returned by
subvolume_list.
Constants§
- FS_
TREE_ OBJECTID - The top-level subvolume (FS tree); objectid 5, always present.
Functions§
- snapshot_
create - Create a snapshot of the subvolume referred to by
source_fd, placing it asnameinside the directory referred to byparent_fd. - subvolume_
create - Create a new subvolume named
nameinside the directory referred to byparent_fd. - subvolume_
default_ get - Query the ID of the default subvolume of the filesystem referred to by
fd. - subvolume_
default_ set - Set the default subvolume of the filesystem referred to by
fdtosubvolid. - subvolume_
delete - Delete the subvolume or snapshot named
namefrom the directory referred to byparent_fd. - subvolume_
flags_ get - Read the flags of the subvolume that
fdbelongs to. - subvolume_
flags_ set - Set the flags of the subvolume that
fdbelongs to. - subvolume_
info - Query detailed information about the subvolume that
fdbelongs to. - subvolume_
list - List all user subvolumes and snapshots in the filesystem referred to by
fdby walking the root tree.