我创建了一个挂载的 ext4 fs 的 LVM 快照:
lvcreate -L 10GiB -s -n "root-snapshot" "/dev/myvgname/root"
如果我然后在 /dev/myvgname/root-snapshot 上运行 e2fsck,它会说:
e2fsck 1.42.5 (29-Jul-2012)
Clearing orphaned inode 263640 (uid=0, gid=0, mode=0100600, size=0)
Clearing orphaned inode 260744 (uid=0, gid=0, mode=0100600, size=0)
Clearing orphaned inode 266864 (uid=0, gid=0, mode=0100600, size=0)
Clearing orphaned inode 261058 (uid=103, gid=107, mode=0100600, size=0)
Clearing orphaned inode 261057 (uid=103, gid=107, mode=0100600, size=0)
Clearing orphaned inode 261001 (uid=103, gid=107, mode=0100600, size=0)
Clearing orphaned inode 260918 (uid=103, gid=107, mode=0100600, size=0)
Clearing orphaned inode 260913 (uid=103, gid=107, mode=0100600, size=0)
root: clean, 52533/977280 files, 811160/3905536 blocks
为什么要清除那些孤立的 inode?LVM 不应该使底层 fs 处于一致(干净)状态吗?
拍摄快照时,文件系统被冻结,但该状态与完全卸载的文件系统的状态并不完全相同。来自
man fsfreeze
: