码迷,mamicode.com
首页 > 系统相关 > 详细

阿里云盘扩容(SUSE Linux下)

时间:2015-11-25 18:49:40      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

系统基于LVM卷组管理

1、在阿里云购买磁盘扩容后,系统重启

2、重启后lv状态不可用,无法挂在lvm

mount /dev/mapper/vgdisk-app /home
mount: special device /dev/mapper/vgdisk-app does not exist

查看lv状态

  --- Logical volume ---
  LV Name                /dev/vgdisk/app
  VG Name                vgdisk
  LV UUID                j9GvOW-sivU-18Nq-3vfN-cmTU-49Je-nvu7rK
  LV Write Access        read/write
  LV Creation host, time iZ94jg74t5xZ, 2015-08-27 19:39:19 +0800
  LV Status              NOT available
  LV Size                100.00 GiB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Name                /dev/vgdisk/data
  VG Name                vgdisk
  LV UUID                Y3F520-hGF2-sazF-C1Ch-kbWl-X4LE-XAta3i
  LV Write Access        read/write
  LV Creation host, time iZ94jg74t5xZ, 2015-08-27 19:41:34 +0800
  LV Status              NOT available
  LV Size                350.00 GiB
  Current LE             89600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

为啥状态不正确了呢,应该扩容导致的问题,找阿里云官方资料,要么是Window下,要么是linux非LVM管理的,感觉按照官方操作不靠谱。

遂自行查找基于LVM卷管理的磁盘扩容资料,找到了一些比较全面的参考资料,结合阿里云环境把问题解决了。

SUSE10 LVM实现扩展PV操作指导书

需要对lvm中的管理信息重新扫描,文档中介绍了很多命令,实际上对于扩容至需要更新pv信息,vg信息

 

处理方法:

---------------------------------------------

step 1:扫描和扩容PV

iZ94jg74t5xZ:~ # pvscan
  PV /dev/xvdc   VG vgdisk   lvm2 [500.00 GiB / 50.00 GiB free]
  Total: 1 [500.00 GiB] / in use: 1 [500.00 GiB] / in no VG: 0 [0   ]
iZ94jg74t5xZ:~ # pvresize /dev/xvdc
  Physical volume "/dev/xvdc" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized

 

 

step 2:更新VG信息

 

iZ94jg74t5xZ:~ # vgchange -ay
  2 logical volume(s) in volume group "vgdisk" now active

 

更新完成后查看vg信息和lv状态,一切正常

iZ94jg74t5xZ:~ # vgdisplay 
  --- Volume group ---
  VG Name               vgdisk
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1000.00 GiB
  PE Size               4.00 MiB
  Total PE              255999
  Alloc PE / Size       115200 / 450.00 GiB
  Free  PE / Size       140799 / 550.00 GiB
  VG UUID               IcVDC2-UAKv-2Cbm-iE8c-JYjp-tupP-TXxuTC
   
iZ94jg74t5xZ:~ # lvdisplay 
  --- Logical volume ---
  LV Name                /dev/vgdisk/app
  VG Name                vgdisk
  LV UUID                j9GvOW-sivU-18Nq-3vfN-cmTU-49Je-nvu7rK
  LV Write Access        read/write
  LV Creation host, time iZ94jg74t5xZ, 2015-08-27 19:39:19 +0800
  LV Status              available
  # open                 0
  LV Size                100.00 GiB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     1024
  Block device           252:0
   
  --- Logical volume ---
  LV Name                /dev/vgdisk/data
  VG Name                vgdisk
  LV UUID                Y3F520-hGF2-sazF-C1Ch-kbWl-X4LE-XAta3i
  LV Write Access        read/write
  LV Creation host, time iZ94jg74t5xZ, 2015-08-27 19:41:34 +0800
  LV Status              available
  # open                 0
  LV Size                350.00 GiB
  Current LE             89600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     1024
  Block device           252:1

 

step 3:mount磁盘

这个就不详细描述了,有大把资料参考

----------------------------------------------

从上面操作可以看出基于LVM管理磁盘优势太明显了,比阿里官方的操作方式简单安全得多

 

阿里云盘扩容(SUSE Linux下)

标签:

原文地址:http://www.cnblogs.com/kaihe/p/4995203.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!