分类: 虚拟化
2011-12-23 14:21:39
我们都知道xenserver安装后,不管你的盘有多大,只有4G的空间。xenserver会分3个区,sda1和sda2都是4G,互为备份,不能动的。sda3有三种用途:
1. SR <--缺省,只有一块盘的话,它会被作为一个SR使用。
2. 建立一个VG_XenStorage开头的VG <--用法不明,好像是空的,有多快盘,没把第一块盘分配给VM
3. 没有使用 <-- 安装后的使用不给VM选择存储在那些盘
Xensever的分区很奇怪fdisk, sfdisk和parted都不能正常操作,建议不要去改变这个盘的分区;其他的盘xenserver会整个作为一个pv使用。总之,不要去改分区。直接建立pv,vg,lv什么的。
选对第2种情况的处理方式:
如果你有2块盘,安装的时候没有选择系统做SR的话,会建立一个 VG_XenStorag开头的VG,用的是PV /dev/sd3
这个vg好像没有用,里面见了一个4G的LV,第一块盘就只用了12的内容,其它都空闲,你可在这个VG上建立LV,makefs就可以了
[root@vm9 /]# vgdisplay VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
--- Volume group ---
VG Name VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 11.99 GB
PE Size 4.00 MB
Total PE 3069
Alloc PE / Size 1 / 4.00 MB
Free PE / Size 3068 / 11.98 GB
VG UUID gdk23O-Ugch-ygeb-wiZc-aoIr-QbTL-XoQqfx
[root@vm9 /]# lvdisplay VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
--- Logical volume ---
LV Name /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/MGT
VG Name VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
LV UUID qnsQew-gAqU-IEqr-rGsF-jO3j-crwE-eNHqx5
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
[root@vm9 /]# lvcreate -n lviso -L +6G VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
Logical volume "lviso" created
[root@vm9 /]#
[root@vm9 /]#
[root@vm9 /]# lvdisplay VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
--- Logical volume ---
LV Name /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/MGT
VG Name VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
LV UUID qnsQew-gAqU-IEqr-rGsF-jO3j-crwE-eNHqx5
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-205eecff-2466-84fe-56d5-81472e44f3c2/lviso
VG Name VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2
LV UUID lmJmYH-OiRW-gQle-nCJk-Y9M9-zVev-JGvrqK
LV Write Access read/write
LV Status available
# open 0
LV Size 6.00 GB
Current LE 1536
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 1024
Block device 252:1
mkfs.ext3 /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/lviso
[root@vm9 /]# mkdir /ISO
[root@vm9 /]# mount /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/lviso /ISO
[root@vm9 /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 4.0G 1.7G 2.1G 46% /
none 380M 0 380M 0% /dev/shm
/opt/xensource/packages/iso/XenCenter.iso
44M 44M 0 100% /var/xen/xc-install
/dev/mapper/XSLocalEXT--5983fa21--42bd--0cd6--aafd--78534a7908f7-5983fa21--42bd--0cd6--aafd--78534a7908f7
9.9G 911M 8.5G 10% /var/run/sr-mount/5983fa21-42bd-0cd6-aafd-78534a7908f7
/dev/mapper/VG_XenStorage--205eecff--2466--84fe--56d5--81472e44f3c2-lviso
6.0G 141M 5.5G 3% /ISO
[root@vm9 opt]# xe-mount-iso-sr /ISO -o bind
[root@vm9 ISO]# touch A.iso B.iso