hp-ux創建lv實例
1. vgdisplay查看卷組
[root@jcsrv2:/]# vgdisplay
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 3
Act PV 3
Max PE per PV 4350
VGDA 6
PE Size (Mbytes) 8
Total PE 13020
Alloc PE 12825
Free PE 195
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
VG Name /dev/vg_jc
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 24
Open LV 24
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 1600
VGDA 4
PE Size (Mbytes) 128
Total PE 2398
Alloc PE 1929
Free PE 469
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
2. 在vg00卷組中 創建 一個10M的 名字 為xyy的邏輯卷
[root@jcsrv2:/]# lvcreate -L 10 -n xyy /dev/vg00/xyy
lvcreate: Volume group "/dev/vg00/xyy" does not exist in the "/etc/lvmtab" file.
[root@jcsrv2:/]# lvcreate -L 10 -n xyy /dev/vg00
Warning: rounding up logical volume size to extent boundary at size "16" MB.
Logical volume "/dev/vg00/xyy" has been successfully created with
character device "/dev/vg00/rxyy".
Logical volume "/dev/vg00/xyy" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
3.查看是否存在 xyy 邏輯卷
[root@jcsrv2:/]# lvdisplay /dev/vg00/xyy
--- Logical volumes ---
LV Name /dev/vg00/xyy
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 16
Current LE 2
Allocated PE 2
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default
4.為 /dev/vg00/xyy 邏輯卷 創建文件系統
newfs -F vxfs /dev/vg00/rxyy
5. mkdir /xyy //創建一個掛載點
6. mount /dev/vg00/xyy /xyy //掛載新創建的文件系統
7.bdf //進行查看
[root@jcsrv2:/]# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 2048000 513552 1522760 25% /
/dev/vg00/lvol1 497584 74360 373464 17% /stand
/dev/vg00/lvol8 3072000 1020760 2035576 33% /var
/dev/vg00/lvol7 5120000 1685792 3407448 33% /usr
/dev/vg00/lvol6 3072000 406376 2645760 13% /tmp
/dev/vg00/lvol5 12288000 7919968 4343296 65% /opt
/dev/vg00/lvol4 516096 15544 496712 3% /home
/dev/vg00/xyy 16384 1117 14320 7% /xyy
[root@jcsrv2:/]#
8.umount /xyy //取消掛載
9. lvremove /dev/vg00/xyy //刪除 /dev/vg00/xyy 邏輯卷
[root@jcsrv2:/]# lvremove /dev/vg00/xyy
The logical volume "/dev/vg00/xyy" is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume "/dev/vg00/xyy" has been successfully removed.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
10. [root@jcsrv2:/]# lvdisplay /dev/vg00/xyy
lvdisplay: "/dev/vg00/xyy": No such file or directory
//發現已經不存在了