为了扩展逻辑卷,我必须将缓存从中分离出来:
root@server:/home# lvextend -L+50G /dev/vg1/home
Unable to resize logical volumes of cache type.
root@server:/home# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home vg1 Cwi-aoC--- 250.00g [homeCache] [home_corig] 100.00 9.29 0.00
newvar vg1 Cwi-aoC--- 200.00g [Cvar_cache] [newvar_corig] 100.00 0.92 0.00
root_lv vg1 -wi-ao---- 93.07g
var vg1 -wi-ao---- 120.00g
root@server:/home# lvconvert --splitcache /dev/vg1/home
Logical volume vg1/home is not cached and cache pool vg1/homeCache is unused.
root@server:/home# lvextend -L+50G /dev/vg1/home
Size of logical volume vg1/home changed from 250.00 GiB (64000 extents) to 300.00 GiB (76800 extents).
Logical volume home successfully resized.
root@server:/home# resize2fs !$
resize2fs /dev/vg1/home
resize2fs 1.42.13 (17-May-2015)
如何将分割缓存重新连接回 LV?我应该使用 --uncache 来销毁缓存然后重建它吗?如果是这样,我的下一步是什么来销毁旧缓存,以免浪费空间?
答案1
如果有人正在寻找这个(或未来的我),请回答:
lvconvert --type cache --cachepool cache-pool vg/lv
所以在这种情况下:
lvconvert --type cache --cachepool homeCache vg1/home
您可以使用以下命令查看所有 LV,包括缓存:
lvs -a