HPUX_官方收费培训文档_第1页
HPUX_官方收费培训文档_第2页
HPUX_官方收费培训文档_第3页
HPUX_官方收费培训文档_第4页
HPUX_官方收费培训文档_第5页
已阅读5页,还剩141页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、HP-UX 11i系统管理系统管理邓攀邓攀pan_中国惠普有限公司中国惠普有限公司2006年年1月月目录目录HP-UX 基本命令基本命令文件系统文件系统日志文件日志文件常用系统文件常用系统文件备份与恢复备份与恢复管理员的日常工作管理员的日常工作简易故障诊断简易故障诊断HP-UX 基本命令基本命令# uname -a列出系统列出系统ID ID 号,号,OSOS版本及用户权限等信息。版本及用户权限等信息。# hostname列出系统网络名称。列出系统网络名称。# # ioscanioscan -fn -fn 列出各列出各I/OI/O卡及设备的所有相关信息:如逻辑单元号,硬件地址及设卡及设备的所有相

2、关信息:如逻辑单元号,硬件地址及设备文件名等。备文件名等。# # psps - -efef列出正在运行的所有进程的各种信息:如进程号及进程名等列出正在运行的所有进程的各种信息:如进程号及进程名等HP-UX 基本命令基本命令# mountmount列出已加载的逻辑卷及其加载位置列出已加载的逻辑卷及其加载位置# # umountumount / 卸载挂在卸载挂在/ / 下的下的逻辑卷逻辑卷# fuser -cu / 列出使用列出使用 / 的进程的进程IDID及用户名及用户名。 # fuser -# fuser -kckc / Kill Kill 使用使用 / 的所有进程的所有进程。 HP-UX 基

3、本命令基本命令findfindfind命令是功能最强的命令之一,但同时也是命令行结构最难以掌命令是功能最强的命令之一,但同时也是命令行结构最难以掌握的命令之一。握的命令之一。#find / -print | #find / -print | wcwc -l -l 显示系统中所有文件和目录的数目显示系统中所有文件和目录的数目 # find / -user $LOGNAME -print # find / -user $LOGNAME -print 显示系统中该用户所有文件和目录。显示系统中该用户所有文件和目录。# find . -exec chown $LOGNAME # find . -exe

4、c chown $LOGNAME ; 修改当前目录下的所有文件的用户所属。修改当前目录下的所有文件的用户所属。 # find . -type d -exec # find . -type d -exec chmodchmod 770 770 ;修改当前目录下的所有目录的权限。修改当前目录下的所有目录的权限。HP-UX 基本命令基本命令find#find / -size 100 -print #find / -size 100 -print 显示文件大小为显示文件大小为100 blocks 100 blocks # find / -size -100 -print # find / -size

5、-100 -print 显示文件大小小于显示文件大小小于100 blocks 100 blocks # find / -# find / -xdevxdev -size +100 -print -size +100 -print 显示文件大小大于显示文件大小大于100 blocks 100 blocks # find / -name core -exec # find / -name core -exec rmrm ;查找并删除查找并删除corecore文件文件 HP-UX 基本命令基本命令# # croncroncron(chronographycron(chronography,计时计时)

6、 ),每分钟苏醒一次,查看控制文,每分钟苏醒一次,查看控制文件以确定当时是否存在应运行的作业,存在则运行该作业。件以确定当时是否存在应运行的作业,存在则运行该作业。 # # crontabcrontab filename ; filename ; 创建一个创建一个 croncron # # crontabcrontab -r ; -r ; 把把croncron从从crontabcrontab去掉去掉 crontabcrontab位位于目录于目录/ /var/spool/cron/crontabsvar/spool/cron/crontabs下,下, 每个用户的每个用户的croncron文件名是

7、其用户名。文件名是其用户名。 # passwd# passwd修改当前用户口令修改当前用户口令HP-UX 基本命令基本命令# # swlistswlist列列出系统所装软件产品信息。出系统所装软件产品信息。# tail # tail 和和 headhead使使用用tailtail命令可以查看文件的尾部,命令可以查看文件的尾部,headhead命令则查看文件的头部。命令则查看文件的头部。 # tail filename # tail filename 或或 # head filename # head filename # tail -f filename # tail -f filename

8、使使tailtail不断执行,当文件被写入时显示文件的新行不断执行,当文件被写入时显示文件的新行 。# # dmesgdmesg从从系统内存中显示系统状态信息系统内存中显示系统状态信息HP-UX HP-UX 基本命令基本命令# # fsckfsck 文件系统一致性检测及修复。文件系统一致性检测及修复。# init 0 # init 0 或或 shutdown y 0shutdown y 0 进入单用户状态。进入单用户状态。# # whereiswhereis 显示命令路径。显示命令路径。# # bdfbdf 显示系统剩余空间信息显示系统剩余空间信息# du -s # du -s 显示显示 下所

9、有文件所占空间下所有文件所占空间( (以块为单位以块为单位) )HP-UX 基本命令基本命令# # swapinfoswapinfo显示系统交换区信息显示系统交换区信息# # pvdisplaypvdisplay -v /dev/ -v /dev/dsk/cdsk/c* *t t* *d d* * 显示磁盘各种信息,如磁盘大小,包含的逻辑卷,设备名称等。显示磁盘各种信息,如磁盘大小,包含的逻辑卷,设备名称等。 c c:controllercontroller,和磁盘联接的控制器有关。和磁盘联接的控制器有关。 t t:targettarget,每个磁盘有一个唯一的每个磁盘有一个唯一的target

10、target数字,只有磁盘设备数字,只有磁盘设备本身才可以修改。本身才可以修改。 d d:device unit numberdevice unit number,对于非共享控制器而对于非共享控制器而 言,该值将言,该值将为为0 0,对于共享控制器,对于共享控制器 而言,该值将为磁盘设备单元的内部号。而言,该值将为磁盘设备单元的内部号。HP-UX 基本命令基本命令# vgdisplayvgdisplay -v /dev/vg00 -v /dev/vg00显示逻辑卷组信显示逻辑卷组信息,如包含哪些逻辑卷及物理盘等息,如包含哪些逻辑卷及物理盘等# # lvdisplaylvdisplay -v /

11、dev/vg00/lvol1 -v /dev/vg00/lvol1显示逻辑卷各种信息,显示逻辑卷各种信息,如包含哪些盘,是否有镜像等如包含哪些盘,是否有镜像等# man # man 了解了解命令的使用方法及作用命令的使用方法及作用grepgrep 什么是 Logical Volume Manager?disc MANAGEMENT subsystemNOT a filesystemapplicationdevicefilediscdriverLVMHP-UX kernelLVMLVM原理原理physical volumes物理卷物理卷对应单个硬盘或磁盘阵对应单个硬盘或磁盘阵列柜里的列柜里的LU

12、NVolume group卷组卷组Logical volumes逻辑卷逻辑卷VG01VG01lvol1/dev/rdsk/c0t0d0/dev/rdsk/c0t1d0lvol3lvol2磁盘使用分类磁盘使用分类1 1 :内置或外置磁盘:内置或外置磁盘 内置硬盘和单独的外置磁盘或无内置硬盘和单独的外置磁盘或无raidraid功能的磁盘柜:功能的磁盘柜:A3312 A3312 SC10SC10磁盘使用分类磁盘使用分类2: SCSI磁盘阵列柜磁盘阵列柜外置的外置的SCSISCSI磁盘阵列柜:磁盘阵列柜: AutoRaidAutoRaid 使用使用iosaniosan等命令只能看到控制器和等命令只能看

13、到控制器和LUNLUN(logic unitlogic unit)。如果需要查看具体的物理)。如果需要查看具体的物理硬盘信息,可使用以下命令:硬盘信息,可使用以下命令:#arraydsp i(#arraydsp i(显示显示autoraid autoraid 序列号)序列号) Arrays known to the Arrays known to the ARMServerARMServer: : arrays with S/N: 000000786B74 arrays with S/N: 000000786B74#arraydsp a (#arraydsp a (显示显示autoraidau

14、toraid相关部件全部信相关部件全部信息)息) Disk Modules Cooling Fans Power Supply Module Controller LCD Display Control Panel 磁盘使用分类磁盘使用分类3:光纤磁盘阵列柜:光纤磁盘阵列柜1惠普外置的光纤磁盘阵列柜最主要有两种惠普外置的光纤磁盘阵列柜最主要有两种: :FC60FC60: VAVA系列(系列(VA7110VA7110,VA7410VA7410等)等) 磁盘使用分类磁盘使用分类3 3:光纤磁盘阵列柜:光纤磁盘阵列柜2 2 使用使用ioscanioscan等命令只能看到控制器和等命令只能看到控制器和

