REDHAT(LINUX) 扩 /HOME 所在LV

首先确认VG中有足够的剩余容量,否则要先进行扩VG操作,再此略过

[root@rhel6 ~]# fdisk -l

 

Disk /dev/sda: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x7594408f

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              64       51057   409600000   8e  Linux LVM

 

确认LV剩余情况

[root@rhel6 ~]# lvscan

  ACTIVE            '/dev/vg_rhel6/LogVol04' [7.81 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol01' [48.83 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol00' [48.83 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol03' [48.83 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol02' [48.83 GiB] inherit

[root@rhel6 ~]# df -lh

Îļþϵͳ              ÈÝÁ¿  ÒÑÓà ¿ÉÓà ÒÑÓÃ%% ¹ÒÔصã

/dev/mapper/vg_rhel6-LogVol00

                       49G  416M   46G   1% /

tmpfs                1004M     0 1004M   0% /dev/shm

/dev/sda1             485M   31M  429M   7% /boot

/dev/mapper/vg_rhel6-LogVol01

                       49G   20G   26G  44% /home

/dev/mapper/vg_rhel6-LogVol02

                       49G  3.3G   43G   8% /tmp

/dev/mapper/vg_rhel6-LogVol03

                       49G  1.5G   45G   4% /usr

 

 

LV容量,增加100G +100G,如果是指定空间变化为100G,则不需要加号)

[root@rhel6 vg_rhel6]# lvextend -L +100G /dev/vg_rhel6/LogVol01

  Extending logical volume LogVol01 to 148.83 GiB

  Logical volume LogVol01 successfully resized

[root@rhel6 vg_rhel6]# lvscan

  ACTIVE            '/dev/vg_rhel6/LogVol04' [7.81 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol01' [148.83 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol00' [48.83 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol03' [48.83 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol02' [48.83 GiB] inherit

 

但查看挂载情况, /HOME 容量并未提升

[root@rhel6 dev]# df -lh

Îļþϵͳ              ÈÝÁ¿  ÒÑÓà ¿ÉÓà ÒÑÓÃ%% ¹ÒÔصã

/dev/mapper/vg_rhel6-LogVol00

                       49G  416M   46G   1% /

tmpfs                1004M     0 1004M   0% /dev/shm

/dev/sda1             485M   31M  429M   7% /boot

/dev/mapper/vg_rhel6-LogVol01

                       49G   20G   26G  44% /home

/dev/mapper/vg_rhel6-LogVol02

                       49G  3.3G   43G   8% /tmp

/dev/mapper/vg_rhel6-LogVol03

                       49G  1.5G   45G   4% /usr

 

刷新文件系统大小

[root@rhel6 dev]# resize2fs -f /dev/vg_rhel6/LogVol01

resize2fs 1.41.12 (17-May-2010)

Filesystem at /dev/vg_rhel6/LogVol01 is mounted on /home; on-line resizing required

old desc_blocks = 4, new_desc_blocks = 10

Performing an on-line resize of /dev/vg_rhel6/LogVol01 to 39014400 (4k) blocks.

The filesystem on /dev/vg_rhel6/LogVol01 is now 39014400 blocks long.

 

 

文件系统大小已改变

[root@rhel6 dev]# mount

/dev/mapper/vg_rhel6-LogVol00 on / type ext4 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")

/dev/sda1 on /boot type ext4 (rw)

/dev/mapper/vg_rhel6-LogVol02 on /tmp type ext4 (rw)

/dev/mapper/vg_rhel6-LogVol03 on /usr type ext4 (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

nfsd on /proc/fs/nfsd type nfsd (rw)

[root@rhel6 dev]# df -lh

Îļþϵͳ              ÈÝÁ¿  ÒÑÓà ¿ÉÓà ÒÑÓÃ%% ¹ÒÔصã

/dev/mapper/vg_rhel6-LogVol00

                       49G  416M   46G   1% /

tmpfs                1004M     0 1004M   0% /dev/shm

/dev/sda1             485M   31M  429M   7% /boot

/dev/mapper/vg_rhel6-LogVol02

                       49G  3.3G   43G   8% /tmp

/dev/mapper/vg_rhel6-LogVol03

                       49G  1.5G   45G   4% /usr

[root@rhel6 dev]# lvextend [root@rhel6 ~]# lvscan

  ACTIVE            '/dev/vg_rhel6/LogVol04' [7.81 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol01' [48.83 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol00' [48.83 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol03' [48.83 GiB] inherit

  ACTIVE            '/dev/vg_rhel6/LogVol02' [48.83 GiB] inherit  Path required for Logical Volume "[root@rhel6"

  Please provide a volume group name

  Run `lvextend --help' for more information.

 

 

问题:我在未UMOUNT的情况下进行的操作,但结果正常。不UMOUNT是否有负面影响或风险?

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值