Warning: Redis::connect(): connect() failed: Connection refused in /var/www/admclub.com/wp-content/object-cache.php on line 418
Linux系统添加lvm分区操作记录 | _站长俱乐部站长俱乐部

Linux系统添加lvm分区操作记录

惟下是操作记录,未经整理,日后再整理.

首先要得到需要操作的group ID:

[root@nl5 ~]# vgscan
Reading all physical volumes.  This may take a while...
Found volume group "VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb" using metadata type lvm2

查看VG信息:
[root@nl5 ~]# vgdisplay -v VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb
Using volume group(s) on command line
Finding volume group "VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb"
--- Volume group ---
VG Name               VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb
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               457.75 GB
PE Size               4.00 MB
Total PE              117183
Alloc PE / Size       5 / 20.00 MB
Free  PE / Size       117178 / 457.73 GB
VG UUID               JvH35v-5tTq-02SH-iLLo-t3Dq-18Vc-1BUDNj

--- Logical volume ---
LV Name                /dev/VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb/MGT
VG Name                VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb
LV UUID                Sgi2uL-X40F-eNcU-slcv-wPTr-Esnp-GSWUZl
LV Write Access        read/write
LV Status              NOT available
LV Size                4.00 MB
Current LE             1
Segments               1
Allocation             inherit
Read ahead sectors     auto

--- Logical volume ---
LV Name                /dev/VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb/VHD-41542416-067d-4ff2-8fdc-44a1e2c9cfe8
VG Name                VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb
LV UUID                9DPL46-a7QJ-OLVI-2O0U-tnwN-DzoV-7HiI78
LV Write Access        read/write
LV Status              NOT available
LV Size                16.00 MB
Current LE             4
Segments               1
Allocation             inherit
Read ahead sectors     auto

--- Physical volumes ---
PV Name               /dev/sda3
PV UUID               t7NdvL-7AAj-V8Mu-xgQA-LYBX-GxPz-eGq7IQ
PV Status             allocatable
Total PE / Free PE    117183 / 117178

lvcreate -L 10G -n data VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb
Logical volume "data" created

检证新分区是否存在:

[root@nl5 ~]# lvscan
inactive          '/dev/VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb/MGT' [4.00 MB] inherit
inactive          '/dev/VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb/VHD-41542416-067d-4ff2-8fdc-44a1e2c9cfe8' [16.00 MB] inherit
ACTIVE            '/dev/VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb/data' [10.00 GB] inherit

激分区
vgchange -a y VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb

mkfs.ext3 /dev/VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb/data

挂载新分区:
mkdir /iso
mount /dev/VG_XenStorage-633d1482-a113-92ab-1939-1465a995bddb/data /iso

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>