您的位置:首页 > 其它

HP-UX一些文件系统查询命令

2010-12-08 22:13 162 查看
HP-UX一些文件系统查询命令

1.查看硬盘信息

# ioscan -funC disk
Class I H/W Path Driver S/W State H/W Type Description
===============================================================================
disk 1 0/0/2/1.0.16 UsbScsiAdaptor CLAIMED DEVICE USB SCSI St
/dev/deviceFileSystem/Usb/MassStorage/dsk/disk@hp-1008
/dev/deviceFileSystem/Usb/MassStorage/rdsk/disk@hp-100
disk 2 0/4/1/0.0.0.0.0 sdisk CLAIMED DEVICE HP
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
/dev/dsk/c0t0d0s1 /dev/rdsk/c0t0d0s1
/dev/dsk/c0t0d0s2 /dev/rdsk/c0t0d0s2
/dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3

/dev/dsk/c0t0d0 。。。为块设备

/dev/rdsk/c0t0d0。。。为字符设备

/dev/dsk/c0t0d0s1 /dev/rdsk/c0t0d0s1。。。为片相当于物理上的磁盘分区

为什么服务器上有2个硬盘但是只显示一个呢?

因为用SCIS卡做了镜像

2.Default volume group

HP-UX的Default volume group 叫做VG00 AIX的叫做ROOTVG

OS都是装在VG00下面,建议不要在VG00下面安装其他SOFTWARE

cd /dev/vg00

# ll
total 0
crw-r----- 1 root sys 64 0x000000 Oct 15 22:06 group
brw-r----- 1 root sys 64 0x000009 Nov 6 11:09 lv_ora
brw-r----- 1 root sys 64 0x000001 Oct 15 22:06 lvol1
brw-r----- 1 root sys 64 0x000002 Oct 15 22:06 lvol2

。。。

# vgdisplay -v vg00

这个命令还会查看PV 与LV的信息
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 9
Open LV 9
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 4320
VGDA 2
PE Size (Mbytes) 16
Total PE 4310
Alloc PE 4184
Free PE 126
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 1.0.0

--- Logical volumes ---
LV Name /dev/vg00/lvol1
LV Status available/syncd
LV Size (Mbytes) 1792
Current LE 112
Allocated PE 112
Used PV 1

LV Name /dev/vg00/lvol2

。。。

--- Physical volumes ---
PV Name /dev/disk/disk3_p2 HP的V3版本会用别名代替磁盘名称不会是c0y0d0而是disk3_p2
PV Status available
Total PE 4310
Free PE 126
Autoswitch On
Proactive Polling On

3.查看磁盘的PV情况

# pvdisplay /dev/disk/disk3_p2
--- Physical volumes ---
PV Name /dev/disk/disk3_p2
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 9
PE Size (Mbytes) 16
Total PE 4310
Free PE 126
Allocated PE 4184
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On
Proactive Polling On

4.查看VGXX下有多少空间

vgdisplay -v vg00

。。。

PE Size (Mbytes) 16
Total PE 4310
Alloc PE 4218
Free PE 92

。。。

Free PE * PE Size=最后VG剩余的大小 单位为M 96*12=1472M

5.在VG00下建立LV(逻辑卷)

卷的大小为100M

# lvcreate -L 100 vg00

Warning: rounding up logical volume size to extent boundary at size "112" MB.
Logical volume "/dev/vg00/lvol10" has been successfully created with
character device "/dev/vg00/rlvol10".
Logical volume "/dev/vg00/lvol10" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

建立成功但是之前查出PE大小为16M则建立后的大小 16*7=112MB

6.验证

vgdisplay -v vg00

。。。

LV Name /dev/vg00/lvol10
LV Status available/syncd
LV Size (Mbytes) 112
Current LE 7
Allocated PE 7
Used PV 1

。。。

7.LV上建立文件系统

# newfs -F vxfs /dev/vg00/rlvol10
version 6 layout
114688 sectors, 114688 blocks of size 1024, log size 1024 blocks
largefiles supported

vxfs为文件系统,如果为hfs则更换为hfs

8.将一个文件系统mount 到一个目录下面

建立目录

# mkdir /lv10

mount 到一个目录下面

# mount /dev/vg00/lvol10 /lv10

验证

# bdf

。。。

/dev/vg00/lvol10 114688 1754 105883 2% /lv10

。。。

9.将LV10删除

# umount /lv10
# bdf

查看无LV10信息。

# lvremove /dev/vg00/lvol10
The logical volume "/dev/vg00/lvol10" is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume "/dev/vg00/lvol10" has been successfully removed.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00

验证

# vgdisplay -v vg00
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: