如何缩小逻辑卷

 时间:2026-02-13 09:23:48

1、检查文件系统的完整性:

[root@linuxprobe ~]# e2fsck -f /dev/storage/vo 

e2fsck 1.42.9 (28-Dec-2013) 

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/storage/vo: 11/74000 files (0.0% non-contiguous), 15507/299008 blocks

2、将LV逻辑卷的容量减小到120M:

[root@linuxprobe ~]# resize2fs /dev/storage/vo 120M 

resize2fs 1.42.9 (28-Dec-2013) 

Resizing the filesystem on /dev/storage/vo to 122880 (1k) blocks. 

The filesystem on /dev/storage/vo is now 122880 blocks long. 

[root@linuxprobe ~]# lvreduce -L 120M /dev/storage/vo 

WARNING: Reducing active logical volume to 120.00 MiB 

THIS MAY DESTROY YOUR DATA (filesystem etc.) 

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

Reducing logical volume vo to 120.00 MiB 

 Logical volume vo successfully resized

3、将文件系统重新挂载并查看系统状态:

[root@linuxprobe ~]# mount -a 

[root@linuxprobe ~]# df -h 

Filesystem Size Used Avail Use% Mounted on 

/dev/mapper/rhel-root 18G 3.0G 15G 17% / 

devtmpfs 985M 0 985M 0% /dev 

tmpfs 994M 80K 994M 1% /dev/shm 

tmpfs 994M 8.8M 986M 1% /run 

tmpfs 994M 0 994M 0% /sys/fs/cgroup 

/dev/sr0 3.5G 3.5G 0 100% /media/cdrom 

/dev/sda1 497M 119M 379M 24% /boot 

/dev/mapper/storage-vo 113M 1.6M 103M 2% /linuxprobe

  • 如何查看Idea当前连接的SVN仓库信息
  • 如何用js将一个input的值放到另一个input里
  • 火狐浏览器记住了我的用户名和密码,怎么清除?
  • 电脑如何找到host
  • html页面如何禁止刷新
  • 热门搜索
    岳阳旅游 平潭岛旅游攻略 宁德旅游 焦作旅游 泰山旅游 合肥旅游攻略 厦门工商旅游学校 敦煌旅游攻略 绍兴旅游攻略 越南旅游景点