1f2fs_io(8) System Administration Utilities f2fs_io(8)
2
3
4
6 f2fs_io - f2fs ioctl utility
7
9 f2fs_io is used to send various commands to the f2fs file system for
10 administrative purposes.
11
13 set_verity [file]
14 Set the verity flags associated with the specified file.
15
16 getflags [file]
17 Get the flags associated with the specified file.
18
19 setflags [flag] [file]
20 Set an f2fs file on specified file. The flag can be casefold,
21 compression, and nocompression.
22
23 shutdown shutdown filesystem
24 Freeze and stop all IOs for the file system mounted on dir. The
25 level parameter can be:
26
27 0 going down with full sync
28
29 1 going down with checkpoint only
30
31 2 going down with no sync
32
33 3 going down with metadata flush
34
35 4 going down with fsck mark
36
37 pinfile [get|set] [file]
38 Get or set the pinning status on a file.
39
40 fallocate [keep_size] [offset] [length] [file]
41 Request that space be allocated on a file. The keep_size param‐
42 eter can be either 1 or 0.
43
44 write [chunk_size in 4kb] [offset in chunk_size] [count] [pattern] [IO]
45 [file_path]
46 Write a given pattern to file_path. The pattern parameter can
47 be:
48
49 zero zeros
50
51 inc_num
52 incrementing numbers
53
54 rand random numbers
55
56 The IO parameter can be:
57
58 buffered
59 buffered I/O
60
61 dio direct I/O
62
63 dsync direct I/O with O_DSYNC
64
65 read [chunk_size in 4kb] [offset in chunk_size] [count] [IO]
66 [print_nbytes] [file_path]
67 Read data in file_path and print print_nbytes. The IO options
68 can be:
69
70 buffered
71 buffered I/O
72
73 dio direct I/O
74
75 fiemap [offset in 4kb] [count] [file_path]
76 get block address in file
77
78 gc_urgent dev [start|end|run] [time in sec]
79 Start, end, or run gc_urgent for a given time period
80
81 defrag_file [start] [length] [file_path]
82 Defragment a file.
83
84 copy [-d] [-m] [-s] [src_path] [dst_path]
85 Copy file from src_path to dst_path. The pattern parameter can
86 be:
87
88 -d use direct I/O
89
90 -m use mmap for source file
91
92 -s use sendfile to transfer data
93
94 get_cblocks [file]
95 Get the number of compressed blocks.
96
97 release_cblocks [file]
98 Release compressed blocks to get free space.
99
100 reserve_cblocks [file]
101 Reserve free blocks to prepare decompressing blocks in the file.
102
103 gc [sync_mode] [file]
104 Trigger filesystem GC
105
107 This version of f2fs_io has been written by Jaegeuk Kim <jaegeuk@ker‐
108 nel.org>.
109
111 f2fs_io is available from git://git.kernel.org/pub/scm/linux/ker‐
112 nel/git/jaegeuk/f2fs-tools.git.
113
114
115
116f2fs-tools March 2020 f2fs_io(8)