15、LUNLUN(logic logic unitunit)。如果需要查看具体的物理硬盘信息,可使用)。如果需要查看具体的物理硬盘信息,可使用以下命令:以下命令: FC60FC60: # #amdspamdsp i( i(显示显示FC60FC60序列号)序列号)# #amdspamdsp -a ( -a (显示显示FC60FC60相关部件全部信息相关部件全部信息) )VAVA系列系列# #armdsparmdsp i( i(显示显示FC60FC60序列号)序列号)# #armdsparmdsp -a ( -a (显示显示FC60FC60相关部件全部信息相关部件全部信息) )使用使用ioscanio

16、scan查看外设查看外设# ioscan fClass I H/W Path Driver S/W State H/W Type Description=root 0 root CLAIMED BUS_NEXUS cell 0 0 cell CLAIMED BUS_NEXUS ioa 0 0/0 sba CLAIMED BUS_NEXUS SBAba 0 0/0/0 lba CLAIMED BUS_NEXUS LBAlan 0 0/0/0/1/0 gelan CLAIMED INTERFACE 1000Base-T ext_bus 0 0/0/0/2/0 c720 CLAIMED INTERF

17、ACE SCSI Fast Wide disk 0 0/0/0/2/0.6.0 sdisk CLAIMED DEVICE HP Diskctl 0 0/0/0/2/0.7.0 sctl CLAIMED DEVICE Initiator# ioscan # short listing of all devices# ioscan -f # full listing of all devices# ioscan -kf # full listing, using cached information# ioscan -fH 0/0/0/1/0 # full listing of device at

18、 0/0/0/1/0# ioscan -fC disk # full listing of disk class devices上表中的上表中的I I(红色)(红色)是是Instance,Instance,是按照硬件加入顺序顺序是按照硬件加入顺序顺序生成的,一旦生成就不会自动改变生成的,一旦生成就不会自动改变使用使用ioscanioscan查看相关设备文件查看相关设备文件# ioscan -funlist all devices and device files# ioscan -funC disklist all disk devices and device files# ioscan -

19、funC tapelist all tape drives and device files# ioscan funH 0/0/1/0/0.0.0list all device files for the device at 0/0/1/0/0.0.0Class Itape 1DescriptionHP C1553AH/W Path0/0/1/0/0.0.0 DriverstapeS/W StateCLAIMED/dev/rmt/1m/dev/rmt/1mb/dev/rmt/1mn/dev/rmt/1mnbH/W TypeDEVICEUse the ioscan command to dete

20、rmine which device files are associatedwith which devices on your system./dev/rmt/c0tld0BESTb/dev/rmt/c0tld0BESTn/dev/rmt/c0tld0BESTnb/dev/rmt/c0tld0BEST=硬件路径硬件路径1 10/0/1/0/0.6.0Cell or Bus Number (partitionable servers only)SBA( system bus adapters) NumberLBA ( local bus adapters) NumberPCI Address

21、Function NumberSCSI Target AddressLUN NumberSBALBALBAPCI BusDevice AdapterCore I/OLANSCSISerialPCI BusDevice AdapterCell BoardORCPU/MemoryCellCell/ /SBASBA/ /LBALBA/ /DeviceDevice/ /FunctionFunction. .TargetTargetCellCell = The global cell number (0-3 on HP rp8400) or = The global cell number (0-3 o

22、n HP rp8400) or Bus Number(Rp7400)Bus Number(Rp7400)SBASBA = An item on the bus: either a system bus = An item on the bus: either a system bus adapteradapter (SBA, 0), a (SBA, 0), a processorprocessor (10-13), or (10-13), or memorymemory (5). (5).Each I/O chassis has a single system bus adapter.Each

23、 I/O chassis has a single system bus adapter.LBALBA = A local bus adapter, one per PCI slot. = A local bus adapter, one per PCI slot. The LBA The LBA number is not necessarily the same as the slot numbernumber is not necessarily the same as the slot number. .DeviceDevice = Is the cards address on th

24、e slots PCI = Is the cards address on the slots PCI bus.bus.FunctionFunction = The function for the I/O card. Typically = The function for the I/O card. Typically this is 0 (zero) for single-function cards.this is 0 (zero) for single-function cards.TargetTarget = The target of the I/O device, or SCS

