1IOCTL-XFS-FSOP-GEOMETRY(2) System Calls Manual IOCTL-XFS-FSOP-GEOMETRY(2)
2
3
4
6 ioctl_xfs_fsop_geometry - report XFS filesystem layout and features
7
9 #include <xfs/xfs_fs.h>
10
11 int ioctl(int fd, XFS_IOC_FSOP_GEOMETRY, struct xfs_fsop_geom*arg);
12 int ioctl(int fd, XFS_IOC_FSOP_GEOMETRY_V4, struct xfs_fsop_geom_v4
13 *arg);
14 int ioctl(int fd, XFS_IOC_FSOP_GEOMETRY_V1, struct xfs_fsop_geom_v1
15 *arg);
16
18 Report the details of an XFS filesystem layout, features, and other
19 descriptive items. This information is conveyed in a structure of the
20 following form:
21
22 struct xfs_fsop_geom {
23 __u32 blocksize;
24 __u32 rtextsize;
25 __u32 agblocks;
26 __u32 agcount;
27 __u32 logblocks;
28 __u32 sectsize;
29 __u32 inodesize;
30 __u32 imaxpct;
31 __u64 datablocks;
32 __u64 rtblocks;
33 __u64 rtextents;
34 __u64 logstart;
35 unsigned char uuid[16];
36 __u32 sunit;
37 __u32 swidth;
38 __s32 version;
39 __u32 flags;
40 __u32 logsectsize;
41 __u32 rtsectsize;
42 __u32 dirblocksize;
43 /* struct xfs_fsop_geom_v1 stops here. */
44
45 __u32 logsunit;
46 /* struct xfs_fsop_geom_v4 stops here. */
47
48 __u32 sick;
49 __u32 checked;
50 __u64 reserved[17];
51 };
52
53 blocksize is the size of a fundamental filesystem block, in bytes.
54
55 rtextsize is the size of an extent on the realtime volume, in bytes.
56
57 agblocks is the size of an allocation group, in units of filesystem
58 blocks.
59
60 agcount is the number of allocation groups in the filesystem.
61
62 logblocks is the size of the log, in units of filesystem blocks.
63
64 sectsize is the smallest amount of data that can be written to the data
65 device atomically, in bytes.
66
67 inodesize is the size of an inode record, in bytes.
68
69 imaxpct is the maximum percentage of the filesystem that can be allo‐
70 cated to inode record blocks.
71
72 datablocks is the size of the data device, in units of filesystem
73 blocks.
74
75 rtblocks is the size of the realtime device, in units of filesystem
76 blocks.
77
78 rtextents is the number of extents that can be allocated on the real‐
79 time device.
80
81 logstart is the start of the log, in units of filesystem blocks. If
82 the filesystem has an external log, this will be zero.
83
84 uuid is the universal unique identifier of the filesystem.
85
86 sunit is what the filesystem has been told is the size of a RAID stripe
87 unit on the underlying data device, in filesystem blocks.
88
89 swidth is what the filesystem has been told is the width of a RAID
90 stripe on the underlying data device, in units of RAID stripe units.
91
92 version is the version of this structure. This value will be
93 XFS_FSOP_GEOM_VERSION.
94
95 flags tell us what features are enabled on the filesystem. Refer to
96 the section FILESYSTEM FEATURE FLAGS below for more information about
97 each feature.
98
99 logsectsize is the smallest amount of data that can be written to the
100 log device atomically, in bytes.
101
102 rtsectsize is the smallest amount of data that can be written to the
103 realtime device atomically, in bytes.
104
105 dirblocksize is the size of directory blocks, in bytes.
106
107 logsunit is what the filesystem has been told is the size of a RAID
108 stripe unit on the underlying log device, in filesystem blocks. This
109 field is meaningful only if the flag XFS_FSOP_GEOM_FLAGS_LOGV2 is set.
110
111 The fields sick and checked indicate the relative health of various
112 whole-filesystem metadata. Please see the section XFS METADATA HEALTH
113 REPORTING for more details.
114
115 reserved is set to zero.
116
118 Filesystem features are reported to userspace as a combination the fol‐
119 lowing flags:
120
121 XFS_FSOP_GEOM_FLAGS_ATTR
122 Extended attributes are present.
123
124 XFS_FSOP_GEOM_FLAGS_NLINK
125 Files on this filesystem support up to 2^32 hard links. If this
126 flag is not set, files on this filesystem support only up to
127 2^16 hard links.
128
129 XFS_FSOP_GEOM_FLAGS_QUOTA
130 Quotas are enabled.
131
132 XFS_FSOP_GEOM_FLAGS_IALIGN
133 Inodes are aligned for better performance.
134
135 XFS_FSOP_GEOM_FLAGS_DALIGN
136 Filesystem tries to align data block allocations to RAID stripe
137 units for better performance.
138
139 XFS_FSOP_GEOM_FLAGS_SHARED
140 Unused.
141
142 XFS_FSOP_GEOM_FLAGS_EXTFLG
143 Filesystem supports unwritten extents.
144
145 XFS_FSOP_GEOM_FLAGS_DIRV2
146 Directories are in version 2 format and maintain free space data
147 for better performance. Version 1 format directories are no
148 longer supported.
149
150 XFS_FSOP_GEOM_FLAGS_LOGV2
151 Log uses the V2 format.
152
153 XFS_FSOP_GEOM_FLAGS_SECTOR
154 The log device has a sector size larger than 512 bytes.
155
156 XFS_FSOP_GEOM_FLAGS_ATTR2
157 Filesystem contains V2 extended attributes.
158
159 XFS_FSOP_GEOM_FLAGS_PROJID32
160 Project IDs can be as large as 2^32. If this flag is not set,
161 the filesystem supports only 2^16 project IDs.
162
163 XFS_FSOP_GEOM_FLAGS_DIRV2CI
164 Case-insensitive lookups are supported on directories.
165
166 XFS_FSOP_GEOM_FLAGS_LAZYSB
167 On-disk superblock counters are updated only at unmount time.
168
169 XFS_FSOP_GEOM_FLAGS_V5SB
170 Metadata blocks are self describing and contain checksums.
171
172 XFS_FSOP_GEOM_FLAGS_FTYPE
173 Directories contain inode types in directory entries.
174
175 XFS_FSOP_GEOM_FLAGS_FINOBT
176 Filesystem maintains an index of free inodes.
177
178 XFS_FSOP_GEOM_FLAGS_SPINODES
179 Filesystem may allocate discontiguous inode chunks when free
180 space is fragmented.
181
182 XFS_FSOP_GEOM_FLAGS_RMAPBT
183 Filesystem stores reverse mappings of blocks to owners.
184
185 XFS_FSOP_GEOM_FLAGS_REFLINK
186 Filesystem supports sharing blocks between files.
187
189 The online filesystem checking utility scans metadata and records what
190 it finds in the kernel incore state. The following scheme is used for
191 userspace to read the incore health status of the filesystem:
192
193
194 · If a given sick flag is set in sick, then that piece of metadata has
195 been observed to be damaged. The same bit should be set in checked.
196
197 · If a given sick flag is set in checked but is not set in sick, then
198 that piece of metadata has been checked and is not faulty.
199
200 · If a given sick flag is not set in checked, then no conclusion can be
201 made.
202
203 The following flags apply to these fields:
204
205 XFS_FSOP_GEOM_SICK_COUNTERS
206 Inode and space summary counters.
207
208 XFS_FSOP_GEOM_SICK_UQUOTA
209 User quota information.
210
211 XFS_FSOP_GEOM_SICK_GQUOTA
212 Group quota information.
213
214 XFS_FSOP_GEOM_SICK_PQUOTA
215 Project quota information.
216
217 XFS_FSOP_GEOM_SICK_RT_BITMAP
218 Free space bitmap for the realtime device.
219
220 XFS_FSOP_GEOM_SICK_RT_SUMMARY
221 Free space summary for the realtime device.
222
223
225 On error, -1 is returned, and errno is set to indicate the error.
226
228 Error codes can be one of, but are not limited to, the following:
229
230 EFAULT The kernel was not able to copy into the userspace buffer.
231
232 EFSBADCRC
233 Metadata checksum validation failed while performing the query.
234
235 EFSCORRUPTED
236 Metadata corruption was encountered while performing the query.
237
238 EIO An I/O error was encountered while performing the query.
239
241 This API is specific to XFS filesystem on the Linux kernel.
242
244 ioctl(2)
245
246
247
248XFS 2019-06-17 IOCTL-XFS-FSOP-GEOMETRY(2)