UNIX磁盘管理

来源:互联网 发布:ubuntu 设置 gateway 编辑:程序博客网 时间:2024/05/21 18:39

1.在HP-UX下列出所有逻辑卷
# df -k
/home(/dev/vg00/lvol5): 20166 total allocated Kb
4945 free allocated Kb
15221 used allocated Kb
75 % allocation used
/opt (/dev/vg00/lvol6):615914 total allocated Kb
227403 free allocated Kb
388511 used allocated Kb
63 % allocation used
/tmp (/dev/vg00/lvol4):64215 total allocated Kb
20564 free allocated Kb
43651 used allocated Kb
67 % allocation used
/u01 (/dev/vg01/u01 ):17580720 total allocated Kb
12117048 free allocated Kb
5463672 used allocated Kb
31 % allocation used
df -k命令是比较通用的查看逻辑卷信息的命令,在tru64、aix下都可以使用。
2.在HP-UX下显示卷的具体信息:
# lvdisplay /dev/vg00/u01
--- Logical volumes ---
LV Name /dev/vg00/lvol3
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 140
Current LE 35
Allocated PE 70
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default
3.

HP-UNIX下使用bdf 查看磁盤空间

一个根据不同的Unix使用不同的命令来查看磁盘挂接位置的脚本
HP-UX下查看磁盘mount位置可用bdf命令,而其他好多版本都可以用df -k命令。我们这个脚本的名字就叫做dialect_df.ksh。
#!/bin/ksh
#**************************************************
# Set up the dialect changes for
# HP-UX and AIX (df -k) vs (bdf)
#**************************************************
os=`uname -a|awk '{ print $1 }'`
if [ $os = "OSF1" ]
then
df -k
fi
if [ $os = "AIX" ]
then
df -k
fi

if [ $os = "IRIX64" ]
then
df -k
fi
if [ $os = "HP-UX" ]
then
bdf
fi