linux 下lvm逻辑卷的铸造
v逻辑卷500M 区分 500M Extending logical volume lvm1 to 500.00 MB Logical volume lvm1 successfully resized 成功标志 [root@station23 test]# resize2fs /dev/myvol1/lvm1 重新定义lv大小,这步一定不能少resize2fs 1.39 (29-May-2006) Filesystem at /dev/myvol1/lvm1 is mounted on /share; on-line resizing required 拥有帝国一切,皆有可能。欢迎访问phome.net Performing an on-line resize of /dev/myvol1/lvm1 to 512000 (1k) blocks. The filesystem on /dev/myvol1/lvm1 is now 512000 blocks long. [root@station23 test]# ls aa文件依然存在,扩展成功 aa 收缩逻辑卷lvm1的大小至200M,要求不能损坏其中的文件; [root@station23 test]# umount /dev/myvol1/lvm1 失败原因,在挂载目录 umount: /share: device is busy umount: /share: device is busy [root@station23 test]# cd [root@station23 ~]# umount /dev/myvol1/lvm1 收缩逻辑卷时一定要先卸载 [root@station23 ~]# e2fsck -f /dev/myvol1/lvm1 e2fsck 1.39 (29-May-2006) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/myvol1/lvm1: 13/127512 files (7.7% non-contiguous), 26640/512000 blocks [root@station23 ~]#resize2fs /development/myvol1/lvm1 200M [root@station23 ~]# lvreduce -L 200M /dev/myvol1/lvm1 收缩至200M 区分-200M WARNING: Reducing active logical volume to 200.00 MB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce lvm1? [y/n]: y Reducing logical volume lvm1 to 200.00 MB Logical volume lvm1 successfully resized [root@station23 ~]# cd /share [root@station23 share]# ls test [root@station23 share]# cd [root@station23 ~]# mount /dev/myvol1/lvm1 /share [root@station23 ~]# cd /share/ [root@station23 share]# ls lost found test [root@station23 share]# cd test/ [root@station23 test]# ls 查看是否损坏文件 aa [root@station23 test]# 为此卷创建snapshot,名称为lvm1snap; [root@station23 test]# lvcreate -L 100M -s -p r -n lvm1snapshot /dev/myvol1/lvm1 Logical volume "lvm1snapshot" created 拥有帝国一切,皆有可能。欢迎访问phome.net Ok 拥有帝国一切,皆有可能。欢迎访问phome.net |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |