Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Term JournaledFileSystem(JFS) LogicalExtents LogicalInterchangeFormat(LIF) LogicalVolumes Mirroring PhysicalExtent(PE) PhysicalPartitions PhysicalVolume Striping Volume VolumeGroup Definition Unixfilesystemthatusesajournaledlogtorecordchangestothefilesystem.Intheeventofafailurethe logcanbeusedtorecover. Logicalextentsareusedtocreatethelogicalvolume-theyarethesamesizeasphysicalextents HPStorageformatusedforinterchangeoffilesbetweenHPsystems. Allocatesthespaceinsideavolumegroup,thelogicalvolumegetsthefilesystem Mappingalogicalextenttomorethanonephysicalextent.Logicalvolumesaremirrored,notdisks. Unitusedforallocatingdiskspacetologicalvolumes,defaultsizeis4MB.Itisasetofcontiguousdisk blocks. Thephysicalvolumeisorganizedintoblockscalledphysicalpartitions(sameasphysicalextent??) PhysicaldiskthatisbeingmanagedbyLVM Alogicalvolumethatisconfiguredtowriteacrossmorethanonediskinastripe. Adeviceusedforstorage-eitheranentirediskorapartition. Containoneormorephysicalvolumes,aphysicalvolumecanonlybeinonevolumegroup(poolof partitions)
Commands
Command lvcreate lvdisplay-v/dev/<VG>/<LV> pvchange pvcreate/dev/rdsk/cxtxdx pvcreate-f/dev/rdsk/cxtxdx pvdisplay/dev/dsk/cxtxdx pvdisplay-v/dev/dsk/cxtxdx vgchange vgcreate vgdisplay[-v][VG_NAME} vgexport vgimport Commandusedtocreatelogicalvolumes Commandusedtodisplayinformationaboutlogicalvolumes Changestheattributesofexistingphysicalvolumes. CreatesaphysicalvolumebycreatingtheLVMdatastructuresonthephysicaldiskcalledphysicalextents. The-foptionwillforcethecreationofthePV-potentiallydestroyingoldPVinformation. Commandusedtodisplayinformationaboutphysicalvolumes Commandusedtochangeinformationaboutthevolumegroup,suchastoactivateaninactivevg Commandusedtocreatethevolumegroups Commandusedtodisplayinformationaboutvolumegroups,-vistheverboseoptionwhichwilllistlvsand pvs. Function
Files
File /dev/dsk/cxtxdx /dev/rdsk/cxtxdx /dev/<volumegroup>/group /etc/lvmrc /etc/lvmtab /etc/vpath.cfg Blockdevicefordisk Characterdevicefordisk Characterdevicefile(createdwiththemknodcommand)thatallowsthelvmkernelandthelvmcommands tocommunicate Scriptthatstartseachvolumegroupbaseduponthecontentsof/etc/lvmtab Thisfilehasthedevicefileassociatedwitheachdiskinavolumegroup.Accessitwiththestrings command. IfIBMSDDisbeingusedthisfilecontainsthemappingofvpathtothecorrespondingdisk-target-lun. Accessitwiththestringscommand. Description
15
2012-11-1311:05
3.
4.
5.
6.
2. newfs-Fvxfs/dev/vg02/lvol1 Usingmkfs: 1. mkfs-F<FILESYSTEMTYPE>-obsize=<OPTIONS>,<OPTIONS><PATHTOLV> 1. -Fisfilesystemtype,suchasvxfsfortheVeritasFileSystemorJFS 2. -oareoptions,suchasbsize(BlockSize)andlargefiles. 3. PathtoLVisoftheform/dev/VGNAME/LVNAME 2. Forexample:"mkfs -F vxfs -o bsize=8192,largefiles /dev/bgbill/lvbill" CreatetheMountPoint 1. mkdir-p<fullpathtomountpoint> 2. -pwillmakeanysubdirectoriesinthepaththatdonotalreadyexist Settheproperownershipandpermissionsonthemountpoint 1. chownowner:group/<mountpoint> 2. chmodXXX/<mountpoint> MounttheFileSystem 1. Edit/etc/fstabusingviandaddtheproperentry 1. <LVPATH><MOUNTPOINTPATH><FILESYSTEM><OPTIONS><BACKUPFREQUENCY><PASSNUMBER> 2. Forexample:"/dev/vgbill/lvbill /maindir/subdir/share vxfs rw,suid,largefiles,delaylog,datainlog 0 2" 2. "mount /<mountpoint>"tomountthefilesystem Test 1. Doa"bdf <mount point>".Thiscommandwillshowifthefilesystemismounted,andit'ssize. 2. Doan"ls -ld <mount point>"toverifythattheproperpermissionsarethere. 3. Havetheusertestthefilesystem,andreportbackwithanyproblems
Extending a VxFS Filesystem (Online JFS) 1. Verifythatthereisenoughspaceinthevolumegroup Checkthevolumegroupforenoughspace vgdisplay<VGName> Checkthelogicalvolumetodetermineifmirroringorstripingisineffect lvdisplay/dev/vg_name/lv_name Ifthereisnotenoughspacethenthevolumegroupmustbeextended-seeprocedurebelow. 2. Firstlvextendthelogicalvolume-2Optionsforlvextend: 1. lvextend-L<NewSizeinMB>/dev/VG_NAME/LV_NAME 2. lvextend-l<NEWSizein#ofLEs>/dev/VG_NAME/LV_NAME 3. fsadm-Fvxfs-b<newsizeoffilesysteminK><MOUNTPOINT> NOTE:extendfswillNOTworkwithOnlineJFS,youmustusefsadm NOTE:newsizeofthefilesystem=<#ofLEs>*<LESizeinMB>*1024 NOTE:Iflvextend-LwasusedsimplymultipysizeinMBby1024 NOTE:IfthisFAILSwitherrno28,thenthefilesystemis100%fullandmustbereducedtolessthan100%. NOTE:IfthisFAILSwith"writefailureatblockXXXXXXXX:Nosuchdeviceoraddress"thenthenewsizemaybetoobig,useasmallernumber Extending a VxFS Filesystem (No Online JFS) 1. Verifythatthereisenoughspaceinthevolumegroup vgdisplay<VGName> Ifthereisnotenoughspacethenthevolumegroupmustbeextended-seeprocedurebelow. 2. Firstlvextendthelogicalvolume-2Optionsforlvextend: 1. lvextend-L<NewSizeinMB>/dev/VG_NAME/LV_NAME 2. lvextend-l<NEWSizein#ofLEs>/dev/VG_NAME/LV_NAME 3. Unmountthefilesystem 4. extendfs-Fvxfs/dev/<VG_Name>/r<LV_Name> Note:extendfsusestherawlogicalvolumename(ierlvol1)
How to determine if you have Online JFS swlist-lfileset|grep-iadvanced How to determine the filesystem type grep<mountpoint>/etc/fstab Resultsshouldshowthefilesystemtype(vxfsorhfs)inthereturnstring
25
2012-11-1311:05
1. -lissizeinLogicalExtents(sameasPEsize) 2. -nisthenameoftheLogicalVolume 3. -rNdisablebadblockallocation lvcreate-L<sizeinMBs>-n<LVName>-rN<VGDirectorypath> 1. lvcreate-L100/dev/vg01 Logicalvolumewillbe100MBinsize Nameofthelogicalvolumedefaultnamewillbelvolx 2. lvcreate-L100-noracle/dev/vg01 Thiscreatesalogicalvolumecalledoracleof100MB 3. Verifythelvwascreatedproperly"vgdisplay -v <volume group>" Removing a Logical Volume Unmountthefilesystem umount/<PathtoMountPoint> Removethevolumegroup lvremove/dev/<VG_NAME>/<LV_NAME> Cleanup Deletethemountpoint Removethemountfrom/etc/fstab
35
2012-11-1311:05
1. pvcreate-B/dev/rdisk/c2t2d0 CreatethePVontheseconddisksothatLVMcanmanageit -Bmakesitabootablevolume 2. mkboot/dev/rdsk/c2t2d0 Installsthebootfilesontheseconddisk 3. mkboot-a"hpux-lq(;0)/stand/vmunix"/dev/rdsk/c2t2d0 Createsanautobootfileonthedisk,withinformationonhowtoboot 4. vgextend/dev/vg00/dev/dsk/c2t2d0 extendsthevolumegrouptoincludethisseconddisk. 5. vgdisplay-vvg00 Toverifythattheseconddiskisnowpartofthevolumegroup 6. lvlnboot-v Toverifythatthesystemthinksthisdiskcanboot 7. lvextend-m1/dev/vg00/lvol1/dev/dsk/c2t2d0 Thisextendsthelogicalvolumetothemirroreddisk,effectivelycreatingthemirroredcopy. Thiscommandneedstoberunforeachlogicalvolumeinthevolumegroup
Removing a Volume Group Toremoveavolumegroupusingvgreduceandvgremove: RemoveallLogicalVolumes(seeprocedureabove) removealldisksexceptonusingvgreduce <VG_NAME> </dev/dsk/DISK> Thiswillneedtobedoneforeachdiskinthevolumegroup,exceptforthelastdisk removethefinaldiskinthevolumegroupwithvgremove <VG_NAME> Toremoveavolumegroupusingvgexport: Deactivethevolumegroup vgexport-m<mapfile>-v-f<devicefile><VG_NAME>
PV Procedures:
How to recognize a newly added LUN: 1. Checkforthenewhardware ioscan-fnCdisk|more<--thenewdeviceswillhaveahardwarepath,butnodevicefileassociatedwithit. 2. Createthedevicefileforthehardwarepath insf 3. Ifusingvpathsthencreatethevpathassociation /opt/IBMdpo/bin/cfgvpath /opt/IBMdpomaynotbethepathofthesddsoftware,"whereiscfgvpath"mayneedtoberuntofinditifitisnotinpath. 4. Verifythenewdevices/vpathsarethere: ioscan-fnCdisk strings/etc/vpath.cfg /opt/IBMdpo/bin/showvpath 5. CreatethePV Foreachdiskdevice(notvpath)issuea"pvcreate/dev/rdsk/cxtxdx" Noteforvpathsthisinformationcanbefoundin/etc/vpath.cfg How to create Physical Volumes: 3MethodsofUsingpvcreate: pvcreate/dev/rdsk/cxtxdx Notethiscommandusesthe"r"versionofthedevice pvcreate-f/dev/rdsk/cxtxdx Note:the-foptionwilloverwriteexistingpvdataonthediskdevice Notethiscommandusesthe"r"versionofthedevice pvcreate-B/dev/rdsk/cxtxdx MakesthePVbootcapable Notethiscommandusesthe"r"versionofthedevice
How to determine available disks to be used in a Volume Group: 1. "ioscan -funC disk"willlistallofthediskdevices 1. Someofthesedeviceswillbeallocated,somewillnot 2. "vgdisplay -v"willlistallofthePVsandtheirdevicesforalloftheexistingvolumegroups 1. Thisisalistofthedevicesthatareinuse 3. Anydevicesthatareontheioscan,butareNOTonthevgdisplayareavailableforuse 1. Possiblestrategytoautomatethisprocessusingsed,awkandgrep 1. createafilethathasallofthedisksthatcanbeused(inthisexampleHITACHI) 1. catwte_disk_ioscan|sed1,2d|grep-v-eTOSHIBA-ec2t0d0|xargs-n10|grepHITACHI|grep-visubsystem>wte_hitachi_disk 1. catwilloutputthefilethatcontainsthediskioscan(ioscan-fnCdisk) 2. sedisusedtodeletethefirst2headerlinesofthefile. 3. NextgrepisusedtoprintanylinesthatDONOTincludeTOSHIBAorc2t0d0 4. xargsisusedtogrouptheoutputintogroupsof10 5. NextgrepfindsallofthelineswithHITACHIinthem
45
2012-11-1311:05
6. AllofthelinesthathaveHITACHIinthemaresavedtoafile 2. RefinetheioscanofHITACHIdiskstoincludejustthediskdevices,sorted-thisisalistofallHITACHIdisksonthesystem 1. awk'{print$9}'wte_hitachi_disk|sort-u>wte_hitachi_sorted_u 1. awkprintsjustthe9thfieldofthefile 2. sort-usortsthefileandsurpressesanyduplicates 3. Thisissavedtoasortedfile 3. Printalistofallthedisksthatarecurrentlybeingused(alistofPVs) 1. vgdisplay-v|grep"PVName">wte_pvdisk_used 1. vgdisplay-vprintsaverboselistingofallvolumegroups 2. greponlyprintslinesthatcontainPVName 3. ThelistofPVsissavedtoafile 4. Refinethelistofdisksthatarebeingused 1. awk'{print$3}'wte_pvdisk_used|sort-u>wte_pvdisk_sorted_u 1. awkprintsonthe3rdfield(thediskdevice) 2. sortwillsortthelist,surpressinganyduplicateentries 3. theresultsaresavedtoafile 5. Comparethe2files-thelistofallHitachidisksonthesystemwiththelistofalldisksbeingused 1. diffwte_hitachi_sorted_uwte_pvdisk_sorted_u 1. diffcomparesthe2filesandprintsoutanydifferences.Thedifferencewillbeadiskthatthesystemsees,butthatisnotbeing usedbyLVM How to remove PVs Identifythehardwarepathofthedisktoremove ioscan-fnCdisk Removethespecialdevicefile rmsf-H<HWPathfromioscan>
55
2012-11-1311:05