Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

fsfreeze

Suspend or resume access to a filesystem.

Synopsis

fsfreeze --freeze <mountpoint>
fsfreeze --unfreeze <mountpoint>

Operation

  • --freeze: Suspends all new writes to the filesystem, flushes all dirty data/metadata/log to disk, and blocks any process that attempts to write until unfrozen. Uses the FIFREEZE ioctl.
  • --unfreeze: Resumes normal filesystem operations and unblocks waiting writers. Uses the FITHAW ioctl.

Inputs

  • <mountpoint> — path to a mounted filesystem directory

Outputs

None. The tool operates purely via ioctls on the mountpoint.

Syscalls / ioctls

ioctlValueDescription
FIFREEZE0xc0045877Freeze filesystem (halt writes, flush to disk)
FITHAW0xc0045878Thaw (unfreeze) filesystem

Both ioctls take an int argument of 0.

Command-line options

OptionDescription
-f, --freezeFreeze the filesystem
-u, --unfreezeUnfreeze the filesystem
-h, --helpDisplay help
-V, --versionDisplay version

Exactly one of --freeze or --unfreeze must be specified.

Exit codes

CodeMeaning
0Success
1Failure (permission denied, not a mountpoint, ioctl error)

Permissions

Requires root privileges.

Supported filesystems

btrfs, ext2/3/4, f2fs, jfs, nilfs2, reiserfs, xfs.

Notes

  • The filesystem must be mounted.
  • Device-mapper (LVM) automatically freezes/thaws on snapshot creation; manual freeze is unnecessary.
  • Useful for creating consistent backups of the underlying block device.