25、I ID. = The target of the I/O device, or SCSI ID. The The ioscanioscan and and radrad commands list information about commands list information about currently activecurrently active hardware in the hardware in the local partitionlocal partition only. only.硬件路径硬件路径2 2硬件路径硬件路径3 3cell/SBA/LBA/device/f

26、unction.targetCell 0Sys. BackplanePCI BackplaneCore IOSBALBAserial mux (0)SCSI (dev =3)LAN (dev =1)SCSI (dev=2) controller (0.7)controller (1.7)(0)6DVD2OV84-0176controller (0.7)(0)controller (1.7)External SCSI内置硬盘或外置的内置硬盘或外置的SCSISCSI硬盘,硬盘,DVDDVDSCSI cardTerminator# ioscanH/W Path Class Description=0

27、/0/0/2 ext_bus FW-SCSI Interface0/0/0/2/0.0.0 tape HP DDS Tape0/0/0/2/0.2.0 disk HP DVD ROM0/0/0/2/0.5.0 disk HP Disk0/0/0/2/0.6.0 disk HP Disk0/0/0/2/0.7.0 sctl Initiator0/0/0/2/0.5.0Logical Unit NumberSCSI Target AddressInterface Card Address652070/0/0/2/0.5.0SCSI cardLUN0LUN1# ioscan -uH/W Path C

28、lass Description=0/0/0/2/0 ext_bus FW-SCSI Interface0/0/0/2/0.5.0 disk HP Disk0/0/0/2/0.5.1 disk HP Disk0/0/0/2/0.5.2 disk HP Disk0/0/0/2/0.7.0 sctl InitiatorLogical Unit NumberSCSI Target AddressInterface Card AddressLUN2t=5外置外置SCSISCSI磁盘阵列柜磁盘阵列柜SCSI CardPV LinkPV Link# ioscan -uH/W Path Class Desc

29、ription=0/0/0/2/0 ext_bus FW-SCSI Interface0/0/0/2/0.5.0 disk HP Disk0/0/0/2/0.5.1 disk HP Disk0/0/0/2/0.5.2 disk HP Disk0/0/0/3/0 ext_bus FW-SCSI Interface0/0/0/3/0.6.0 disk HP Disk0/0/0/3/0.6.1 disk HP Disk0/0/0/3/0.6.2 disk HP DiskLUN0LUN1LUN2t=6SCSI Cardt=5N4000N4000双机连单个双机连单个AutoRaidAutoRaid连接图

