我已经启用了瘦配置的LVM。我有两个几乎相同的薄逻辑卷,与ext4文件系统略有不同。第一个卷完全用于存储文件系统。在第二个卷上,文件系统存储有一个小的偏移量。它使用-o offset=1048576选项挂载。
第一个卷可以使用fstrim命令清除,但第二个卷不能。相反,它会给出错误:
fstrim: second: the discard operation is not supported那是因为我相信是抵消安装的缘故。接收偏移选项挂载命令创建临时循环设备并将其挂载。所以主要的嫌疑人是环路装置。
是否有可能以某种方式清除与卷开始块地址相偏移的文件系统?
发布于 2021-01-01 22:11:01
似乎是不可能的。我试图找出原因--这是loop.c的一条评论:
/*
* If the backing device is a block device, mirror its zeroing
* capability. Set the discard sectors to the block device's zeroing
* capabilities because loop discards result in blkdev_issue_zeroout(),
* not blkdev_issue_discard(). This maintains consistent behavior with
* file-backed loop devices: discarded regions read back as zero.
*/LVM薄设备不报告归零能力(write_zeroes_max_bytes是0)。我特别检查了dm-thin.c以证实这一点。
https://unix.stackexchange.com/questions/316660
复制相似问题