Skip to main content

subvolume_delete

Function subvolume_delete 

Source
pub fn subvolume_delete(parent_fd: BorrowedFd<'_>, name: &CStr) -> Result<()>
Expand description

Delete the subvolume or snapshot named name from the directory referred to by parent_fd.

name must be a plain leaf name (no slashes). Requires CAP_SYS_ADMIN.

Deletion is asynchronous: the ioctl removes the directory entry immediately, but the kernel cleaner thread reclaims the on-disk data in the background. Until the next transaction commit the deletion is not visible to other operations (e.g. subvolume_list still shows the subvolume). Call sync to force a commit, or pass -c/--commit-after at the CLI level. To wait for the cleaner to finish, use subvol_sync_wait_one.