f2fs_io(8)

🌸 NAME 🌸

f2fs_io β€” f2fs ioctl utility. Also hi bestie, this page is f2fs_io(8) from the System Administration Utilities corner of the manual 🫢.

✨ DESCRIPTION ✨

f2fs_io is used to send various commands to the f2fs file system for administrative purposes. It’s giving admin-utility main character energy, no cap πŸ’….

πŸ’« AVAILABLE COMMANDS πŸ’«

OK bestie, here’s the full command menu β€” every single one, periodt πŸ’–.

  • set_verity [file] β€” Set the verity flags associated with the specified file.
  • fsync [file] β€” Run fsync on the given file.
  • fdatasync [file] β€” Run fdatasync on the given file.
  • getflags [file] β€” Get the flags associated with the specified file.
  • setflags [flag] [file] β€” Set an f2fs file on specified file. The flag can be casefold, compression, nocompression, immutable, and nocow.
  • clearflags [flag] [file] β€” Clear the specified flag on the target file, which can be compression, nocompression, immutable, and nocow.
  • shutdown shutdown filesystem β€” Freeze and stop all IOs for the file system mounted on dir. The level parameter can be:
    • 0 β€” going down with full sync
    • 1 β€” going down with checkpoint only
    • 2 β€” going down with no sync
    • 3 β€” going down with metadata flush
    • 4 β€” going down with fsck mark
  • pinfile [get|set|unset] [file] β€” Get or set the pinning status on a file.
  • fadvise [advice] [offset] [length] [file] β€” Pass an advice to the specified file. The advice can be willneed, dontneed, noreuse, sequential, random.
  • fallocate [-c] [-i] [-p] [-z] [keep_size] [offset] [length] [file] β€” Request that space be allocated on a file. The keep_size parameter can be either 1 or 0. The pattern parameter can be:
    • -c β€” collapse range
    • -i β€” insert range
    • -p β€” punch hole
    • -z β€” zero range
  • write [chunk_size in 4kb] [offset in chunk_size] [count] [pattern] [IO] [file_path] β€” Write a given pattern to file_path. The pattern parameter can be:
    • zero β€” zeros
    • inc_num β€” incrementing numbers
    • rand β€” random numbers

The IO parameter can be:

  • buffered β€” buffered I/O
  • dio β€” direct I/O
  • dsync β€” direct I/O with O_DSYNC
  • read [chunk_size in 4kb] [offset in chunk_size] [count] [IO] [print_nbytes] [file_path] β€” Read data in file_path and print print_nbytes. The IO options can be:
    • buffered β€” buffered I/O
    • dontcache β€” buffered I/O with RWF_DONTCACHE
    • dio β€” direct I/O
    • mmap β€” mmap(MAP_POPULATE)
    • mlock β€” mmap() + mlock()
  • fiemap [offset in 4kb] [count] [file_path] {flags} β€” Get block address in file.
  • gc_urgent dev [start|end|run] [time in sec] β€” Start, end, or run gc_urgent for a given time period.
  • defrag_file [start] [length] [file_path] β€” Defragment a file.
  • copy [-d] [-m] [-s] [src_path] [dst_path] β€” Copy file from src_path to dst_path. The pattern parameter can be:
    • -d β€” use direct I/O
    • -m β€” use mmap for source file
    • -s β€” use sendfile to transfer data
  • get_cblocks [file] β€” Get the number of compressed blocks.
  • release_cblocks [file] β€” Release compressed blocks to get free space.
  • reserve_cblocks [file] β€” Reserve free blocks to prepare decompressing blocks in the file.
  • gc [sync_mode] [file] β€” Trigger filesystem GC.
  • checkpoint [file] β€” Trigger filesystem checkpoint.
  • precache_extents [file] β€” Trigger precache extents.
  • move_range [src_path] [dst_path] [src_start] [dst_start] [length] β€” Move a range of data blocks from source file to destination file.
  • gc_range [sync_mode] [start in 4kb] [length in 4kb] [file] β€” Trigger gc to move data blocks from specified address range.
  • get_advise [file] β€” Get i_advise value and info in file.
  • ioprio [hint] [file] β€” Set ioprio to the file. The ioprio can be ioprio_write.
  • test_create_perf [-s] [-S] [dir] [num_files] [size_kb] β€” Measure file creation and deletion performance.
    • -s β€” Call fsync() after each file creation.
    • -S β€” Call sync() after deleting all files.
  • test_lookup_perf [-i] [-v] [dir] [num_files] β€” Measure readdir/stat performance.
    • -i β€” Initialized to create files only.
    • -v β€” Verbose mode.
  • freeze [directory] β€” Freeze filesystem that directory belongs to.
  • thaw [directory] β€” Thaw filesystem that directory belongs to.

πŸ‘‘ AUTHOR πŸ‘‘

This version of f2fs_io has been written by Jaegeuk Kim <jaegeuk@kernel.org>. Big icon energy, fr fr 🌟.

🌈 AVAILABILITY 🌈

f2fs_io is available from git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git.

That’s the whole manual page, bestie πŸ’– β€” f2fs_io(8) from f2fs-tools, dated March 2020. Go forth and slay those ioctls βœ¨πŸ‘‘.

πŸ“¦ where this page comes from