XenServer安裝后,解決系統盤4G大小限制無法上傳大於4g的ISO鏡像(掛載新建盤的方法)


此法不穩定

我們都知道xenserver安裝后,不管你的盤有多大,只有4G的空間。

故操作是:新建LV卷,可自定義大小

若ISO倉庫已經創建好了,只需執行步驟1、2、3、4、5、7、8、9,把新的邏輯卷硬盤掛載到/opt/iso文件下(原來的鏡像會消失

1、vgdisplay #先查看剩余空間

[root@XenServer /]# vgdisplay

--- 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


2、lvdisplay VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2 #查看該區

[root@XenServer /]#  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



3、lvcreate -L 20GB -n iso VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2 #新建20G的lv卷iso

[root@XenServer /]#  lvcreate -L 20GB -n iso VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2

Logical volume "lviso" created

順帶提一下如何添加空間:


[root@XenServer /]#  lvcreate -n lviso -L +6G VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2

Logical volume "lviso" created



4、lvdisplay VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2 #再次查看該區

[root@XenServer /]#  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/iso
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 20.00 GB
Current LE 1536
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 1024
Block device 252:1



5、mkfs.ext3 /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/iso #格式化為ext3格式

mkfs.ext3 /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/iso


6、mkdir /opt/iso #在/opt下建立iso文件夾,用於ISO鏡像文件的掛載


7、vgchange -a y #激活所有卷組


8、mount /dev/VG_XenStorage-205eecff-2466-84fe-56d5-81472e44f3c2/lviso /iso #掛載/ISO文件夾下的iso鏡像文件


9、df -h #查看容量

[root@XenServer /]#  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


10、通過Xftp 軟件將 下載好的iso鏡像文件上傳到/opt /iso 目錄中 注意更改 文件權限755

在這就可以轉到XenCenter客戶端操作了


本文出自 “黑色時間” 博客,請務必保留此出處http://blacktime.blog.51cto.com/11722918/1811663


注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2021 ITdaan.com