Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7173139
  • 博文数量: 3857
  • 博客积分: 6409
  • 博客等级: 准将
  • 技术积分: 15948
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-02 16:48
个人简介

迷彩 潜伏 隐蔽 伪装

文章分类

全部博文(3857)

文章存档

2017年(5)

2016年(63)

2015年(927)

2014年(677)

2013年(807)

2012年(1241)

2011年(67)

2010年(7)

2009年(36)

2008年(28)

分类:

2012-06-13 08:37:34

原文地址:Linux 扩展LV引起的问题 作者:zrp999

1.在扩展逻辑卷大小后,使用df -lh查看发现分区并没有被扩展,还是原来的大小。

control            vg_ztone-LogVol00  vg_ztone-LogVol01  vg_ztone-LogVol02 

[root@ztone ~]# lvextend -l 4339 /dev/mapper/vg_ztone-LogVol02

  Extending logical volume LogVol02 to 33.90 GiB

  Logical volume LogVol02 successfully resized

[root@ztone ~]# df -lh

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/vg_ztone-LogVol02

                      9.9G  3.7G  5.7G  40% /

tmpfs                1004M   88K 1004M   1% /dev/shm

/dev/sda1              97M   26M   67M  28% /boot

/dev/mapper/vg_ztone-LogVol01

                      2.0G   68M  1.9G   4% /tmp

查看LV显示正常:

root@ztone ~]# lvdisplay

 --- Logical volume ---

  LV Name                /dev/vg_ztone/LogVol02

  VG Name                vg_ztone

  LV UUID                8ynSMD-Dm2X-4oo9-5KOw-4wq4-IY7W-t9vhia

  LV Write Access        read/write

  LV Status              available

  # open                 1

  LV Size                33.90 GiB

  Current LE             4339

  Segments               1

  Allocation             inherit

  Read ahead sectors     auto

  - currently set to     256

  Block device           253:1

 

解决办法:

在扩展时要加上+,如:

 lvextend -L 35G  /dev/mapper/vg_ztone-LogVol02

使用以下命令重新检测分区情况:

[root@ztone vg_ztone]# e2fsck -f /dev/mapper/vg_ztone-LogVol02

e2fsck 1.41.12 (17-May-2010)

/dev/mapper/vg_ztone-LogVol02 is mounted. 

 

WARNING!!!  The filesystem is mounted.   If you continue you ***WILL***

cause ***SEVERE*** filesystem damage.

 

Do you really want to continue (y/n)? yes

 

/dev/mapper/vg_ztone-LogVol02: recovering journal

Clearing orphaned inode 525325 (uid=42, gid=42, mode=010644, size=0)

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

注意:如果在己挂载的分区上执行上述命令,则vg会出现错误,需重启系统。

/dev/mapper/vg_ztone-LogVol02: ***** FILE SYSTEM WAS MODIFIED *****

/dev/mapper/vg_ztone-LogVol02: ***** REBOOT LINUX *****

/dev/mapper/vg_ztone-LogVol02: 186452/655360 files (0.1% non-contiguous), 1010493/2621440 blocks

重新调整文件系统大小:

[root@ztone vg_ztone]# resize2fs /dev/mapper/vg_ztone-LogVol02

resize2fs 1.41.12 (17-May-2010)

Filesystem at /dev/mapper/vg_ztone-LogVol02 is mounted on /; on-line resizing required

old desc_blocks = 1, new_desc_blocks = 3

Performing an on-line resize of /dev/mapper/vg_ztone-LogVol02 to 8886272 (4k) blocks.

The filesystem on /dev/mapper/vg_ztone-LogVol02 is now 8886272 blocks long.

[root@ztone vg_ztone]# df -lh

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/vg_ztone-LogVol02

                       34G  3.8G   28G  12% /

tmpfs                1004M   88K 1004M   1% /dev/shm

/dev/sda1              97M   26M   67M  28% /boot

/dev/mapper/vg_ztone-LogVol01

                      2.0G   68M  1.9G   4% /tmp

分区空间显示正常

 

错误信息:

在己挂载的分区上执行上述命令后无法正常运行lvdisplayvgdisplay

 e2fsck -f /dev/mapper/vg_ztone-LogVol02

[root@ztone vg_ztone]# lvextend -L 10G /dev/mapper/vg_ztone-LogVol02

  /var/lock/lvm/V_vg_ztone:aux: open failed: Invalid argument

  Can't get lock for vg_ztone

[root@ztone vg_ztone]# lvextend -L +10G /dev/mapper/vg_ztone-LogVol02

  /var/lock/lvm/V_vg_ztone:aux: open failed: Invalid argument

  Can't get lock for vg_ztone

[root@ztone vg_ztone]# vgdisplay

  /var/lock/lvm/V_vg_ztone:aux: open failed: Invalid argument

  Can't get lock for vg_ztone

重新启动系统后恢复正常

[root@ztone ~]# vgdisplay

  --- Volume group ---

  VG Name               vg_ztone

  System ID            

  Format                lvm2

  Metadata Areas        1

  Metadata Sequence No  7

  VG Access             read/write

  VG Status             resizable

  MAX LV                0

  Cur LV                3

  Open LV               3

  Max PV                0

  Cur PV                1

  Act PV                1

  VG Size               49.90 GiB

  PE Size               8.00 MiB

  Total PE              6387

  Alloc PE / Size       5107 / 39.90 GiB

  Free  PE / Size       1280 / 10.00 GiB

  VG UUID               3e6uYq-vtMm-oStP-v7jm-mzs4-2CzK-c0DDmO

阅读(636) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~