30、连接图N4000N4000双机连单个双机连单个VA7400VA7400连接图连接图FC60FC60、VAVA控制器路径控制器路径1/4/0/0.1.18.255.2.7.0Peripheral Device Address on Public LoopHBAFibre Channel Virtual SCSI1/4/0/0:1/4/0/0:光纤卡设备路径光纤卡设备路径1 1:Switch Domain ID(Switch Domain ID(如果光纤交换机没有分如果光纤交换机没有分Domain,Domain,这个值缺省为这个值缺省为1 1)1818:Switch Port ID(Switch

31、Port ID(如果大于如果大于1616,则实际,则实际Port IDPort IDX X1616,所以这个例子是连接所以这个例子是连接port2port2)255255:如果这一位为:如果这一位为255255,表示这是连接一个,表示这是连接一个FC60FC60或或VAVA存储的控制器存储的控制器2.7.0:2.7.0:如果上一位为如果上一位为255255,则,则2.7.02.7.0显示为控制器的显示为控制器的Loop IDLoop ID对应的对应的AL_PAAL_PA值值(1616进制),进制),2727是是AL_PAAL_PA值,转换为值,转换为loop IDloop ID为为110110

32、(有一个(有一个AL_PAAL_PA对应对应LoopLoop ID ID的表)的表)FC60FC60、VA LUNVA LUN路径路径1/4/0/0.1.18.39.0.0.2Volume Set Addressing on Public Loop (Brocade)HBAFibre ChannelVirtual SCSI(LUN Number)1/4/0/0:1/4/0/0:光纤卡设备路径光纤卡设备路径1 1:Switch Domain ID(Switch Domain ID(如果光纤交换机没有分如果光纤交换机没有分Domain,Domain,这个值缺省为这个值缺省为1 1)1818:Swi

33、tch Port ID(Switch Port ID(如果大于如果大于1616,则实际,则实际Port IDPort IDX X1616,所以这个例子是连接所以这个例子是连接port2port2)3939:如果这一位为:如果这一位为0 0,表示这连接的是一个设为,表示这连接的是一个设为private loopprivate loop的的VAVA否则表否则表示为控制器的示为控制器的Loop IDLoop ID对应的对应的AL_PAAL_PA值(值(1010进制)进制), ,这个例子控制器的这个例子控制器的loop loop IDID是是110110。0.0.2:0.0.2:表示为表示为LUN I

34、DLUN ID,这个例子为,这个例子为LUN2LUN2设备文件和硬件路径的对应(设备文件和硬件路径的对应(SCSISCSI)/dev/dsk/c1t5d0# ioscan fClass I H/W Path Description=ext_bus 0 0/0/1/0/0 Fast/Wide SCSIdisk 0 0/0/1/0/0.3.0 SEAGATE ST32171Wdisk 1 0/0/1/0/0.4.0 SEAGATE ST32171Wext_bus 1 0/0/2/0/0 Fast/Wide SCSIdisk 2 0/0/2/0/0. 5 . 0 SEAGATE ST32171WCa

35、rd instanceTargetLUNoptionsDevice dependent options设备文件和硬件路径的对应(光纤)设备文件和硬件路径的对应(光纤)Card instanceTargetLUN# ioscan fClass I H/W Path Description=ext_busext_bus 5 1/0/2/0/0.8.0.4.0 FCP Array Interface 5 1/0/2/0/0.8.0.4.0 FCP Array Interfacedisk 5 1/0/2/0/0.8.0.4.0.0.0 HP disk 5 1/0/2/0/0.8.0.4.0.0.0 H

36、P A6188AA6188Adisk 6 1/0/2/0/0.8.0.4.0.0.1 HP disk 6 1/0/2/0/0.8.0.4.0.0.1 HP A6188AA6188Adisk 7 1/0/2/0/0.8.0.4.0.0.2 HP disk 7 1/0/2/0/0.8.0.4.0.0.2 HP A6188AA6188A。disk 12 1/0/2/0/0.8.0.4.0.0.7 HP disk 12 1/0/2/0/0.8.0.4.0.0.7 HP A6188AA6188Atarget 18 1/0/2/0/0.8.0.4.0.1 target 18 1/0/2/0/0.8.0.4

37、.0.1 disk 13 1/0/2/0/0.8.0.4.0.1.0 HP disk 13 1/0/2/0/0.8.0.4.0.1.0 HP A6188AA6188A/dev/dsk/c5t1d0使用使用 lssflssf查看设备文件查看设备文件# # lssflssf /dev/rdsk/c0t3d0 /dev/rdsk/c0t3d0 sdisksdisk card instance 0 SCSI target 3 SCSI LUN 0 card instance 0 SCSI target 3 SCSI LUN 0 section 0 at address 0/0/1/0/0.3.0 /d

38、ev/rdsk/c0t3d0 section 0 at address 0/0/1/0/0.3.0 /dev/rdsk/c0t3d0# # lssflssf /dev/rmt/0mn /dev/rmt/0mn stapestape card instance 1 SCSI target 0 SCSI LUN 0 card instance 1 SCSI target 0 SCSI LUN 0 at&t no rewind best density available at&t no rewind best density available at address 0/0/1/0

39、/0.0.0 /dev/rmt/0mn at address 0/0/1/0/0.0.0 /dev/rmt/0mnlssflssf 可以显示一个设备文件的详细信息可以显示一个设备文件的详细信息设备文件目录设备文件目录(/dev)(/dev)/devdskrdskrmtttyxpxttydxpxblock diskdevice filesraw diskdevice filestape drivedevice filesterminaldevice filesmodemdevice files 所有的设备文件都存放在所有的设备文件都存放在 /dev目录下目录下 硬盘、硬盘、CDROM、磁带机的设

40、备文件、磁带机的设备文件 存放在存放在/dev的子目录下的子目录下 其他的设备文件直接存放在其他的设备文件直接存放在 /dev目录下目录下使用使用insfinsf创建设备文件创建设备文件虽然系统启动时会自动运行虽然系统启动时会自动运行insf,不过在线添加新硬件等操作,不过在线添加新硬件等操作后需要使用这个命令创建设备文件后需要使用这个命令创建设备文件Create device files for any newly added auto-configurable Create device files for any newly added auto-configurable devices

41、:devices: # # insfinsf Re-create missing device files for all existing auto-Re-create missing device files for all existing auto-configurable devices:configurable devices: # # insfinsf -e -eCreate or recreate device files for a specific auto-Create or recreate device files for a specific auto-config

42、urable device: configurable device: # # insfinsf eHeH 0/0/1/0/0.3.0 0/0/1/0/0.3.0 See the See the insfinsf man page for many more options and examples! man page for many more options and examples!使用使用 SAM SAM 创建设备文件创建设备文件Actions +-+| Add. | Diagnose Missing Tape Drive | | = | Zoom. | | Remove. | | S

43、how Device Files +-+| Create Device Files - | Create Default Device Files |+-| Create Custom Device File. | +-+# sam - peripheral devices - tape drivesSAMSAM提供一个简单的方法来创建那些提供一个简单的方法来创建那些“insfinsf”不能自动创建的设备文件,不能自动创建的设备文件,例如磁带机某些特定设备文件例如磁带机某些特定设备文件使用使用mksfmksf创建设备文件创建设备文件如果你不能或不愿意使用如果你不能或不愿意使用SAM,SAM,可

44、以使用可以使用mksfmksfConfigure a DDS2, no-rewind device file for the tape drive at 0/0/1/0/0.0.0: # mksf H 0/0/1/0/0.0.0 b DDS2 nOr specify the tape drive to configure by class/instance: # mksf C tape I 1 b DDS2 nSee the mksf and mt man pages for many more options and examples!使用使用mknodmknod创建设备文件创建设备文件If

45、 a device isnt configurable via If a device isnt configurable via insfinsf or or mksfmksf, you can manually , you can manually create a device with custom major/minor numbers using create a device with custom major/minor numbers using mknodmknod. . mknodmknod must be used to create LVM volume group

46、device files, and must be used to create LVM volume group device files, and may be necessary to create device files for other vendors may be necessary to create device files for other vendors devices.devices.# # mknodmknod /dev/vg01/group c 64 0 x010000 /dev/vg01/group c 64 0 x010000Device File Name

47、Block/CharacterMajor#Minor#使用使用rmsfrmsf删除设备文件删除设备文件When a device is no longer needed, its device files should be removed via When a device is no longer needed, its device files should be removed via rmsfrmsf. . Remove a specific device file:Remove a specific device file: # # rmsfrmsf /dev/dsk/c0t3d0

48、 /dev/dsk/c0t3d0Remove all the device files associated with a device:Remove all the device files associated with a device: # # rmsfrmsf -a /dev/dsk/c0t3d0 -a /dev/dsk/c0t3d0 Or Or specify the devices hardware path: specify the devices hardware path: # # rmsfrmsf H H 0/0/1/0/0.3.0 0/0/1/0/0.3.0 LVM L

49、VM 如何管理硬盘如何管理硬盘lvol1lvol2PV1PV2lvol2lvol2lvol1lvol1PV3Logical VolumesPhysical VolumesVolume GroupLELE和和PEPE的对应的对应Logical VolumePhysicalVolume4 Mb4 Mb345674 Mb4 Mb1234567LogicalExtentPhysical ExtentPEPE非连续分布非连续分布LELE123456712345678910LELELELELEPEPEPEPEPEPEPEPEPEPELogical Extent table for lvol1Physica

50、l VolumePEPE非连续分布非连续分布2 2PEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPE/dev/rdsk/c0t0d0/dev/rdsk/c0t1d0/dev/rdsk/c0t2d0一个逻辑卷(一个逻辑卷(LVLV)可以分布在同一个卷组()可以分布在同一个卷组(VGVG)中的多个物理卷()中的多个物理卷(PVPV)上)上PEPE连续分布连续分布1 1LELE1234567LELELELELE1234567PEPEPEPEPEPEPEPEPE

51、连续分布连续分布2 2PEPEPEPEPEPEPEPE/dev/rdsk/c0t0d0PEPEPEPEPEPEPEPE/dev/rdsk/c0t1d0PEPEPEPEPEPEPEPE/dev/rdsk/c0t2d0Logical Volume Manager Logical Volume Manager 规则规则1 1一个硬盘只能专属于一个硬盘只能专属于LVMLVM管理管理 Section 0 LVMSection 7ConventionalSection 11 LVMLogical Volume Manager规则2一个硬盘只能专属于一个卷组(一个硬盘只能专属于一个卷组(VGVG) Vol.

52、 GroupXVol. Group YVol. GroupXLogical Volume ManagerLogical Volume Manager规则规则3 3每个卷组(每个卷组(VGVG)最大可以有)最大可以有255255个逻辑卷(个逻辑卷(LVLV)( (缺省就是缺省就是 255; 255; 可以使用可以使用 vgcreatevgcreate l l设置设置).).每个卷组(每个卷组(VGVG)最大可以有)最大可以有255255个物理卷(个物理卷(PVPV) ( (缺省是缺省是16;16;可以使用可以使用 vgcreatevgcreate -p -p设置设置).).每个物理卷(每个物理卷

53、(PVPV)最大可以包含)最大可以包含65,53565,535个个PEPE( (缺省是缺省是 1016;1016;可以使用可以使用 vgcreatevgcreate -e -e设置设置).).在新硬盘上使用文件系统在新硬盘上使用文件系统11) CREATE PHYSICAL VOLUME FOR USE IN LVM# pvcreate /dev/rdsk/c0t1d0P V R ABAD BLOCK POOLTransparent software sparing is not supported on HPIBPhysical Volume Reserved AreaContents:ID

54、s for volume group and physical volumesPhysical extent sizePhysical volume sizeBad block directorySize and location of other disk structuresor the root disk (only used if disk hardware sparing fails)NEW LVM DISK2) CREATE A DIRECTORY ON /DEV FOR THE VOLUME GROUP# mkdir /dev/vg01/devvg01 ROOT DISKP V

55、R ABAD BLOCK POOLNEW LVM DISK在新硬盘上使用文件系统在新硬盘上使用文件系统2 23) MAKE A GROUP DEVICE FILE# # mknodmknod /dev/vg01/group c 64 /dev/vg01/group c 64 0 x0 x010100000000 由于由于minor numberminor number是系统底层标识是系统底层标识VGVG的标志,所以每个的标志,所以每个VGVG的的groupgroup文件的这两位(红色)必须是唯一的。否则文件的这两位(红色)必须是唯一的。否则VGVG无法创建无法创建 可以使用如下命令查看所有可以

56、使用如下命令查看所有vgvg的的groupgroup文件的文件的minor numberminor number# # llll /dev/vg /dev/vg* */group/groupP V R ABAD BLOCK POOLNEW LVM DISK/devvg01ROOT DISKgroup在新硬盘上使用文件系统在新硬盘上使用文件系统3 34) CREATE A VOLUME GROUP# vgcreate /dev/vg01 /dev/dsk/c0t1d0P V R ABAD BLOCK POOLNEW LVM DISKV G R AVolume Group Reserved Are

57、a ContentsVolume Group Descriptor Area (VGDA) Identifies logical and physical volumes Physical to logical extent mappingVolume Group Status Area (VGSA) Physical volume status (missing/present) Physical extent status (stale/ok)Mirror Consistency Record (MCR) Lists disk writes in progressvgcreate crea

58、tes or updates /etc/lvmtab Adds volume group information to /etc/lvmtab在新硬盘上使用文件系统在新硬盘上使用文件系统4 45) CREATE A 100 MB LOGICAL VOLUME ON VOLUME GROUP 01# lvcreate -L 100 vg01P V R ABAD BLOCK POOLNEW LVM DISKV G R A/devvg01ROOT DISKgrouprlvol1lvol1BLOCKCHARACTERDEVICE FILEDEVICE FILEetclvmtab在新硬盘上使用文件系统在

59、新硬盘上使用文件系统5 5 如果是使用裸设备就可以直接使用如果是使用裸设备就可以直接使用/dev/vg00/rlvol1/dev/vg00/rlvol16) CREATE A FILE SYSTEM FOR LOGICAL VOLUME 1BAD BLOCK POOLP V R ANEW LVM DISKV G R Alost+foundNewfs uses logical volume ones characterdevice file to create a 100 MB filesystemin the space allocated by lvcreate. Newfs creates

60、 a lost+found directoryin the new filesystem.# newfs /dev/vg01/rlvol1 在新硬盘上使用文件系统在新硬盘上使用文件系统6 67) MAKE A MOUNT POINT DIRECTORY FOR THE NEW FILE SYSTEM# mkdir /vg01lvol1P V R ABAD BLOCK POOLNEW LVM DISKV G R Alost+foundROOT DISK/devvg01grouprlvol1lvol1etclvmtabvg01lvol1在新硬盘上使用文件系统在新硬盘上使用文件系统7 78) MOUNT THE N

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论