操作大致如下:
# vgdisplay -v |more
查看vg00中是否还有剩余空间可供扩展swap用。剩余空间用PE-physical extents表示,每个PE都对应大小,可以用Free PE数量乘以PE大小算得。
#swapinfo -at
查看当前swap分区的信息。
#lvcreate -L 1024M -n myswap /dev/vg00
在vg00上创建大小为1G的lv,并命名为myswap。
#vi /etc/fstab
添加行:
/dev/vg00/myswap /myswap swap defaults 0 0
#swapon /dev/vg00/myswap
激活新添加的swap分区。
#swapinfo -at
确认新swap已经添加。
操作日志:
hostname
rp4440
# cstm << EOF
> map
> selall
> info
> il
> EOF
Running Command File (/usr/sbin/stm/ui/config/.stmrc).
-- Information --
Support Tools Manager
Version D.02.00
Product Number B4708AA
(C) Copyright Hewlett Packard Co. 1995-2007
All Rights Reserved
Use of this program is subject to the licensing restrictions described
in "Help-->On Version". HP shall not be liable for any damages resulting
from misuse or unauthorized use of this program.
cstm>map
rp4440
Dev Last Last Op
Num Path Product Active Tool Status
=== ==================== ========================= =========== =============
1 system system ()
2 0 Bus Adapter (880)
3 0/0 PCI Bus Adapter (783)
4 0/0/1/0 RS-232 Interface (103c129
5 0/0/1/1 RS-232 Interface (103c104
6 0/0/2/0 USB Open Host Controller
7 0/0/2/1 USB Open Host Controller
8 0/0/2/2 USB Enhanced Host Control
9 0/0/3/0 IDE Bus Adapter (10950649
10 0/0/3/0.0 IDE Interface (10950649)
11 0/0/3/0.0.0.0 Optical Storage Device (T
12 0/0/3/0.1 IDE Interface (10950649)
13 0/1 PCI Bus Adapter (783)
14 0/1/1/0 PCI SCSI Interface (10000
15 0/1/1/0.1.0 SCSI Disk (HP73.4GST37345
16 0/1/1/1 PCI SCSI Interface (10000
17 0/1/2/0 PCI Gigabit Ethernet Link
18 0/2 PCI Bus Adapter (783)
19 0/4 PCI Bus Adapter (783)
20 0/5 PCI Bus Adapter (783)
21 0/6 PCI Bus Adapter (783)
22 8 MEMORY (af)
23 16 IPMI Controller (4)
24 128 CPU (884) Information Successful
25 129 CPU (884) Information Successful
cstm>info
^-- (Information) is currently disabled. --
cstm>il
^-- (InfoLog) is currently disabled. --
cstm>#.
#
#
#
# vgdisplay -v |more
[0K--- 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 1
Act PV 1
Max PE per PV 4384
VGDA 2
PE Size (Mbytes) 16
Total PE 4375
Alloc PE 1766
Free PE 2609
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
LV Status available/syncd
LV Size (Mbytes) 8192
Current LE 512
Allocated PE 512
Used PV 1
LV Name /dev/vg00/lvol3
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 64
Allocated PE 64
Used PV 1
LV Name /dev/vg00/lvol4
LV Status available/syncd
LV Size (Mbytes) 512
Current LE 32
Allocated PE 32
Used PV 1
# perl -we 'print 20609 * 16 / 1024'
40.765625#
#
#
# swapinfo -a
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/lvol2
reserve - 127512 -127512
memory 3987456 648236 3339220 16%
# echo $TERM
vt100
# vmstat 1 5
procs memory page faults cpu
r b w avm free re at pi po fr de sr in sy cs us sy id
1 2 0 31784 807377 0 0 41 0 0 0 0 592 5420 206 1 3 96
1 2 0 31784 807377 0 0 0 0 0 0 0 545 1051 150 0 1 99
1 2 0 31784 807319 0 0 0 0 0 0 0 560 862 147 0 1 99
1 2 0 31784 807319 0 0 0 0 0 0 0 571 711 146 1 0 99
1 1 0 34852 807436 0 0 0 0 0 0 0 568 600 132 1 1 98
#lvcreate -L 8192M -n myswap /dev/vg00
Logical volume "/dev/vg00/myswap" has been successfully created with
character device "/dev/vg00/rmyswap".
Logical volume "/dev/vg00/myswap" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# vi /etc/fstab
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /tmp vxfs delaylog 0 2
/dev/vg00/lvol5 /home vxfs delaylog 0 2
/dev/vg00/lvol6 /opt vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
#the line below is added
/dev/vg00/myswap /myswap swap defaults 0 0
"/etc/fstab" 10 lines, 456 characters
# mkdir /myswap
# swapon -a
Enabling device paging on /dev/vg00/myswap.
# swapinfo -ta
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/lvol2
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/myswap
reserve - 127224 -127224
memory 3987456 664648 3322808 17%
total 20764672 791872 19972800 4% - 0 -
# which dd
/usr/bin/dd
# ls /dev/zero
/dev/zero
# ls /
.profile bin dev etc lib myswap opt stand usr
.sw d_cfg_mnt_sb61 envs.cfg.p3 home lost+found net sbin tmp var
# cat /etc/fstab
# System /etc/fstab file. Static information about the file systems
# See fstab(4) and sam(1M) for further details on configuring devices.
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /tmp vxfs delaylog 0 2
/dev/vg00/lvol5 /home vxfs delaylog 0 2
/dev/vg00/lvol6 /opt vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
/dev/vg00/myswap /myswap swap defaults 0 0
# ls /myswap
# swapinfo -ta
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/lvol2
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/myswap
reserve - 121544 -121544
memory 3987456 664708 3322748 17%
total 20764672 786252 19978420 4% - 0 -
# dd if=/dev/zero of=/myswap/testfiledd bs=1024 count=10000000
vxfs: msgcnt 2 mesg 001: V-2-1: vx_nospace - /dev/root file system full (1 block extent)I/O error
704745+0 records in
704744+1 records out
# swapinfo -at
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/lvol2
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/myswap
reserve - 121280 -121280
memory 3987456 668028 3319428 17%
total 20764672 789308 19975364 4% - 0 -
# cd /myswap
# rm *
# df
/dev/deviceFileSystem (DevFS ): 0 blocks 0 i-nodes
/home (/dev/vg00/lvol5 ): 216112 blocks 3376 i-nodes
/opt (/dev/vg00/lvol6 ): 3148272 blocks 49546 i-nodes
/tmp (/dev/vg00/lvol4 ): 998176 blocks 15718 i-nodes
/usr (/dev/vg00/lvol7 ): 1726768 blocks 27169 i-nodes
/var (/dev/vg00/lvol8 ): 16971536 blocks 267250 i-nodes
/stand (/dev/vg00/lvol1 ): 3112576 blocks 282459 i-nodes
/ (/dev/vg00/lvol3 ): 1398544 blocks 21995 i-nodes
# df -h
df: illegal option -- h
usage : df [-F FStype] [-V] [-egiklnsvfb] [-t|-P] [-o specific_options]
[special | directory ...]
# df -T
df: illegal option -- T
usage : df [-F FStype] [-V] [-egiklnsvfb] [-t|-P] [-o specific_options]
[special | directory ...]
# df -t
/dev/deviceFileSystem (DevFS ): 0 blocks 0 i-nodes
6 total blocks 2 total i-nodes
6 used blocks 2 used i-nodes
0 percent minfree
/home (/dev/vg00/lvol5): 216112 blocks 3376 i-nodes
229376 total blocks 3392 total i-nodes
11584 used blocks 16 used i-nodes
0 percent minfree
/opt (/dev/vg00/lvol6): 3148272 blocks 49546 i-nodes
10158080 total blocks 104384 total i-nodes
6985152 used blocks 54838 used i-nodes
0 percent minfree
/tmp (/dev/vg00/lvol4): 998176 blocks 15718 i-nodes
1048576 total blocks 15744 total i-nodes
42544 used blocks 26 used i-nodes
0 percent minfree
/usr (/dev/vg00/lvol7): 1726768 blocks 27169 i-nodes
6062080 total blocks 52512 total i-nodes
4321872 used blocks 25343 used i-nodes
0 percent minfree
/var (/dev/vg00/lvol8): 16971536 blocks 267250 i-nodes
17825792 total blocks 279936 total i-nodes
721216 used blocks 12686 used i-nodes
0 percent minfree
/stand (/dev/vg00/lvol1): 3112576 blocks 282459 i-nodes
3552112 total blocks 282624 total i-nodes
84320 used blocks 165 used i-nodes
10 percent minfree
/ (/dev/vg00/lvol3): 1398544 blocks 21995 i-nodes
2097152 total blocks 24256 total i-nodes
687648 used blocks 2261 used i-nodes
0 percent minfree
# swapinfo -t
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/lvol2
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/myswap
reserve - 120244 -120244
memory 3987456 668028 3319428 17%
total 20764672 788272 19976400 4% - 0 -
# swapinfo -a
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/lvol2
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/myswap
reserve - 120244 -120244
memory 3987456 668028 3319428 17%
# shutdown -yh 0
SHUTDOWN PROGRAM
01/06/11 13:15:16 EAT
Broadcast Message from root (console) Thu Jan 6 13:15:16...
SYSTEM BEING BROUGHT DOWN NOW ! ! !
/sbin/auto_parms: DHCP access is disabled (see /etc/auto_parms.log)
.*s1^i
System shutdown in progress
___________________________
Stop Highly Available cluster ................................... N/A
Stopping Control Daemon ......................................... N/A
Stopping OVTrcSrv... ............................................ OK
Stop NDDB Comm Server ........................................... N/A
Stop kwdbd ...................................................... N/A
Stopping HP-UX Apache-based Web Server .......................... OK
Stopping HP-UX Tomcat-based Servlet Engine. ..................... OK
Stopping HP-UX Webmin-based Admin ............................... OK
Stopping the HPUX Webproxy subsystem ............................ OK
Stopping HP-UX XML Web Server Tools ............................. OK
Stop NFS server subsystem ....................................... OK
Shutting down CIFS Client ....................................... N/A
Stopping Event Monitoring Service ............................... OK
Shutting down the Winbind Daemon ................................ OK
Unload/Uninstall XF86 DLKM Helper Modules ....................... N/A
Stopping the gWLM Agent ......................................... OK
Stop Workload Manager subsystem ................................. OK
Reset PRM and shut down PRM daemons ............................. OK
Shutting down the System Management HomePage server ............. OK
Shutting down OVPA performance software ......................... OK
Stopping USB hub daemon ......................................... OK
Stop auditing subsystem ......................................... OK
Stop environment monitoring daemon .............................. OK
Stop diagnostic subsystem ....................................... OK
Stop clock daemon ............................................... OK
Stop print spooler .............................................. OK
Stop accounting ................................................. N/A
Stopping time synchronization ................................... N/A
Stop vt daemon .................................................. OK
Terminating X Font Server ....................................... OK
Stopping HP-UX Secure Shell ..................................... OK
Stopping Instant Capacity ....................................... OK
Stop CIM cimserver subsystem .................................... OK
Stop RPC daemon ................................................. OK
Stop DCE daemons ................................................ OK
Stop HA cluster SNMP subagent ................................... OK
Stopping OSPF MIB Network Management subAgent ................... N/A
Stopping SNMP HP-UNIX Network Management subAgent ............... OK
Stopping SNMP IPv6 Network Management subAgent .................. OK
Stopping SNMP MIB-2 Network Management subAgent ................. OK
Stopping Native Adapter Agent ................................... OK
Stopping SNMP Trap Dest Network Management subAgent ............. OK
Stopping SNMP Master Network Management daemon .................. OK
Stopping outbound connection daemons for DDFA software .......... N/A
Stopping syslog-ng daemons ...................................... N/A
Stopping cfengine's cfservd daemon .............................. N/A
Shutting down sendmail [Done] Shutting down sm-client [Done] .... OK
Stopping IPv6 router advertisement daemon ....................... N/A
Stopping remote system status daemon ............................ N/A
Stopping RARP protocol daemon ................................... N/A
Stop PPPoE configuration ........................................ N/A
Stop PPP configuration .......................................... OK
Stopping router discover protocol daemon ........................ N/A
Stopping ramd routing daemon .................................... N/A
Stopping dynamic routing daemon ................................. N/A
Stopping Internet services daemon ............................... OK
Stopping multicast routing daemon ............................... N/A
Stop AUTOFS subsystem ........................................... OK
Stop NFS client subsystem ....................................... OK
Stop lock manager subsystem ..................................... OK
Stop NIS client subsystem ....................................... OK
Stop ldap client daemon ......................................... OK
Stop NIS/LDAP server subsystem .................................. N/A
Stop NIS server subsystem ....................................... OK
Stop NFS core subsystem ......................................... OK
Stop Runner ..................................................... N/A
Stopping ISEE hpservices mad daemon. ............................ OK
Stopping name server daemon ..................................... N/A
VxVM VVR INFO V-5-4-2419 Stopping VRAS daemon ................... OK
VxVM VVR INFO V-5-4-2419 Stopping VxRSync daemon ................ OK
Unconfiguring DHCPv6 Interfaces ................................. OK
VxVM VVR INFO V-5-2-3620 Stopping Communication Daemon .......... OK
Stopping DHCPv6 Server daemon ................................... N/A
Unconfigure LAN interfaces ...................................... OK
Unconfigure LAN interfaces for IPv6 ............................. OK
Unconfigure HP gelan Gigabit Ethernet interfaces ................ OK
Unconfigure HP iether 100BT/Gigabit Ethernet interfaces ......... OK
Unconfigure HP igelan Gigabit Ethernet interfaces ............... OK
Stop network tracing and logging daemon ......................... OK
Stop pty allocator daemon ....................................... OK
Stop system message logging daemon .............................. OK
Stopping sfmdb PostgreSQL daemons ............................... OK
Stop Software Distributor agent daemon .......................... OK
Stop Essential Services monitoring daemon ....................... OK
Stopping Event Management (EVM) ................................. OK
Unconfigure Loopback interfaces (lo0) ........................... OK
Stopping VERITAS Enterprise Administrator Service (vxsvc) ....... OK
Stop Utmp Daemon ................................................ OK
Stopping livedump subsystem ..................................... OK
Stop syncer daemon .............................................. OK
Killing user processes .......................................... OK
Starting the fsdaemon for transition into single-user mode ...... OK
Apply kernel configuration changes for next boot ................ N/A
Unmount file systems ............................................ OK
VxVM INFO V-5-2-3254 Stopping all Volume Manager I/O Daemons .... OK
Transition to run-level 0 is complete.
Executing "/sbin/reboot -h ".
Shutdown at 13:16 (in 0 minutes)
*** FINAL System shutdown message from ***
System going down IMMEDIATELY
System shutdown time has arrived
vxfs: NOTICE: msgcnt 1 mesg 001: V-2-1: vx_nospace - /dev/root file system full (1 block extent)
sync'ing disks (0 buffers to flush):
0 fcache pages still dirty
0 buffers not flushed
0 buffers still dirty
Calling function a1c530 for Shutdown State 5 type 0x1
Calling function 5b3248 for Shutdown State 5 type 0x1
Closing open logical volumes...
Done
Firmware Version 44.21
Duplex Console IO Dependent Code (IODC) revision 1
System has halted
OK to turn off power or reset system
UNLESS "WAIT for UPS to turn off power" message was printed above
MP MAIN MENU:
CO: Console
VFP: Virtual Front Panel
CM: Command Menu
CL: Console Log
SL: Show Event Logs
HE: Main Help Menu
X: Exit Connection
[rp4440-mp] MP> pc -off
*** Invalid Selection ***
MP MAIN MENU:
CO: Console
VFP: Virtual Front Panel
CM: Command Menu
CL: Console Log
SL: Show Event Logs
HE: Main Help Menu
X: Exit Connection
[rp4440-mp] MP> cm
(Use Ctrl-B to return to MP main menu.)
[rp4440-mp] MP:CM> cp pc -off
PC -off
System will be powered off.
You must shut down the OS manually before this command is executed.
Failure to do this can cause problems when the OS is restarted.
Confirm? (Y/[N]): y
y
-> System is being powered off.
-> Command successful.
[rp4440-mp] MP:CM> co
The system is ready.
GenericSysName [HP Release B.11.31] (see /etc/issue)
Console Login: root
Password:
Last successful login: Thu Jan 6 13:02:38 EAT 2011 /dev/console
Please wait...checking for disk quotas
# swapinfo -ta
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/lvol2
dev 8388608 0 8388608 0% 0 - 1 /dev/vg00/myswap
reserve - 118420 -118420
memory 3987456 661520 3325936 17%
total 20764672 779940 19984732 4% - 0 -