我正在尝试调整逻辑卷(以及该卷上包含的文件系统)的大小,但对命令的输出有点困惑lvresize
:
# lvresize --resizefs -L 2T /dev/archive/archive
File system ext4 found on archive/archive mounted at /mnt.
File system size (<4,55 TiB) is larger than the requested size (0 ).
File system reduce is required using resize2fs.
File system unmount is needed for reduce.
File system fsck will be run before reduce.
Continue with ext4 file system reduce steps: unmount, fsck, resize2fs? [y/n]:n
File system not reduced.
我想将逻辑卷从 5T 调整为 2T 但这行代码让我很担心:File system size (<4,55 TiB) is larger than the requested size (0 )
。
更奇怪的是,输出的变化在我看来似乎很神秘:
尝试 2000G 而不是 2T 会得到请求的大小 1.95TiB
# lvresize --resizefs -L 2000G /dev/archive/archive
File system ext4 found on archive/archive mounted at /mnt.
File system size (<4,55 TiB) is larger than the requested size (1,95 TiB).
File system reduce is required using resize2fs.
File system unmount is needed for reduce.
File system fsck will be run before reduce.
Continue with ext4 file system reduce steps: unmount, fsck, resize2fs? [y/n]:n
File system not reduced.
尝试 3000G 给出请求的大小为 952GiB
# lvresize --resizefs -L 3000G /dev/archive/archive
File system ext4 found on archive/archive mounted at /mnt.
File system size (<4,55 TiB) is larger than the requested size (952,00 GiB).
File system reduce is required using resize2fs.
File system unmount is needed for reduce.
File system fsck will be run before reduce.
Continue with ext4 file system reduce steps: unmount, fsck, resize2fs? [y/n]:n
File system not reduced.
我没有接受任何这些命令,因为磁盘上仍然存储着信息。
更多背景信息:
我这样做是因为我想从卷组中删除一个驱动器,但要使用,pvmove
我首先需要清除一些物理扩展。
据我了解,逻辑卷分配物理扩展,这意味着我只需要在运行之前减少逻辑卷的大小pvmove
。
我有两个驱动器,每个驱动器都有一个物理卷,sda1
并且sdb1
都加入到一个名为的卷组中archive
,该卷组有一个也称为的逻辑卷archive
。
逻辑卷占据整个卷组。
我主要参考了 arch linux wiki:https://wiki.archlinux.org/title/LVM#Resizing_the_logical_volume_and_file_system_in_one_go
目前我不知道这是否是一个错误,尽管考虑到 lvm 的流行度我对此非常怀疑。
答案1
我遇到了同样的问题。使用:Arch Linux 6.6.8
查看这篇文章的答案: https://unix.stackexchange.com/questions/766066/lvresize-showing-incoherent-and-random-final-size 您可以运行:
--fs ignore
答案2
更新:
这实际上是 lvm 计算磁盘大小时出现的错误。
我正在使用 arch,其中我启用了里面的测试镜像/etc/pacman.conf
。
此后,只需更新 lvm2 即可解决问题。