Skip to main content

Module subvolume

Module subvolume 

Source
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§

SubvolumeFlags
Flags on a btrfs subvolume (the flags field of the root item / BTRFS_IOC_SUBVOL_{GET,SET}FLAGS).
SubvolumeInfo
Subvolume metadata returned by BTRFS_IOC_GET_SUBVOL_INFO.
SubvolumeListItem
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 as name inside the directory referred to by parent_fd.
subvolume_create
Create a new subvolume named name inside the directory referred to by parent_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 fd to subvolid.
subvolume_delete
Delete the subvolume or snapshot named name from the directory referred to by parent_fd.
subvolume_flags_get
Read the flags of the subvolume that fd belongs to.
subvolume_flags_set
Set the flags of the subvolume that fd belongs to.
subvolume_info
Query detailed information about the subvolume that fd belongs to.
subvolume_list
List all user subvolumes and snapshots in the filesystem referred to by fd by walking the root tree.