f2fs文件系统工具,用于创建、挂载、扩展、检查和修复f2fs文件系统,支持fsck、mkfs、resize等。
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
ci: Enable -Wall, -Wextra and -Werror commit 6eebd13e76e12748cda19daa340e3953ea1e8ecb category: bugfix issue: #I6VAS0 CVE: NA Signed-off-by: DongSenhao <dongsenhao2@huawei.com> --------------------------------------- Make the Github continuous integration checks more strict. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: dongsenhao <dongsenhao2@huawei.com> | 3 年前 | |
修订 agent 知识库以与代码现状对齐 统一去掉'独有'措辞为'扩展';修正 fsck 流程图顺序、include 重复条目、typo、未闭合反引号等与代码不一致的描述;补全 f2fs_tools.c / mkfs extra_fsck 说明;清理已废弃的 f2fstat 相关条目。 Signed-off-by: wangxincheng <wangxincheng14@huawei.com> | 13 天前 | |
Add pac config for f2fs-tools 🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%] Signed-off-by: jiangqianrong <jiangqianrong1@h-partners.com> | 12 天前 | |
update: 更新文件 f2fs_fs.h Signed-off-by: qinpangbo1 <qinpangbo1@huawei.com> | 3 个月前 | |
Add pac config for f2fs-tools 🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%] Signed-off-by: jiangqianrong <jiangqianrong1@h-partners.com> | 12 天前 | |
mkfs: Initial commit for patch v2 series This is same as f2fs-tools-1.1.0.tar.gz, and for patch v2 in kernel. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@gmail.com> | 13 年前 | |
f2fs_io: support triggering filesystem GC via ioctl Support 'gc' sub command to trigger filesystem GC via ioctl in f2fs. Signed-off-by: Chao Yu <chao.yu@oppo.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> | 2 年前 | |
Add pac config for f2fs-tools 🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%] Signed-off-by: jiangqianrong <jiangqianrong1@h-partners.com> | 12 天前 | |
script: add simple test script This patch adds a script to test sload.f2fs, defrag.f2fs, and resize.f2fs. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> | 10 年前 | |
Add pac config for f2fs-tools 🤖 AI[0%] 🔧 Human Fixed[0%] 🧑 Human[100%] 👌 AI Adopted[0%] Signed-off-by: jiangqianrong <jiangqianrong1@h-partners.com> | 12 天前 | |
f2fs-tools: Remove deprecated f2fstat Let's remove this. Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> | 2 年前 | |
修订 agent 知识库以与代码现状对齐 统一去掉'独有'措辞为'扩展';修正 fsck 流程图顺序、include 重复条目、typo、未闭合反引号等与代码不一致的描述;补全 f2fs_tools.c / mkfs extra_fsck 说明;清理已废弃的 f2fstat 相关条目。 Signed-off-by: wangxincheng <wangxincheng14@huawei.com> | 13 天前 | |
mkfs: Initial commit for patch v2 series This is same as f2fs-tools-1.1.0.tar.gz, and for patch v2 in kernel. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@gmail.com> | 13 年前 | |
f2fs_tools部件化 Signed-off-by: 张文迪 <zhangwendi3@huawei.com> | 3 年前 | |
License tweak: LGPL v2.1 vs LGPL v2 The important part is b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. Change-Id: Ic1a02ec5cfcb2bedda3d53f3061037e1e7437221 Signed-off-by: JP Abgrall <jpa@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> | 11 年前 | |
f2fs-tools: add fsck.f2fs and dump.f2fs fsck.f2fs checks file system consistency, but does not repair a broken file system yet. dump.f2fs shows the information of a specific inode and makes dump file of SSA and SIT. f2fs checks file system consistency as follows: o When data about used area and its metadata are identical, f2fs is considered consistent. To verify such consistency, we use three bitmaps: nat_area_bitmap, sit_area_bitmap, and main_area_bitmap. First, each bit in nat_area_bitmap corresponds to a nid in NAT. Second, each bit in sit_area_bitmap corresponds to a valid block in a segment. This bitmap is same to the total valid_map of f2fs_sit_entries in SIT. Last, each bit in main_area_bitmap corresponds to a block in main area except meta area. After a consistency check of each block, we set or clear the corresponding bit of each bitmap. From the root node, we start consistency check. The verified information varies according to block type. 1. NODE - Read information of node block from NAT - Check if block address is allocated using node info. - Check if the type of f2fs_summary related to nid in SSA is NODE. - Update the corresponding bit in nat_area_bitmap. - Update the corresponding bit in sit_area_bitmap. - Set the corresponding bit in main_area_bitmap to 1. - Then, read node block. According to its attribute, explore inode/direct node/indirect node/double indirect node recursively. - If it is an inode block, we also check its xattr and hard link. 2. DATA - Check if the type of f2fs_summary related to nid in SSA is DATA. - Set the corresponding bits of sit_area_bitmap and main_area_bitmap to visited - If it is a dentry block, traverse each dentries that may be regular file or directory. At this time, it will check inode block again. Finally, we verify whether - every nat_area_bitmap is visited - any unreachable hard link exists - values of sit_area_bitmap and main_area_bitmap are identical - total_valid_block_count/node_count/inode_count are correct Usage: o fsck.f2fs # fsck.f2fs /dev/sdx options: -d debug level [default:0] o dump.f2fs # dump.f2fs -i [ino] /dev/sdx # dump.f2fs -s 0~-1 /dev/sdx (SIT dump) # dump.f2fs -a 0~-1 /dev/sdx (SSA dump) options: -d debug level [default:0] -i inode no (hex) -s [SIT dump segno from #1~#2 (decimal), for all 0~-1] -a [SSA dump segno from #1~#2 (decimal), for all 0~-1] Note: To use dump.f2fs, please run make install or ln -s fsck.f2fs dump.f2fs Signed-off-by: Changman Lee <cm224.lee@samsung.com> Signed-off-by: Byoung Geun Kim <bgbg.kim@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com> | 12 年前 | |
增加开源声明文件 Signed-off-by: psycho <wangmingxuan6@h-partners.com> | 2 年前 | |
f2fs-tools: add f2fstat to print f2fs's status in sec This tool prints /sys/kernel/debug/f2fs/status in sec so that we can monitor variation of f2fs status. Signed-off-by: Changman Lee <cm224.lee@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com> | 12 年前 | |
单个模块扫描(三方软件)结果清零. Signed-off-by: xlfeng <xulifeng7@huawei.com> | 4 年前 | |
README.OpenSource修改同步 Signed-off-by: qinquan5 <qinquan5@huawei.com> | 2 年前 | |
configure.ac: Enable cross-compilation commit c48335416a09b881d2309b8f88c9b3d1441f4a9c category: bugfix issue: #I6VAS0 CVE: NA Signed-off-by: DongSenhao <dongsenhao2@huawei.com> --------------------------------------- Stop using PKG_CHECK_MODULES() since that macro is not compatible with cross-compilation. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: dongsenhao <dongsenhao2@huawei.com> | 3 年前 | |
f2fs-tools: upgrade version 1.16.0 Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> | 2 年前 | |
doc: add versioning rule Ted wrote a very useful versioning rule that newbies must read. Let me remain it in the tree. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> | 7 年前 | |
defrag.f2fs: introduce defragmentation tool This tool tries to move the valid blocks ranging from blkaddr to blkaddr + len to targeted blkaddr with a direction like expand or shrink. The option includes: -d debug level [default:0] -s start block address [default: main_blkaddr] -l length [default:512 (2MB)] -t target block address [default: main_blkaddr + 2MB] -i set direction as shrink [default: expand] For example, # defrag.f2fs -s 0x100 -l 0x10 -t 0x4000 /dev/sdb1 This will move data blocks between 0x100 and 0x110 to the right side of 0x4000 space. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> | 10 年前 | |
code sync Signed-off-by: yangbo <yangbo258@h-partners.com> | 7 个月前 | |
code sync Signed-off-by: yangbo <yangbo258@h-partners.com> | 7 个月前 | |
f2fs-tools: upgrade version 1.16.0 Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> | 2 年前 |
以下内容由 AI 翻译,如有问题请 点此提交 issue 反馈
F2FS 格式化工具
若要使用 f2fs 文件系统,需通过本工具对存储分区进行格式化。否则,将无法挂载 f2fs 文件系统。
编译前准备
您需要安装以下软件包:
- libuuid-devel 或 uuid-dev
- autoconf
- libtool
- libselinux1-dev
初始编译设置
在进行初始编译前,需运行 autoconf/automake 工具:
./autogen.sh
编译方法
./configure make make install
交叉编译方法(例如,针对 ARM 架构)
-
在 mkfs/Makefile.am 中添加以下行:
mkfs_f2fs_LDFLAGS = -all-static -
在 fsck/Makefile.am 中添加以下行:
fsck_f2fs_LDFLAGS = -all-static -
然后执行:
LDFLAGS=--static ./configure
--host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi
make
默认运行方式
mkfs.f2fs -l [LABEL] $DEV
有关更多 mkfs 选项,请参阅手册页。