linux lvm 减小 错误,linux lvm 减小lv的实例

由于之前分的lv太大所以想缩小一些 腾出点空间给其它用

要减小lvm的文件系统 需要文件系统在umount状态下修改 所以在线不要去改重要文件系统

操作步骤如下:

1.查看挂载的文件系统和lv

df -h 查看文件系统 ,下面是我要更改的文件系统。这里是99G

/dev/mapper/vg_LogVol01

99G  188M   94G   1% /home

lvdisplay 下面是文件系统对应的逻辑卷(lv)

--- Logical volume ---

LV Name                /dev/vg_test/LogVol01

VG Name                vg_test

LV UUID                cXylir-3KNW-UQ8a-kXos-fuIy-NAx2-0DJ5Fw

LV Write Access        read/write

LV Status              available

# open                 1

LV Size                100.00 GiB

Current LE             800

Segments               1

Allocation             inherit

Read ahead sectors     auto

- currently set to     256

Block device           253:2

2. 卸载文件系统

umount /dev/mapper/vg_LogVol01

3. 查看是否卸载 df -h  文件系统已经没有了

4.文件系统检查 确认没有坏块

e2fsck -f  /dev/mapper/vg_LogVol01

e2fsck 1.41.12 (17-May-2010)

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/mapper/vg_LogVol01: 11/6553600 files (0.0% non-contiguous), 459

349/26214400 blocks

5.缩小文件系统 到20g

resize2fs /dev/mapper/vg_LogVol01 20G

resize2fs 1.41.12 (17-May-2010)

Resizing the filesystem on /dev/mapper/vg_LogVol01 to 5242880 (4k) b

locks.

The filesystem on /dev/mapper/vg_LogVol01 is now 5242880 blocks long

6.缩小逻辑卷

lvreduce -L 20G  /dev/vg_test/LogVol01

WARNING: Reducing active logical volume to 20.00 GiB

THIS MAY DESTROY YOUR DATA (filesystem etc.)

Do you really want to reduce LogVol01? [y/n]: y

Reducing logical volume LogVol01 to 20.00 GiB

Logical volume LogVol01 successfully resized

7.挂载上文件系统

mount /dev/mapper/vg_LogVol01

8.通过df -h 和lvdisplay来查看是否已经修改

.

阅读(11572) | 评论(0) | 转发(1) |

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值