SLES 11 Storage Administration Guide
SLES 11 Storage Administration Guide
SLES 11 Storage Administration Guide
com/documentation
Legal Notices
Novell,Inc.,makesnorepresentationsorwarrantieswithrespecttothecontentsoruseofthisdocumentation,andspecifically disclaimsanyexpressorimpliedwarrantiesofmerchantabilityorfitnessforanyparticularpurpose.Further,Novell,Inc., reservestherighttorevisethispublicationandtomakechangestoitscontent,atanytime,withoutobligationtonotifyany personorentityofsuchrevisionsorchanges. Further,Novell,Inc.,makesnorepresentationsorwarrantieswithrespecttoanysoftware,andspecificallydisclaimsany expressorimpliedwarrantiesofmerchantabilityorfitnessforanyparticularpurpose.Further,Novell,Inc.,reservestheright tomakechangestoanyandallpartsofNovellsoftware,atanytime,withoutanyobligationtonotifyanypersonorentityof suchchanges. AnyproductsortechnicalinformationprovidedunderthisAgreementmaybesubjecttoU.S.exportcontrolsandthetrade lawsofothercountries.Youagreetocomplywithallexportcontrolregulationsandtoobtainanyrequiredlicensesor classificationtoexport,reexportorimportdeliverables.YouagreenottoexportorreexporttoentitiesonthecurrentU.S. exportexclusionlistsortoanyembargoedorterroristcountriesasspecifiedintheU.S.exportlaws.Youagreetonotuse deliverablesforprohibitednuclear,missile,orchemicalbiologicalweaponryenduses.SeetheNovellInternationalTrade ServicesWebpage(http://www.novell.com/info/exports/)formoreinformationonexportingNovellsoftware.Novellassumes noresponsibilityforyourfailuretoobtainanynecessaryexportapprovals. Copyright20092011Novell,Inc.Allrightsreserved.Nopartofthispublicationmaybereproduced,photocopied,stored onaretrievalsystem,ortransmittedwithouttheexpresswrittenconsentofthepublisher. Novell, Inc. 1800 South Novell Place Provo, UT 84606 U.S.A. www.novell.com OnlineDocumentation:ToaccessthelatestonlinedocumentationforthisandotherNovellproducts,seetheNovell DocumentationWebpage(http://www.novell.com/documentation).
Novell Trademarks
ForNovelltrademarks,seetheNovellTrademarkandServiceMarklist(http://www.novell.com/company/legal/trademarks/ tmlist.html).
Third-Party Materials
Allthirdpartytrademarksandcopyrightsarethepropertyoftheirrespectiveowners.
Contents
About This Guide 1 Overview of File Systems in Linux
1.1 1.2
9 11
Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Major File Systems in Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.2.1 Ext2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.2.2 Ext3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.2.3 ReiserFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.2.4 XFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Other Supported File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Large File Support in Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
19
2.2
Whats New in SLES 11 SP1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1.1 Saving iSCSI Target Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1.2 Modifying Authentication Parameters in the iSCSI Initiator . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1.3 Allowing Persistent Reservations for MPIO Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.1.4 MDADM 3.0.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.1.5 Boot Loader Support for MDRAID External Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.1.6 YaST Install and Boot Support for MDRAID External Metadata . . . . . . . . . . . . . . . . . . . . . 20 2.1.7 Improved Shutdown for MDRAID Arrays that Contain the Root File System . . . . . . . . . . . 20 2.1.8 MD over iSCSI Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.1.9 MD-SGPIO. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.1.10 Resizing LVM 2 Mirrors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.1.11 Updating Storage Drivers for Adapters on IBM Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Whats New in SLES 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.1 EVMS2 Is Deprecated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.2 Ext3 as the Default File System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.3 JFS File System Is Deprecated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.4 OCFS2 File System Is in the High Availability Release . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.5 /dev/disk/by-name Is Deprecated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.6 Device Name Persistence in the /dev/disk/by-id Directory . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.7 Filters for Multipathed Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.8 User-Friendly Names for Multipathed Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.2.9 Advanced I/O Load-Balancing Options for Multipath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.2.10 Location Change for Multipath Tool Callouts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.2.11 Change from mpath to multipath for the mkinitrd -f Option . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.2.12 Change from Multibus to Failover as the Default Setting for the MPIO Path Grouping Policy24
25
Partitioning Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Multipath Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Software RAID Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 File System Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Backup and Antivirus Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.5.1 Open Source Backup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Contents
3.5.2
4 LVM Configuration
4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10
27
Understanding the Logical Volume Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Creating LVM Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Creating Volume Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Configuring Physical Volumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Configuring Logical Volumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Resizing a Volume Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Resizing a Logical Volume with YaST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Resizing a Logical Volume with Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Deleting a Volume Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Deleting an LVM Partition (Physical Volume) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
39
Guidelines for Resizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.1.1 File Systems that Support Resizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.1.2 Increasing the Size of a File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 5.1.3 Decreasing the Size of a File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Increasing the Size of an Ext2, Ext3, or Ext4 File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Increasing the Size of a Reiser File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Decreasing the Size of an Ext2, Ext3, or Ext4 File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Decreasing the Size of a Reiser File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
45
Naming Devices with udev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Understanding UUIDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 6.2.1 Using UUIDs to Assemble or Activate File System Devices . . . . . . . . . . . . . . . . . . . . . . . . 46 6.2.2 Finding the UUID for a File System Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Using UUIDs in the Boot Loader and /etc/fstab File (x86) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Using UUIDs in the Boot Loader and /etc/fstab File (IA64) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
49
7.2
7.3
Understanding Multipathing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 7.1.1 What Is Multipathing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 7.1.2 Benefits of Multipathing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Planning for Multipathing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 7.2.1 Guidelines for Multipathing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 7.2.2 Using By-ID Names for Multipathed Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 7.2.3 Using LVM2 on Multipath Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 7.2.4 Using mdadm with Multipath Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 7.2.5 Using --noflush with Multipath Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 7.2.6 SAN Timeout Settings When the Root Device Is Multipathed . . . . . . . . . . . . . . . . . . . . . . . 53 7.2.7 Partitioning Multipath Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 7.2.8 Supported Architectures for Multipath I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 7.2.9 Supported Storage Arrays for Multipathing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Multipath Management Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 7.3.1 Device Mapper Multipath Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 7.3.2 Multipath I/O Management Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 7.3.3 Using MDADM for Multipathed Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 7.3.4 The Linux multipath(8) Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Contents
7.4
7.5 7.6
7.7
Configuring the System for Multipathing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7.4.1 Preparing SAN Devices for Multipathing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7.4.2 Partitioning Multipathed Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 7.4.3 Configuring the Server for Multipathing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 7.4.4 Adding multipathd to the Boot Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 7.4.5 Creating and Configuring the /etc/multipath.conf File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Enabling and Starting Multipath I/O Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Configuring Path Failover Policies and Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 7.6.1 Configuring the Path Failover Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 7.6.2 Configuring Failover Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.6.3 Using a Script to Set Path Priorities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 7.6.4 Configuring ALUA (mpath_prio_alua) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 7.6.5 Reporting Target Path Groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Configuring Multipath I/O for the Root Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 7.7.1 Enabling Multipath I/O at Install Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 7.7.2 Enabling Multipath I/O for an Existing Root Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7.7.3 Disabling Multipath I/O on the Root Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Configuring Multipath I/O for an Existing Software RAID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Scanning for New Devices without Rebooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Scanning for New Partitioned Devices without Rebooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Viewing Multipath I/O Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Managing I/O in Error Situations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Resolving Stalled I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Troubleshooting MPIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Whats Next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
91
Understanding RAID Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.1.1 RAID 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 8.1.2 RAID 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 8.1.3 RAID 2 and RAID 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 8.1.4 RAID 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 8.1.5 RAID 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 8.1.6 Nested RAID Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Soft RAID Configuration with YaST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Troubleshooting Software RAIDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
95
Prerequisites for the Software RAID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Enabling iSCSI Initiator Support at Install Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Enabling Multipath I/O Support at Install Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Creating a Software RAID Device for the Root (/) Partition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
101
10.2
10.3
Creating a RAID 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 10.1.1 Understanding RAID 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 10.1.2 Creating a RAID 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Creating Nested RAID 10 Devices with mdadm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 10.2.1 Understanding Nested RAID Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 10.2.2 Creating Nested RAID 10 (1+0) with mdadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 10.2.3 Creating Nested RAID 10 (0+1) with mdadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Creating a Complex RAID 10 with mdadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Contents
10.4
10.3.1 Understanding the mdadm RAID10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 10.3.2 Creating a RAID 10 with mdadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Creating a Degraded RAID Array. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
111
11.2
11.3
Understanding the Resizing Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 11.1.1 Guidelines for Resizing a Software RAID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 11.1.2 Overview of Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Increasing the Size of a Software RAID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 11.2.1 Increasing the Size of Component Partitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 11.2.2 Increasing the Size of the RAID Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 11.2.3 Increasing the Size of the File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Decreasing the Size of a Software RAID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 11.3.1 Decreasing the Size of the File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 11.3.2 Decreasing the Size of Component Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 11.3.3 Decreasing the Size of the RAID Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
121
How iSNS Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Installing iSNS Server for Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 Configuring iSNS Discovery Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 12.3.1 Creating iSNS Discovery Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 12.3.2 Creating iSNS Discovery Domain Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 12.3.3 Adding iSCSI Nodes to a Discovery Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 12.3.4 Adding Discovery Domains to a Discovery Domain Set . . . . . . . . . . . . . . . . . . . . . . . . . . 128 Starting iSNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 Stopping iSNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
129
13.2
13.3
13.4
13.5
Installing iSCSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 13.1.1 Installing iSCSI Target Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 13.1.2 Installing the iSCSI Initiator Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Setting Up an iSCSI Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 13.2.1 Preparing the Storage Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 13.2.2 Creating iSCSI Targets with YaST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 13.2.3 Configuring an iSCSI Target Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 13.2.4 Configuring Online Targets with ietadm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Configuring iSCSI Initiator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 13.3.1 Using YaST for the iSCSI Initiator Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 13.3.2 Setting Up the iSCSI Initiator Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 13.3.3 The iSCSI Client Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Troubleshooting iSCSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 13.4.1 Hotplug Doesnt Work for Mounting iSCSI Targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 13.4.2 Data Packets Dropped for iSCSI Traffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 13.4.3 Using iSCSI Volumes with LVM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
14 Volume Snapshots
14.1 14.2 14.3 14.4
145
Understanding Volume Snapshots. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Creating Linux Snapshots with LVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Monitoring a Snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Deleting Linux Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Contents
147
Is DM-MPIO Available for the Boot Partition? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Issues for iSCSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Issues for Multipath I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Issues for Software RAIDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
A Documentation Updates
A.1
149
A.5 A.6
A.7 A.8
A.9
A.10
A.11
A.12
A.13 A.14
A.15
December 15, 2011 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 A.1.1 Managing Multipath I/O for Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 A.1.2 Resizing File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 September 8, 2011. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 A.2.1 Managing Multipath I/O for Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 July 12, 2011 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 A.3.1 Managing Multipath I/O for Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 June 14, 2011 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 A.4.1 Managing Multipath I/O for Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 A.4.2 Whats New for Storage in SLES 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 May 5, 2011 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 January 2011 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 A.6.1 LVM Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 A.6.2 Managing Multipath I/O for Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 A.6.3 Resizing File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 September 16, 2010. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 A.7.1 LVM Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 June 21, 2010 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 A.8.1 LVM Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 A.8.2 Managing Multipath I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 A.8.3 Managing Software RAIDs 6 and 10 with mdadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 A.8.4 Mass Storage on IP NetWork: iSCSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 May 2010 (SLES 11 SP1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 A.9.1 Managing Multipath I/O for Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 A.9.2 Mass Storage over IP Networks: iSCSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 A.9.3 Software RAID Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 A.9.4 Whats New . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 February 23, 2010 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 A.10.1 Configuring Software RAID for the Root Partition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 A.10.2 Managing Multipath I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 December 1, 2009 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 A.11.1 Managing Multipath I/O for Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 A.11.2 Resizing File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 A.11.3 Whats New . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 October 20, 2009 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 A.12.1 LVM Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 A.12.2 Managing Multipath I/O for Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 A.12.3 Whats New . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 August 3, 2009 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 A.13.1 Managing Multipath I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 June 22, 2009 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 A.14.1 Managing Multipath I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 A.14.2 Managing Software RAIDs 6 and 10 with mdadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 A.14.3 Mass Storage over IP Networks: iSCSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 May 21, 2009 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 A.15.1 Managing Multipath I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Contents
Audience
Thisguideisintendedforsystemadministrators.
Feedback
Wewanttohearyourcommentsandsuggestionsaboutthismanualandtheotherdocumentation includedwiththisproduct.PleaseusetheUserCommentsfeatureatthebottomofeachpageofthe onlinedocumentation,orgotowww.novell.com/documentation/feedback.htmlandenteryour commentsthere.
Documentation Updates
ForthemostrecentversionoftheSUSELinuxEnterpriseServer11SP1StorageAdministrationGuide, visittheNovellDocumentationWebsiteforSUSELinuxEnterpriseServer11SP1(http:// www.novell.com/documentation/sles11).
Additional Documentation
Forinformationaboutpartitioningandmanagingdevices,seeAdvancedDiskSetup(http:// www.novell.com/documentation/sles11/book_sle_deployment/data/cha_advdisk.html)intheSUSE LinuxEnterpriseServer11SP1DeploymentGuide(http://www.novell.com/documentation/sles11/ book_sle_deployment/data/pre_sle.html).
10
SUSELinuxEnterpriseServershipswithanumberofdifferentfilesystemsfromwhichtochoose, includingExt3,Ext2,ReiserFS,andXFS.Eachfilesystemhasitsownadvantagesanddisadvantages. Professionalhighperformancesetupsmightrequireahighlyavailablestoragesystems.Tomeetthe requirementsofhighperformanceclusteringscenarios,SUSELinuxEnterpriseServerincludes OCFS2(OracleClusterFileSystem2)andtheDistributedReplicatedBlockDevice(DRBD)inthe SLESHighAvailabilityStorageInfrastructure(HASI)release.Theseadvancedstoragesystemsare notcoveredinthisguide.Forinformation,seetheSUSELinuxEnterpriseServer11SP1High AvailabilityGuide(http://www.novell.com/documentation/sle_ha/book_sleha/data/book_sleha.html). Section 1.1,Terminology,onpage 11 Section 1.2,MajorFileSystemsinLinux,onpage 12 Section 1.3,OtherSupportedFileSystems,onpage 16 Section 1.4,LargeFileSupportinLinux,onpage 16 Section 1.5,AdditionalInformation,onpage 17
1.1
Terminology
metadata Adatastructurethatisinternaltothefilesystem.Itassuresthatalloftheondiskdatais properlyorganizedandaccessible.Essentially,itisdataaboutthedata.Almosteveryfile systemhasitsownstructureofmetadata,whichisonreasonthatthefilesystemsshowdifferent performancecharacteristics.Itisextremelyimportanttomaintainmetadataintact,because otherwisealldataonthefilesystemcouldbecomeinaccessible. inode Adatastructureonafilesystemthatcontainsvariousinformationaboutafile,includingsize, numberoflinks,pointerstothediskblockswherethefilecontentsareactuallystored,anddate andtimeofcreation,modification,andaccess. journal Inthecontextofafilesystem,ajournalisanondiskstructurecontainingatypeofloginwhich thefilesystemstoreswhatitisabouttochangeinthefilesystemsmetadata.Journalinggreatly reducestherecoverytimeofafilesystembecauseithasnoneedforthelengthysearchprocess thatcheckstheentirefilesystematsystemstartup.Instead,onlythejournalisreplayed.
11
1.2
1.2.1
Ext2
TheoriginsofExt2gobacktotheearlydaysofLinuxhistory.Itspredecessor,theExtendedFile System,wasimplementedinApril1992andintegratedinLinux0.96c.TheExtendedFileSystem underwentanumberofmodificationsand,asExt2,becamethemostpopularLinuxfilesystemfor years.Withthecreationofjournalingfilesystemsandtheirshortrecoverytimes,Ext2becameless important. AbriefsummaryofExt2sstrengthsmighthelpunderstandwhyitwasandinsomeareasstillis thefavoriteLinuxfilesystemofmanyLinuxusers. SolidityandSpeedonpage 12 EasyUpgradabilityonpage 13
12
Easy Upgradability
BecauseExt3isbasedontheExt2codeandsharesitsondiskformataswellasitsmetadataformat, upgradesfromExt2toExt3areveryeasy.
1.2.2
Ext3
Ext3wasdesignedbyStephenTweedie.Unlikeallothernextgenerationfilesystems,Ext3doesnot followacompletelynewdesignprinciple.ItisbasedonExt2.Thesetwofilesystemsareveryclosely relatedtoeachother.AnExt3filesystemcanbeeasilybuiltontopofanExt2filesystem.Themost importantdifferencebetweenExt2andExt3isthatExt3supportsjournaling.Insummary,Ext3has threemajoradvantagestooffer: EasyandHighlyReliableUpgradesfromExt2onpage 13 ReliabilityandPerformanceonpage 13 ConvertinganExt2FileSystemintoExt3onpage 13
ThiscreatesanExt3journalwiththedefaultparameters.
13
ThisensuresthattheExt3filesystemisrecognizedassuch.Thechangetakeseffectafterthenext reboot.
3 TobootarootfilesystemthatissetupasanExt3partition,includethemodulesext3andjbdin theinitrd. 3a Edit/etc/sysconfig/kernelasroot,addingext3andjbdtotheINITRD_MODULES
variable,thensavethechanges.
3b Runthemkinitrdcommand.
Thisbuildsanewinitrdandpreparesitforuse.
4 Rebootthesystem.
1.2.3
ReiserFS
Officiallyoneofthekeyfeaturesofthe2.4kernelrelease,ReiserFShasbeenavailableasakernel patchfor2.2.xSUSEkernelssinceversion6.4.ReiserFSwasdesignedbyHansReiserandthe Namesysdevelopmentteam.IthasprovenitselftobeapowerfulalternativetoExt2.Itskeyassets arebetterdiskspaceutilization,betterdiskaccessperformance,fastercrashrecovery,andreliability throughdatajournaling. BetterDiskSpaceUtilizationonpage 14 BetterDiskAccessPerformanceonpage 14 FastCrashRecoveryonpage 14 ReliabilitythroughDataJournalingonpage 15
14
1.2.4
XFS
OriginallyintendedasthefilesystemfortheirIRIXOS,SGIstartedXFSdevelopmentintheearly 1990s.TheideabehindXFSwastocreateahighperformance64bitjournalingfilesystemtomeet extremecomputingchallenges.XFSisverygoodatmanipulatinglargefilesandperformswellon highendhardware.However,evenXFShasadrawback.LikeReiserFS,XFStakesgreatcareof metadataintegrity,butlesscareofdataintegrity. AquickreviewofXFSskeyfeaturesexplainswhyitmightprovetobeastrongcompetitorforother journalingfilesystemsinhighendcomputing. HighScalabilitythroughtheUseofAllocationGroupsonpage 15 HighPerformancethroughEfficientManagementofDiskSpaceonpage 15 PreallocationtoAvoidFileSystemFragmentationonpage 15
15
1.3
Description Compressed ROM file system: A compressed read-only file system for ROMs. High Performance File System: The IBM OS/2 standard file system. Only supported in read-only mode. Standard file system on CD-ROMs. This file system originated from academic projects on operating systems and was the first file system used in Linux. Today, it is used as a file system for floppy disks.
cramfs hpfs iso9660 minix msdos ncpfs nfs smbfs sysv ufs umsdos vfat ntfs
fat, the file system originally used by DOS, is today used by various operating
systems. File system for mounting Novell volumes over networks. Network File System: Here, data can be stored on any machine in a network and access might be granted via a network. Server Message Block is used by products such as Windows to enable file access over a network. Used on SCO UNIX, Xenix, and Coherent (commercial UNIX systems for PCs). Used by BSD, SunOS, and NextStep. Only supported in read-only mode. UNIX on MS-DOS: Applied on top of a standard fat file system, achieves UNIX functionality (permissions, links, long filenames) by creating special files. Virtual FAT: Extension of the fat file system (supports long filenames). Windows NT file system; read-only.
1.4
16
File System Ext2 or Ext3 (1 KB block size) Ext2 or Ext3 (2 KB block size) Ext2 or Ext3 (4 KB block size) Ext2 or Ext3 (8 KB block size) (systems with 8 KB pages, like Alpha) ReiserFS v3 XFS NFSv2 (client side) NFSv3 (client side)
File Size (Bytes) 234 (16 GB) 238 (256 GB) 241 (2 TB) 246 (64 TB)
File System Size (Bytes) 241 (2 TB) 243 (8 TB) 244 -4096 (16 TB-4096 Bytes) 245 (32 TB)
1.5
Additional Information
TheFileSystemPrimer(http://wiki.novell.com/index.php/File_System_Primer)ontheNovellWebsite describesavarietyoffilesystemsforLinux.Itdiscussesthefilesystems,whytherearesomany,and whichonesarethebesttouseforwhichworkloadsanddata. Eachofthefilesystemprojectsdescribedabovemaintainsitsownhomepageonwhichtofind mailinglistinformation,furtherdocumentation,andFAQs: E2fsprogs:Ext2/3/4FilesystemUtilities(http://e2fsprogs.sourceforge.net/) IntroducingExt3(http://www.ibm.com/developerworks/linux/library/lfs7.html) UsingReiserFSwithLinux(http://www.ibm.com/developerworks/aix/library/auunixreiserFS/) XFS:AHighPerformanceJournalingFilesytem(http://oss.sgi.com/projects/xfs/) OCFS2Project(http://oss.oracle.com/projects/ocfs2/) AcomprehensivemultiparttutorialaboutLinuxfilesystemscanbefoundatIBM developerWorksin theAdvancedFilesystemImplementorsGuide(http://www106.ibm.com/developerworks/library/l fs.html).Anindepthcomparisonoffilesystems(notonlyLinuxfilesystems)isavailablefromthe WikipediaprojectinComparisonofFileSystems(http://en.wikipedia.org/wiki/ Comparison_of_file_systems#Comparison).
17
18
2
2.1
2.1.1
2.1.2
19
2.1.3
2.1.4
MDADM 3.0.2
UsethelatestversionoftheMultipleDevicesAdministration(MDADM,mdadm)utilitytotake advantageofbugfixesandimprovements.
2.1.5
2.1.6
2.1.7
Improved Shutdown for MDRAID Arrays that Contain the Root File System
ShutdownscriptsweremodifiedtowaituntilalloftheMDRAIDarraysaremarkedclean.The operatingsystemshutdownprocessnowwaitsforadirtybittobecleareduntilallMDRAID volumeshavefinishedwriteoperations. Changesweremadetothestartupscript,shutdownscript,andtheinitrdtoconsiderwhetherthe root(/)filesystem(thesystemvolumethatcontainstheoperatingsystemandapplicationfiles) residesonasoftwareRAIDarray.Themetadatahandlerforthearrayisstartedearlyintheshutdown processtomonitorthefinalrootfilesystemenvironmentduringtheshutdown.Thehandleris
20
2.1.8
thennoRAIDarraysareautoassembledunlesstheyareexplicitlylistedin/etc/mdadm.conf.
2.1.9
MD-SGPIO
TheMDSGPIOutilityisastandaloneapplicationthatmonitorsRAIDarraysviasysfs(2).Events triggeranLEDchangerequestthatcontrolsblinkingforLEDlightsthatareassociatedwitheachslot inanenclosureoradrivebayofastoragesubsystem.ItsupportstwotypesofLEDsystems: 2LEDsystems(ActivityLED,StatusLED) 3LEDsystems(ActivityLED,LocateLED,FailLED)
2.1.10
2.1.11
21
2.2
2.2.1
EVMS2 Is Deprecated
TheEnterpriseVolumeManagementSystems(EVMS2)storagemanagementsolutionisdeprecated. AllEVMSmanagementmoduleshavebeenremovedfromtheSUSELinuxEnterpriseServer11 packages.YourEVMSmanageddevicesshouldbeautomaticallyrecognizedandmanagedbyLinux VolumeManager2(LVM2)whenyouupgradeyoursystem.Formoreinformation,seeEvolutionof StorageandVolumeManagementinSUSELinuxEnterprise(http://www.novell.com/linux/ volumemanagement/strategy.html). ForinformationaboutmanagingstoragewithEVMS2onSUSELinuxEnterpriseServer10,seethe SUSELinuxEnterpriseServer10SP3:StorageAdministrationGuide(http://www.novell.com/ documentation/sles10/stor_admin/data/bookinfo.html).
2.2.2
2.2.3 2.2.4
22
2.2.5 2.2.6
/dev/disk/by-name Is Deprecated
The/dev/disk/by-namepathisdeprecatedinSUSELinuxEnterpriseServer11packages.
2.2.7
2.2.8
23
2.2.9
2.2.10
2.2.11
2.2.12
Change from Multibus to Failover as the Default Setting for the MPIO Path Grouping Policy
Thedefaultsettingforthepath_grouping_policyinthe/etc/multipath.conf filehaschanged frommultibustofailover. Forinformationaboutconfiguringthepath_grouping_policy,seeSection 7.6,ConfiguringPath FailoverPoliciesandPriorities,onpage 71.
24
Considerwhatyourstorageneedsareandhowyoucaneffectivelymanageanddivideyourstorage spacetobestmeetyourneeds.Usetheinformationinthissectiontohelpplanyourstorage deploymentforfilesystemsonyourSUSELinuxEnterpriseServer11server. Section 3.1,PartitioningDevices,onpage 25 Section 3.2,MultipathSupport,onpage 25 Section 3.3,SoftwareRAIDSupport,onpage 25 Section 3.4,FileSystemSnapshots,onpage 25 Section 3.5,BackupandAntivirusSupport,onpage 26
3.1
Partitioning Devices
ForinformationaboutusingtheYaSTExpertPartitioner,seeUsingtheYaSTPartitionerinthe SUSELinuxEnterpriseServer11InstallationandAdministrationGuide.
3.2
Multipath Support
LinuxsupportsusingmultipleI/Opathsforfaulttolerantconnectionsbetweentheserverandits storagedevices.Linuxmultipathsupportisdisabledbydefault.Ifyouuseamultipathsolutionthat isprovidedbyyourstoragesubsystemvendor,youdonotneedtoconfiguretheLinuxmultipath separately.
3.3
3.4
25
3.5
3.5.1
3.5.2
26
LVM Configuration
ThissectionbrieflydescribestheprinciplesbehindLogicalVolumeManager(LVM)anditsbasic featuresthatmakeitusefulundermanycircumstances.TheYaSTLVMconfigurationcanbereached fromtheYaSTExpertPartitioner.Thispartitioningtoolenablesyoutoeditanddeleteexisting partitionsandcreatenewonesthatshouldbeusedwithLVM. WARNING:UsingLVMmightbeassociatedwithincreasedrisk,suchasdataloss.Risksalsoinclude applicationcrashes,powerfailures,andfaultycommands.SaveyourdatabeforeimplementingLVM orreconfiguringvolumes.Neverworkwithoutabackup. Section 4.1,UnderstandingtheLogicalVolumeManager,onpage 27 Section 4.2,CreatingLVMPartitions,onpage 29 Section 4.3,CreatingVolumeGroups,onpage 30 Section 4.4,ConfiguringPhysicalVolumes,onpage 32 Section 4.5,ConfiguringLogicalVolumes,onpage 33 Section 4.6,ResizingaVolumeGroup,onpage 36 Section 4.7,ResizingaLogicalVolumewithYaST,onpage 36 Section 4.8,ResizingaLogicalVolumewithCommands,onpage 37 Section 4.9,DeletingaVolumeGroup,onpage 38 Section 4.10,DeletinganLVMPartition(PhysicalVolume),onpage 38
4.1
LVM Configuration
27
VG 2
LV 1
LV 2
LV 3
LV 4
MP
MP
MP
MP
MP
MP
MP
InLVM,thephysicaldiskpartitionsthatareincorporatedinavolumegrouparecalledphysical volumes(PVs).WithinthevolumegroupsinFigure41,fourlogicalvolumes(LV 1throughLV 4) havebeendefined,whichcanbeusedbytheoperatingsystemviatheassociatedmountpoints.The borderbetweendifferentlogicalvolumesneednotbealignedwithanypartitionborder.Seethe borderbetweenLV 1andLV 2inthisexample. LVMfeatures: Severalharddisksorpartitionscanbecombinedinalargelogicalvolume. Providedtheconfigurationissuitable,anLV(suchas/usr)canbeenlargedwhenthefreespace isexhausted. UsingLVM,itispossibletoaddharddisksorLVsinarunningsystem.However,thisrequires hotswappablehardwarethatiscapableofsuchactions. Itispossibletoactivateastripingmodethatdistributesthedatastreamofalogicalvolumeover severalphysicalvolumes.Ifthesephysicalvolumesresideondifferentdisks,thiscanimprove thereadingandwritingperformancejustlikeRAID 0. Thesnapshotfeatureenablesconsistentbackups(especiallyforservers)intherunningsystem. Withthesefeatures,usingLVMalreadymakessenseforheavilyusedhomePCsorsmallservers.If youhaveagrowingdatastock,asinthecaseofdatabases,musicarchives,oruserdirectories,LVMis especiallyuseful.Itallowsfilesystemsthatarelargerthanthephysicalharddisk.Anotheradvantage ofLVMisthatupto256LVscanbeadded.However,keepinmindthatworkingwithLVMis differentfromworkingwithconventionalpartitions. Startingfromkernelversion 2.6,LVMversion 2isavailable,whichisdownwardcompatiblewiththe previousLVMandenablesthecontinuedmanagementofoldvolumegroups.Whencreatingnew volumegroups,decidewhethertousethenewformatorthedownwardcompatibleversion.LVM 2
28
4.2
LVM Configuration
29
7 Configurethepartitionformat:
1. Under Formatting Options, select Do not format. 2. From the File System ID drop-down list, select 0x8E Linux LVM as the partition identifier. 3. Under Mounting Options, select Do not mount partition.
8 ClickFinish.
ThepartitionsarenotactuallycreateduntilyouclickNextandFinishtoexitthepartitioner.
9 RepeatStep 4throughStep 8foreachLinuxLVMpartitionyouwanttoadd. 10 ClickNext,verifythatthenewLinuxLVMpartitionsarelisted,thenclickFinishtoexitthe
partitioner.
11 (Optional)ContinuewiththeVolumeGroupconfigurationasdescribedinSection 4.3,Creating
VolumeGroups,onpage 30.
4.3
AlistofexistingVolumeGroupsarelistedintherightpanel.
30
4 AtthelowerleftoftheVolumeManagementpage,clickAddVolumeGroup.
5 SpecifytheVolumeGroupName.
Ifyouarecreatingavolumegroupatinstalltime,thenamesystemissuggestedforavolume groupthatwillcontaintheSUSELinuxEnterpriseServersystemfiles.
6 SpecifythePhysicalExtentSize.
ThePhysicalExtentSizedefinesthesizeofaphysicalblockinthevolumegroup.Allthedisk spaceinavolumegroupishandledinchunksofthissize.Valuescanbefrom1KBto16GBin powersof2.Thisvalueisnormallysetto4 MB. InLVM1,a4MBphysicalextentallowedamaximumLVsizeof256GBbecauseitsupportsonly upto65534extentsperLV.VM2doesnotrestrictthenumberofphysicalextents.Havingalarge numberofextentshasnoimpactonI/Operformancetothelogicalvolume,butitslowsdown theLVMtools. IMPORTANT:DifferentphysicalextentsizesshouldnotbemixedinasingleVG.Theextent shouldnotbemodifiedaftertheinitialsetup.
7 IntheAvailablePhysicalVolumeslist,selecttheLinuxLVMpartitionsthatyouwanttomakepart
ofthisvolumegroup,thenclickAddtomovethemtotheSelectedPhysicalVolumeslist.
8 ClickFinish.
ThenewgroupappearsintheVolumeGroupslist.
9 OntheVolumeManagementpage,clickNext,verifythatthenewvolumegroupislisted,then
clickFinish.
LVM Configuration
31
4.4
Toaddmorephysicalvolumestoanexistingvolumegroup:
1 Loginastherootuser,thenopenYaST. 2 InYaST,openthePartitioner. 3 Intheleftpanel,selectVolumeManagementandexpandthelistofgroups. 4 UnderVolumeManagement,selectthevolumegroup,thenclicktheOverviewtab.
32
5 Atthebottomofthepage,clickResize.
6 Selectaphysicalvolume(LVMpartitions)fromtheAvailablePhysicalVolumeslistthenclickAdd
tomoveittotheSelectedPhysicalVolumeslist.
7 ClickFinish. 8 ClickNext,verifythatthechangesarelisted,thenclickFinish.
4.5
LVM Configuration
33
34
7 Specifythesizeofthevolumeandwhethertousemultiplestripes.
1. Specify the size of the logical volume, up to the maximum size available. The amount of free space in the current volume group is shown next to the Maximum Size option. 2. Specify the number of stripes. WARNING: YaST has no chance at this point to verify the correctness of your entries concerning striping. Any mistake made here is apparent only later when the LVM is implemented on disk.
8 Specifytheformattingoptionsforthelogicalvolume:
1. Under Formatting Options, select Format partition, then select the format type from the File system drop-down list, such as Ext3. 2. Under Mounting Options, select Mount partition, then select the mount point. The files stored on this logical volume can be found at this mount point on the installed system. 3. Click Fstab Options to add special mounting options for the volume.
9 ClickFinish. 10 ClickNext,verifythatthechangesarelisted,thenclickFinish.
LVM Configuration
35
4.6
6 Dooneofthefollowing:
4.7
36
5 Atthebottomofthepage,clickResizetoopentheResizeLogicalVolumedialog.
6 Usetheslidertoexpandorreducethesizeofthelogicalvolume.
WARNING:Reducingthesizeofalogicalvolumethatcontainsdatacancausedatacorruption.
7 ClickOK. 8 ClickNext,verifythatthechangeislisted,thenclickFinish.
4.8
VM),shutdowntheVM.
3 Dismountthefilesystemsonthelogicalvolume. 4 Attheterminalconsoleprompt,enterthefollowingcommandtogrowthesizeofthelogical
volume:
LVM Configuration
37
Forexample,toextendanLVwitha(mountedandactive)ReiserFSonitby10GB:
lvextend L +10G /dev/vgname/lvname resize_reiserfs s +10GB f /dev/vgname/lvname
Forexample,toshrinkanLVwithaReiserFSonitby5GB:
umount /mountpointofLV resize_reiserfs s 5GB /dev/vgname/lvname lvreduce /dev/vgname/lvname mount /dev/vgname/lvname /mountpointofLV
4.9
font),thenclickFinish.
4.10
thevolumegroup,ordeletethevolumegroup.
4 IntheYaSTPartitionerunderHardDisks,selectthedevice(suchassdc). 5 OnthePartitionspage,selectapartitionthatyouwanttoremove,clickDelete,thenclickYesto
confirmthedeletion.
6 ClickNext,verifythatthedeletedpartitionislisted(deletionisindicatedbyaredcoloredfont),
thenclickFinish.
38
Whenyourdataneedsgrowforavolume,youmightneedtoincreasetheamountofspaceallocated toitsfilesystem. Section 5.1,GuidelinesforResizing,onpage 39 Section 5.2,IncreasingtheSizeofanExt2,Ext3,orExt4FileSystem,onpage 40 Section 5.3,IncreasingtheSizeofaReiserFileSystem,onpage 41 Section 5.4,DecreasingtheSizeofanExt2,Ext3,orExt4FileSystem,onpage 42 Section 5.5,DecreasingtheSizeofaReiserFileSystem,onpage 42
5.1
5.1.1
Increase Size (Grow) Offline only Online or offline Offline only Online or offline
Decrease Size (Shrink) Offline only Offline only Offline only Offline only
39
5.1.2
5.1.3
5.2
mountedorunmounted.
3 Increasethesizeofthefilesystemusingoneofthefollowingmethods:
Toextendthefilesystemsizetothemaximumavailablesizeofthedevicecalled/dev/ sda1,enter
resize2fs /dev/sda1
Ifasizeparameterisnotspecified,thesizedefaultstothesizeofthepartition. Toextendthefilesystemtoaspecificsize,enter
resize2fs /dev/sda1 size
40
Forexample,tomountanExt2filesystemforadevicenamed/dev/sda1atmountpoint/home, enter
mount -t ext2 /dev/sda1 /home 5 Checktheeffectoftheresizeonthemountedfilesystembyentering df -h
5.3
methods: Toextendthefilesystemsizetothemaximumavailablesizeofthedevice,enter
resize_reiserfs /dev/sda2
Whennosizeisspecified,thisincreasesthevolumetothefullsizeofthepartition. Toextendthefilesystemtoaspecificsize,enter
resize_reiserfs -s size /dev/sda2
Waituntiltheresizingiscompletedbeforecontinuing.
3 Ifthefilesystemisnotmounted,mountitnow.
Forexample,tomountanReiserFSfilesystemfordevice/dev/sda2atmountpoint/home,enter
mount -t reiserfs /dev/sda2 /home 4 Checktheeffectoftheresizeonthemountedfilesystembyentering df -h
41
5.4
Replacesizewithanintegervalueinkilobytesforthedesiredsize.(Akilobyteis1024bytes.) Waituntiltheresizingiscompletedbeforecontinuing.
4 Mountthefilesystem.Forexample,tomountanExt2filesystemforadevicenamed/dev/sda1 atmountpoint/home,enter mount -t ext2 /dev/md0 /home 5 Checktheeffectoftheresizeonthemountedfilesystembyentering df -h
5.5
Ifthepartitionyouareattemptingtodecreaseinsizecontainssystemfiles(suchastheroot(/) volume),unmountingispossibleonlywhenbootingfromabootableCDorfloppy.
3 Decreasethesizeofthefilesystemonadevicecalled/dev/sda1byentering resize_reiserfs -s size /dev/sda2
Waituntiltheresizingiscompletedbeforecontinuing.
4 Mountthefilesystembyentering mount -t reiserfs /dev/sda2 /mnt/point 5 Checktheeffectoftheresizeonthemountedfilesystembyentering
42
df -h
43
44
ThissectiondescribestheoptionaluseofUUIDsinsteadofdevicenamestoidentifyfilesystem devicesinthebootloaderfileandthe/etc/fstabfile. Section 6.1,NamingDeviceswithudev,onpage 45 Section 6.2,UnderstandingUUIDs,onpage 45 Section 6.3,UsingUUIDsintheBootLoaderand/etc/fstabFile(x86),onpage 46 Section 6.4,UsingUUIDsintheBootLoaderand/etc/fstabFile(IA64),onpage 47 Section 6.5,AdditionalInformation,onpage 48
6.1
6.2
Understanding UUIDs
AUUID(UniversallyUniqueIdentifier)isa128bitnumberforafilesystemthatisuniqueonboth thelocalsystemandacrossothersystems.Itisarandomlygeneratedwithsystemhardware informationandtimestampsaspartofitsseed.UUIDsarecommonlyusedtouniquelytagdevices. Section 6.2.1,UsingUUIDstoAssembleorActivateFileSystemDevices,onpage 46 Section 6.2.2,FindingtheUUIDforaFileSystemDevice,onpage 46
45
6.2.1
6.2.2
6.3
Forexample,change
kernel /boot/vmlinuz root=/dev/sda1
46
to
kernel /boot/vmlinuz root=/dev/disk/by-uuid/e014e482-1c2d-4d09-84ec61b3aefde77a
to
UUID=e014e482-1c2d-4d09-84ec-61b3aefde77a 1 1 / reiserfs acl,user_xattr
IMPORTANT:Donotleavestraycharactersorspacesinthefile.
6.4
47
Forexample,change
root=/dev/sda1
to
root=/dev/disk/by-uuid/e014e482-1c2d-4d09-84ec-61b3aefde77a 6 Editthe/boot/efi/SuSE/elilo.conffiletomodifythesystemdevicefromthelocationtothe
UUID. Forexample,change
/dev/sda1 / reiserfs acl,user_xattr 1 1
to
UUID=e014e482-1c2d-4d09-84ec-61b3aefde77a 1 1 / reiserfs acl,user_xattr
IMPORTANT:Donotleavestraycharactersorspacesinthefile.
6.5
Additional Information
Formoreinformationaboutusingudev(8)formanagingdevices,seeDynamicKernelDevice Managementwithudev(http://www.novell.com/documentation/sles11/book_sle_admin/data/ cha_udev.html)intheSUSELinuxEnterpriseServer11AdministrationGuide. Formoreinformationaboutudev(8)commands,seeitsmanpage.Enterthefollowingataterminal consoleprompt:
man 8 udev
48
Thissectiondescribeshowtomanagefailoverandpathloadbalancingformultiplepathsbetween theserversandblockstoragedevices. Section 7.1,UnderstandingMultipathing,onpage 49 Section 7.2,PlanningforMultipathing,onpage 50 Section 7.3,MultipathManagementTools,onpage 57 Section 7.4,ConfiguringtheSystemforMultipathing,onpage 62 Section 7.5,EnablingandStartingMultipathI/OServices,onpage 71 Section 7.6,ConfiguringPathFailoverPoliciesandPriorities,onpage 71 Section 7.7,ConfiguringMultipathI/OfortheRootDevice,onpage 79 Section 7.8,ConfiguringMultipathI/OforanExistingSoftwareRAID,onpage 82 Section 7.9,ScanningforNewDeviceswithoutRebooting,onpage 84 Section 7.10,ScanningforNewPartitionedDeviceswithoutRebooting,onpage 86 Section 7.11,ViewingMultipathI/OStatus,onpage 87 Section 7.12,ManagingI/OinErrorSituations,onpage 88 Section 7.13,ResolvingStalledI/O,onpage 89 Section 7.14,TroubleshootingMPIO,onpage 89 Section 7.15,WhatsNext,onpage 89
7.1
Understanding Multipathing
Section 7.1.1,WhatIsMultipathing?,onpage 49 Section 7.1.2,BenefitsofMultipathing,onpage 50
7.1.1
What Is Multipathing?
Multipathingistheabilityofaservertocommunicatewiththesamephysicalorlogicalblockstorage deviceacrossmultiplephysicalpathsbetweenthehostbusadaptersintheserverandthestorage controllersforthedevice,typicallyinFibreChannel(FC)oriSCSISANenvironments.Youcanalso achievemultipleconnectionswithdirectattachedstoragewhenmultiplechannelsareavailable.
49
7.1.2
Benefits of Multipathing
Linuxmultipathingprovidesconnectionfaulttoleranceandcanprovideloadbalancingacrossthe activeconnections.Whenmultipathingisconfiguredandrunning,itautomaticallyisolatesand identifiesdeviceconnectionfailures,andreroutesI/Otoalternateconnections. Typicalconnectionproblemsinvolvefaultyadapters,cables,orcontrollers.Whenyouconfigure multipathI/Oforadevice,themultipathdrivermonitorstheactiveconnectionbetweendevices. WhenthemultipathdriverdetectsI/Oerrorsforanactivepath,itfailsoverthetraffictothedevices designatedsecondarypath.Whenthepreferredpathbecomeshealthyagain,controlcanbereturned tothepreferredpath.
7.2
7.2.1
Prerequisites
Multipathingismanagedatthedevicelevel. Thestoragearrayyouuseforthemultipatheddevicemustsupportmultipathing.Formore information,seeSection 7.2.9,SupportedStorageArraysforMultipathing,onpage 55. Youneedtoconfiguremultipathingonlyifmultiplephysicalpathsexistbetweenhostbus adaptersintheserverandhostbuscontrollersfortheblockstoragedevice.Youconfigure multipathingforthelogicaldeviceasseenbytheserver.
50
Software RAIDs
TheLinuxsoftwareRAIDmanagementsoftwarerunsontopofmultipathing.Foreachdevicethat hasmultipleI/OpathsandthatyouplantouseinasoftwareRAID,youmustconfigurethedevice formultipathingbeforeyouattempttocreatethesoftwareRAIDdevice.Automaticdiscoveryof multipatheddevicesisnotavailable.ThesoftwareRAIDisnotawareofthemultipathing managementrunningunderneath.
High-Availability Solutions
Highavailabilitysolutionsforclusteringtypicallyrunontopofthemultipathingserver.For example,theDistributedReplicatedBlockDevice(DRBD)highavailabilitysolutionformirroring devicesacrossaLANrunsontopofmultipathing.ForeachdevicethathasmultipleI/Opathsand thatyouplantouseinaDRDBsolution,youmustconfigurethedeviceformultipathingbeforeyou configureDRBD.
Volume Managers
VolumemanagerssuchasLVM2andEVMSrunontopofmultipathing.Youmustconfigure multipathingforadevicebeforeyouuseLVM2orEVMStocreatesegmentmanagersandfile systemsonit.
Virtualization Environments
Whenusingmultipathinginavirtualizationenvironment,themultipathingiscontrolledinthehost serverenvironment.Configuremultipathingforthedevicebeforeyouassignittoavirtualguest machine.
51
7.2.2
7.2.3
If/etc/lvm/lvm.confdoesnotexist,youcancreateonebasedonyourcurrentLVM configurationbyenteringthefollowingataterminalconsoleprompt:
lvm dumpconfig > /etc/lvm/lvm.conf 2 Changethefilterandtypesentriesin/etc/lvm/lvm.confasfollows: filter = [ "a|/dev/disk/by-id/.*|", "r|.*|" ] types = [ "device-mapper", 1 ]
Enterthefollowingataterminalconsoleprompt:
52
7.2.4
Ifyouareusinguserfriendlynames,specifythepathasfollowssothatonlythedevicemapper namesarescannedaftermultipathingisconfigured:
DEVICE /dev/disk/by-id/dm-uuid-.*-mpath-.*
7.2.5
7.2.6
53
7.2.7
7.2.8
54
7.2.9
55
configuretheconfigurationfile.Forinformation,seeSection 7.4.5,CreatingandConfiguringthe/ etc/multipath.confFile,onpage 64. Considerthefollowingcaveats: NotallofthestoragearraysthatareautomaticallydetectedhavebeentestedonSUSELinux EnterpriseServer.Forinformation,seeTestedStorageArraysforMultipathingSupporton page 56. Somestoragearraysmightrequirespecifichardwarehandlers.Ahardwarehandlerisakernel modulethatperformshardwarespecificactionswhenswitchingpathgroupsanddealingwith I/Oerrors.Forinformation,seeStorageArraysthatRequireSpecificHardwareHandlerson page 56. Afteryoumodifythe/etc/multipath.conffile,youmustrunmkinitrdtorecreatethe INITRDonyoursystem,thenrebootinorderforthechangestotakeeffect.
56
7.3
7.3.1
57
Description One controller is active and serves all LUNs. The second controller acts as a standby. The second controller also presents the LUNs to the multipath component so that the operating system knows about redundant paths. If the primary controller fails, the second controller takes over, and it serves all LUNs. In some arrays, the LUNs can be assigned to different controllers. A given LUN is assigned to one controller to be its active controller. One controller does the disk I/O for any given LUN at a time, and the second controller is the standby for that LUN. The second controller also presents the paths, but disk I/O is not possible. Servers that use that LUN are connected to the LUNs assigned controller. If the primary controller for a set of LUNs fails, the second controller takes over, and it serves all LUNs.
Active/active controllers
Both controllers share the load for all LUNs, and can process disk I/O for any given LUN. If one controller fails, the second controller automatically handles all traffic. The Device Mapper Multipath driver automatically load balances traffic across all active paths. When the active controller fails over to the passive, or standby, controller, the Device Mapper Multipath driver automatically activates the paths between the host and the standby, making them the primary paths. Multipathing is supported for the root (/) device in SUSE Linux Enterprise Server 10 and later. The host server must be connected to the currently active controller and storage processor for the boot device. Multipathing is supported for the /boot device in SUSE Linux Enterprise Server 11 and later.
DeviceMapperMultipathdetectseverypathforamultipatheddeviceasaseparateSCSIdevice.The SCSIdevicenamestaketheform/dev/sdN,whereNisanautogeneratedletterforthedevice, beginningwithaandissuedsequentiallyasthedevicesarecreated,suchas/dev/sda,/dev/sdb, andsoon.Ifthenumberofdevicesexceeds26,thelettersareduplicatedsothatthenextdeviceafter /dev/sdzwillbenamed/dev/sdaa,/dev/sdab,andsoon. Ifmultiplepathsarenotautomaticallydetected,youcanconfigurethemmanuallyinthe/etc/ multipath.conffile.Themultipath.conffiledoesnotexistuntilyoucreateandconfigureit.For information,seeSection 7.4.5,CreatingandConfiguringthe/etc/multipath.confFile,onpage 64.
58
7.3.2
Description Scans the system for multipathed devices and assembles them. Waits for maps events, then executes multipath. Provides a meaningful device name to udev for device maps (devmaps). Maps linear devmaps to partitions on the multipathed device, which makes it possible to create multipath monitoring for partitions on the device.
Thefilelistforapackagecanvaryfordifferentserverarchitectures.Foralistoffilesincludedinthe multipathtoolspackage,gototheSUSELinuxEnterpriseServerTechnicalSpecifications>Package DescriptionsWebpage(http://www.novell.com/products/server/techspecs.html?tab=1),findyour architectureandselectPackagesSortedbyName,thensearchonmultipathtoolstofindthepackage listforthatarchitecture. YoucanalsodeterminethefilelistforanRPMfilebyqueryingthepackageitself:usingtherpm -ql orrpm -qplcommandoptions. Toqueryaninstalledpackage,enter
rpm -ql <package_name>
Toqueryapackagenotinstalled,enter
rpm -qpl <URL_or_path_to_package>
Tocheckthatthemultipath-toolspackageisinstalled,dothefollowing:
1 Enterthefollowingataterminalconsoleprompt: rpm -q multipath-tools
Ifitisinstalled,theresponserepeatsthepackagenameandprovidestheversioninformation, suchas:
multipath-tools-04.7-34.23
Ifitisnotinstalled,theresponsereads:
package multipath-tools is not installed
59
7.3.3
Ifyouareusinguserfriendlynames,specifythepathasfollowssothatonlythedevicemapper namesarescannedaftermultipathingisconfigured:
DEVICE /dev/disk/by-id/dm-uuid-.*-mpath-.*
ToverifythatMDADMisinstalled:
1 Ensurethatthemdadmpackageisinstalledbyenteringthefollowingataterminalconsole
prompt:
rpm -q mdadm
Ifitisinstalled,theresponserepeatsthepackagenameandprovidestheversioninformation. Forexample:
mdadm-2.6-0.11
Ifitisnotinstalled,theresponsereads:
package mdadm is not installed
7.3.4
General Examples
multipath Configureallmultipathdevices. multipathdevicename Configuresaspecificmultipathdevice. Replacedevicenamewiththedevicenodenamesuchas/dev/sdb(asshownbyudevinthe $DEVNAMEvariable),orinthemajor:minorformat. multipathf Selectivelysuppressesamultipathmap,anditsdevicemappedpartitions.
60
multipathd Dryrun.Displayspotentialmultipathdevices,butdoesnotcreateanydevicesanddoesnot updatedevicemaps. multipathv2d Displaysmultipathmapinformationforpotentialmultipathdevicesinadryrun.Thev2option showsonlylocaldisks.Thisverbositylevelprintsthecreatedorupdatedmultipathnamesonly forusetofeedothertoolslikekpartx. Thereisnooutputifthedevicesalreadyexistsandtherearenochanges.Usemultipath -llto seethestatusofconfiguredmultipathdevices. multipathv2devicename Configuresaspecificpotentialmultipathdeviceanddisplaysmultipathmapinformationforit. Thisverbositylevelprintsonlythecreatedorupdatedmultipathnamesforusetofeedother toolslikekpartx. Thereisnooutputifthedevicealreadyexistsandtherearenochanges.Usemultipath -llto seethestatusofconfiguredmultipathdevices. Replacedevicenamewiththedevicenodenamesuchas/dev/sdb(asshownbyudevinthe $DEVNAMEvariable),orinthemajor:minorformat. multipathv3 Configurespotentialmultipathdevicesanddisplaysmultipathmapinformationforthem.This verbositylevelprintsalldetectedpaths,multipaths,anddevicemaps.Bothwwidanddevnode blacklisteddevicesaredisplayed. multipathv3devicename Configuresaspecificpotentialmultipathdeviceanddisplaysinformationforit.Thev3option showsthefullpathlist.Thisverbositylevelprintsalldetectedpaths,multipaths,anddevice maps.Bothwwidanddevnodeblacklisteddevicesaredisplayed. Replacedevicenamewiththedevicenodenamesuchas/dev/sdb(asshownbyudevinthe $DEVNAMEvariable),orinthemajor:minorformat. multipathll Displaythestatusofallmultipathdevices. multipathlldevicename Displaysthestatusofaspecifiedmultipathdevice. Replacedevicenamewiththedevicenodenamesuchas/dev/sdb(asshownbyudevinthe $DEVNAMEvariable),orinthemajor:minorformat. multipathF Flushesallunusedmultipathdevicemaps.Thisunresolvesthemultiplepaths;itdoesnotdelete thedevices. multipathFdevicename Flushesunusedmultipathdevicemapsforaspecifiedmultipathdevice.Thisunresolvesthe multiplepaths;itdoesnotdeletethedevice. Replacedevicenamewiththedevicenodenamesuchas/dev/sdb(asshownbyudevinthe $DEVNAMEvariable),orinthemajor:minorformat.
61
multipathp[failover|multibus|group_by_serial|group_by_prio|group_by_node_name] SetsthegrouppolicybyspecifyingoneofthegrouppolicyoptionsthataredescribedinTable7 3:
Table 7-3 GroupPolicyOptionsforthemultipathpCommand
Description One path per priority group. You can use only one path at a time. All paths in one priority group. One priority group per detected SCSI serial number (the controller node worldwide number). One priority group per path priority value. Paths with the same priority are in the same priority group. Priorities are determined by callout programs specified as a global, per-controller, or per-multipath option in the /etc/ multipath.conf configuration file. One priority group per target node name. Target node names are fetched in the /sys/class/fc_transport/target*/node_name location.
group_by_node_name
7.4
7.4.1
62
7.4.2
7.4.3
BecausetheQLogicdriverisnotautomaticallyloadedonstartup,addithere:
INITRD_MODULES="cciss qla23xx"
7.4.4
63
4 ClickFinish,thenclickYes.
Thechangesdonottakeaffectuntiltheserverisrestarted.
7.4.5
referencetodeterminehowtoconfiguremultipathingforyoursystem.
4 MakesurethereisanappropriatedeviceentryforyourSAN.Mostvendorsprovide documentationonthepropersetupofthedevicesection.
64
multipath -v2 -d
Thiscommandscansthedevices,thendisplayswhatthesetupwouldlooklike.Theoutputissimilar tothefollowing:
26353900f02796769 [size=127 GB] [features="0"] [hwhandler="1 emc"] \_ round-robin 0 [first] \_ 1:0:1:2 sdav 66:240 \_ 0:0:1:2 sdr 65:16 \_ round-robin 0 \_ 1:0:0:2 sdag 66:0 \_ 0:0:0:2 sdc 8:32 [ready ] [ready ] [ready ] [ready ]
Thefollowingisanexampleofv3outputona64bitSLESserverwithtwoQlogicHBAconnectedto aXiotechMagnitude3000SAN.Somemultipleentrieshavebeenomittedtoshortentheexample.
dm-22: device node name blacklisted < content omitted > loop7: device node name blacklisted < content omitted > md0: device node name blacklisted < content omitted > dm-0: device node name blacklisted sdf: not found in pathvec sdf: mask = 0x1f sdf: dev_t = 8:80 sdf: size = 105005056 sdf: subsystem = scsi sdf: vendor = XIOtech sdf: product = Magnitude 3D sdf: rev = 3.00 sdf: h:b:t:l = 1:0:0:2 sdf: tgt_node_name = 0x202100d0b2028da sdf: serial = 000028DA0014 sdf: getuid = /lib/udev/scsi_id -g -u -s /block/%n (config file default) sdf: uid = 200d0b2da28001400 (callout) sdf: prio = const (config file default) sdf: const prio = 1 < content omitted > ram15: device node name blacklisted < content omitted > ===== paths list ===== uuid hcil dev dev_t pri dm_st chk_st vend/prod/rev 200d0b2da28001400 1:0:0:2 sdf 8:80 1 [undef][undef] XIOtech,Magnitude 3D
65
200d0b2da28005400 1:0:0:1 sde 8:64 1 [undef][undef] XIOtech,Magnitude 200d0b2da28004d00 1:0:0:0 sdd 8:48 1 [undef][undef] XIOtech,Magnitude 200d0b2da28001400 0:0:0:2 sdc 8:32 1 [undef][undef] XIOtech,Magnitude 200d0b2da28005400 0:0:0:1 sdb 8:16 1 [undef][undef] XIOtech,Magnitude 200d0b2da28004d00 0:0:0:0 sda 8:0 1 [undef][undef] XIOtech,Magnitude params = 0 0 2 1 round-robin 0 1 1 8:80 1000 round-robin 0 1 1 8:32 1000 status = 2 0 0 0 2 1 A 0 1 0 8:80 A 0 E 0 1 0 8:32 A 0 sdf: mask = 0x4 sdf: path checker = directio (config file default) directio: starting new request directio: async io getevents returns 1 (errno=Success) directio: io finished 4096/0 sdf: state = 2 < content omitted >
3D 3D 3D 3D 3D
Description The WWID (Worldwide Identifier) is an identifier for the multipath device that is guaranteed to be globally unique and unchanging. The default name used in multipathing is the ID of the logical unit as found in the /dev/disk/by-id directory. Because device node names in the form of /dev/sdn and /dev/dm-n can change on reboot, referring to multipath devices by their ID is preferred. The Device Mapper Multipath device names in the /dev/mapper directory also reference the ID of the logical unit. These multipath device names are user-friendly names in the form of /dev/mapper/mpath<n>, such as /dev/mapper/mpath0. The names are unique and persistent because they use the /var/lib/multipath/bindings file to track the association between the UUID and user-friendly names. An alias name is a globally unique name that the administrator provides for a multipath device. Alias names override the WWID and the user-friendly /dev/mapper/mpathN names.
User-friendly
Alias
66
Usingtheuser_friendly_namesoptioncanbeproblematicinthefollowingsituations: RootDeviceIsUsingMultipath:Ifthesystemrootdeviceisusingmultipathandyouusethe user_friendly_namesoption,theuserfriendlysettingsinthe/var/lib/multipath/bindings fileareincludedintheinitrd.Ifyoulaterchangethestoragesetup,suchasbyaddingor removingdevices,thereisamismatchbetweenthebindingssettinginsidetheinitrdandthe bindingssettingsin/var/lib/multipath/bindings. WARNING:Abindingsmismatchbetweeninitrdand/var/lib/multipath/bindingscan leadtoawrongassignmentofmountpointstodevices,whichcanresultinfilesystem corruptionanddataloss. Toavoidthisproblem,werecommendthatyouusethedefaultWWIDsettingsforthesystem rootdevice.Youcanalsousethealiasoptiontooverridetheuser_friendly_namesoptionfor thesystemrootdeviceinthe/etc/multipath.conffile. Forexample:
multipaths { multipath { wwid alias } multipath { wwid alias } multipath { wwid alias } multipath { wwid alias } }
IMPORTANT:Werecommendthatyoudonotusealiasesforthesystemrootdevice,because theabilitytoseamlesslyswitchoffmultipathingviathekernelcommandlineislostbecausethe devicenamediffers. Mounting/varfromAnotherPartition:Thedefaultlocationoftheuser_friendly_names configurationfileis/var/lib/multipath/bindings.Ifthe/vardataisnotlocatedonthe systemrootdevicebutmountedfromanotherpartition,thebindingsfileisnotavailablewhen settingupmultipathing. Makesurethatthe/var/lib/multipath/bindingsfileisavailableonthesystemrootdevice andmultipathcanfindit.Forexample,thiscanbedoneasfollows: 1. Movethe/var/lib/multipath/bindingsfileto/etc/multipath/bindings. 2. Setthebindings_fileoptioninthedefaultssectionof/etc/multipath.conftothis newlocation.Forexample:
defaults { } user_friendly_names yes bindings_file "/etc/multipath/bindings"
67
Thealternatepathmustbeavailableonthesystemrootdevicewheremultipathcanfindit.
3a Movethe/var/lib/multipath/bindingsfileto/etc/multipath/bindings. 3b Setthebindings_fileoptioninthedefaultssectionof/etc/multipath.conftothis
newlocation.Forexample:
defaults { } user_friendly_names yes bindings_file "/etc/multipath/bindings"
Forexample:
## Use user friendly names, instead of using WWIDs as names. defaults { user_friendly_names yes } 5 (Optional)Specifyyourownnamesfordevicesbyusingthealiasoptioninthemultipath
section. Forexample:
68
## Use alias names, instead of using WWIDs as names. multipaths { multipath { wwid 36006048000028350131253594d303030 alias mpatha } multipath { wwid 36006048000028350131253594d303041 alias mpathb } multipath { wwid 36006048000028350131253594d303145 alias mpathc } multipath { wwid 36006048000028350131253594d303334 alias mpathd } } 6 Saveyourchanges,thenclosethefile.
69
takeeffect.
70
7.5
Iftheboot.multipathservicedoesnotstartautomaticallyonsystemboot,dothefollowingtostart themmanually:
1 Openaterminalconsole,thenloginastherootuserorequivalent. 2 Enter /etc/init.d/boot.multipath start /etc/init.d/multipathd start
7.6
7.6.1
Replacepolicywithoneofthefollowingpolicyoptions:
71
Description One path per priority group. All paths in one priority group. One priority group per detected serial number. One priority group per path priority value. Priorities are determined by callout programs specified as a global, per-controller, or per-multipath option in the /etc/ multipath.conf configuration file. One priority group per target node name. Target node names are fetched in the /
group_by_node_name
sys/class/fc_transport/target*/node_name location.
7.6.2
Description Specifies whether to use IDs or to use the /var/lib/ multipath/bindings file to assign a persistent and unique alias to the multipath devices in the form of /dev/mapper/ mpathN.
Values yes: Autogenerate user-friendly names as aliases for the multipath devices instead of the actual ID. no: Default. Use the WWIDs shown in the /dev/
disk/by-id/ location.
72
Description
Values
Specifies the list of device For an example, see Blacklisting Non-Multipathed names to ignore as nonDevices in /etc/multipath.conf on page 69. multipathed devices, such as cciss, fd, hd, md, dm, sr, scd, st, ram, raw, loop. Specifies the list of device names to treat as multipath devices even if they are included in the blacklist. Specifies whether to monitor the failed path recovery, and indicates the timing for group failback after failed paths return to service. When the failed path recovers, the path is added back into the multipath enabled path list based on this setting. Multipath evaluates the priority groups, and changes the active priority group when the priority of the primary path exceeds the secondary group. For an example, see the /usr/share/doc/ packages/multipath-tools/ multipath.conf.annotated file. immediate: When a path recovers, enable the path immediately. n (> 0): When the path recovers, wait n seconds before enabling the path. Specify an integer value greater than 0. manual: (Default) The failed path is not monitored for recovery. The administrator runs the multipath command to update enabled paths and priority groups. We recommend failback setting of manual for multipath in cluster environments in order to prevent multipath failover ping-pong.
blacklist_exceptions
failback
failback "manual"
IMPORTANT: Ensure that you verify the failback setting with your storage system vendor. Different storage systems can require different settings. getuid The default program and arguments to call to obtain a unique path identifier. Should be specified with an absolute path.
/lib/udev/scsi_id -g -u -s
This is the default location and arguments. Example:
73
Description Specifies the path grouping policy for a multipath device hosted by a given controller.
Values failover: (Default) One path is assigned per priority group so that only one path at a time is used. multibus: All valid paths are in one priority group. Traffic is load-balanced across all active paths in the group. group_by_prio: One priority group exists for each path priority value. Paths with the same priority are in the same priority group. Priorities are assigned by an external program. group_by_serial: Paths are grouped by the SCSI target serial number (controller node WWN). group_by_node_name: One priority group is assigned per target node name. Target node names are fetched in /sys/class/ fc_transport/target*/node_name.
path_checker
directio: (Default in multipath-tools version 0.4.8 and later) Reads the first sector that has direct I/O. This is useful for DASD devices. Logs failure messages in /var/log/messages. readsector0: (Default in multipath-tools version 0.4.7 and earlier) Reads the first sector of the device. Logs failure messages in /var/log/ messages. tur: Issues a SCSI test unit ready command to the device. This is the preferred setting if the LUN supports it. On failure, the command does not fill up /var/log/messages with messages. Some SAN vendors provide custom path_checker options:
74
Values round-robin 0: (Default) The load-balancing algorithm used to balance traffic across all active paths in a priority group. Beginning in SUSE Linux Enterprise Server 11, the following additional I/O balancing options are available: least-pending 0: Provides a least-pending-I/O dynamic load balancing policy for bio based device mapper multipath. This load balancing policy considers the number of unserviced requests pending on a path and selects the path with least count of pending service requests. This policy is especially useful when the SAN environment has heterogeneous components. For example, when there is one 8 GB HBA and one 2 GB HBA connected to the same server, the 8 GB HBA could be utilized better with this algorithm. queue-length 0: A dynamic load balancer that balances the number of in-flight I/O on paths similar to the least-pending option. service-time 0: A service-time oriented load balancer that balances I/O on paths according to the latency.
pg_timeout
75
Description
Values
Specifies the program and If no prio_callout attribute is used, all paths arguments to use to determine are equal. This is the default. Multipath prio_callouts the layout of the multipath map. are located in shared /bin/true: Use this value when the When queried by the libraries in /lib/ group_by_priority is not being used. libmultipath/lib*. multipath command, the specified mpath_prio_* callout The prioritizer programs generate path By using shared libraries, the callouts are program returns the priority for priorities when queried by the multipath command. The program names must begin with a given path in relation to the loaded into memory on mpath_prio_ and are named by the device type entire multipath layout. daemon startup. or balancing method used. Current prioritizer When it is used with the programs include the following: path_grouping_policy of mpath_prio_alua %n: Generates path priorities group_by_prio, all paths with based on the SCSI-3 ALUA settings. the same priority are grouped into one multipath group. The mpath_prio_balance_units: Generates the same group with the highest priority for all paths. aggregate priority becomes the active group. mpath_prio_emc %n: Generates the path priority When all paths in a group fail, the group with the next highest aggregate priority becomes active. Additionally, a failover command (as determined by the hardware handler) might be send to the target. for EMC arrays. mpath_prio_hds_modular %b: Generates the path priority for Hitachi HDS Modular storage arrays. mpath_prio_hp_sw %n: Generates the path priority for Compaq/HP controller in active/standby mode.
The mpath_prio_* program can also be a custom script created mpath_prio_netapp %n: Generates the path by a vendor or administrator for priority for NetApp arrays. a specified setup. mpath_prio_random %n: Generates a random A %n in the command line priority for each path. expands to the device name in mpath_prio_rdac %n: Generates the path priority the /dev directory. for LSI/Engenio RDAC controller. A %b expands to the device number in major:minor format in mpath_prio_tpc %n: You can optionally use a script created by a vendor or administrator that the /dev directory. gets the priorities from a file where you specify A %d expands to the device ID priorities to use for each path. in the /dev/disk/by-id mpath_prio_spec.sh %n: Provides the path of a directory. user-created script that generates the priorities for multipathing based on information contained in a If devices are hot-pluggable, use the %d flag instead of %n. second data file. (This path and filename are provided as an example. Specify the location of This addresses the short time that elapses between the time your script instead.) The script can be created by a when devices are available and vendor or administrator. The scripts target file when udev creates the device identifies each path for all multipathed devices and specifies a priority for each path. For an example, nodes. see Section 7.6.3, Using a Script to Set Path Priorities, on page 77.
76
Description
Values
n (>0): Specify an integer value greater than 0. Specifies the number of I/O transactions to route to a path 1000: Default. before switching to the next path in the same path group, as determined by the specified algorithm in the path_selector setting. Specifies the weighting method uniform: Default. All paths have the same roundto use for paths. robin weights. priorities: Each paths weight is determined by the paths priority times the rr_min_io setting.
rr_weight
7.6.3
77
0x10000000c95ebeb4 0x200200a0b8122c6e 2:0:0:3 sde 3600a0b80000fd6320000000245317593 2 0x10000000c95ebeb4 0x200300a0b8122c6e 2:0:1:0 sdi 3600a0b8000122c6d00000000453174fc 5 0x10000000c95ebeb4 0x200300a0b8122c6e 2:0:1:1 sdj 3600a0b80000fd6320000000045317563 51 0x10000000c95ebeb4 0x200300a0b8122c6e 2:0:1:2 sdk 3600a0b8000122c6d0000000345317524 5 0x10000000c95ebeb4 0x200300a0b8122c6e 2:0:1:3 sdl 3600a0b80000fd6320000000245317593 51
7.6.4
Syntax
mpath_prio_alua [-d directory] [-h] [-v] [-V] device [device...]
Prerequisite
SCSIdevices.
Options
ddirectory SpecifiestheLinuxdirectorypathwherethelisteddevicenodenamescanbefound.Thedefault directoryis/dev.Whenyouusethisoption,specifythedevicenodenameonly(suchassda)for thedeviceordevicesyouwanttomanage. h Displayshelpforthiscommand,thenexits. v Turnsonverboseoutputtodisplaystatusinhumanreadableformat.Outputincludes informationaboutwhichportgroupthespecifieddeviceisinanditscurrentstate.
78
V Displaystheversionnumberofthistool,thenexits. device[device...] SpecifiestheSCSIdevice(ormultipledevices)thatyouwanttomanage.Thedevicemustbea SCSIdevicethatsupportstheReportTargetPortGroups(sg_rtpg(8))command.Useoneof thefollowingformatsforthedevicenodename: ThefullLinuxdirectorypath,suchas/dev/sda.Donotusewiththedoption. Thedevicenodenameonly,suchassda.Specifythedirectorypathbyusingthedoption. Themajorandminornumberofthedeviceseparatedbyacolon(:)withnospaces,suchas 8:0.Thiscreatesatemporarydevicenodeinthe/devdirectorywithanameintheformat oftmpdev-<major>:<minor>-<pid>.Forexample,/dev/tmpdev-8:0-<pid>.
Return Values
Onsuccess,returnsavalueof0andthepriorityvalueforthegroup.Table77showsthepriority valuesreturnedbythempath_prio_aluacommand.
Table 7-7 ALUAPrioritiesforDeviceMapperMultipath
Priority Value 50 10 1 0
Description The device is in the active, optimized group. The device is in an active but non-optimized group. The device is in the standby group. All other groups.
7.6.5
7.7
79
7.7.1
partitioner.
2 SelectCustomPartitioning(forexperts). 3 SelecttheHardDisksmainicon,clicktheConfigurebutton,thenselectConfigureMultipath. 4 Startmultipath.
partitioner.
2 SelectCustomPartitioning(forexperts). 3 SelecttheHardDisksmainicon,clicktheConfigurebutton,thenselectConfigureMultipath. 4 Startmultipath.
80
6 Afterallsettingsaredoneandtheinstallationfinished,YaST2startstowritethebootloader
information,anddisplaysacountdowntorestartthesystem.Stopthecounterbyclickingthe StopbuttonandpressCTRL+ALT+F5toaccessaconsole.
7 Usetheconsoletodetermineifapassivepathwasenteredinthe/boot/grub/device.mapfile forthehd0entry.
Thisisnecessarybecausetheinstallationdoesnotdistinguishbetweenactiveandpassivepaths.
7a Mounttherootdeviceto/mntbyentering mount /dev/mapper/UUID_part2 /mnt
Forexample,enter
mount /dev/mapper/3600a0b80000f4593000012ae4ab0ae65_part2 /mnt 7b Mountthebootdeviceto/mnt/bootbyentering mount /dev/mapper/UUID_part1 /mnt/boot
Forexample,enter
mount /dev/mapper/3600a0b80000f4593000012ae4ab0ae65_part1 /mnt/boot 7c Open/mnt/boot/grub/device.mapfilebyentering less /mnt/boot/grub/device.map 7d Inthe/mnt/boot/grub/device.mapfile,determineifthehd0entrypointstoapassive
Passivepathsareflaggedasghost.
8c Inthe/mnt/boot/grub/device.mapfile,changethehd0entrytoanactivepath,savethe
changes,andclosethefile.
8d IncasetheselectionwastobootfromMBR,/etc/grub.confshouldlooklikethe
following:
setup --stage2=/boot/grub/stage2 (hd0) (hd0,0) quit 8e Reinstallthebootloaderbyentering grub < /etc/grub.conf
81
7.7.2
inthepartitioner.
2 Mountthedevicesbyusingthe/dev/disk/by-idpathusedduringtheinstall. 3 Afterinstallation,adddm-multipathto/etc/sysconfig/kernel:INITRD_MODULES. 4 ForSystemZ,beforerunningmkinitrd,editthe/etc/zipl.conffiletochangethebypath informationinzipl.confwiththesamebyidinformationthatwasusedinthe/etc/fstab. 5 Rerun/sbin/mkinitrdtoupdatetheinitrdimage. 6 ForSystemZ,afterrunningmkinitrd,runzipl. 7 Reboottheserver.
7.7.3
Thisaffectsonlytherootdevice.Allotherdevicesarenotaffected.
7.8
82
Exceptwhereotherwisedirected,usethisconsoletoenterthecommandsinthefollowingsteps.
2 IfanysoftwareRAIDdevicesarecurrentlymountedorrunning,enterthefollowingcommands
foreachdevicetodismountthedeviceandstopit.
umount /dev/mapper/mpath0 mdadm --misc --stop /dev/mapper/mpath0 3 Stoptheboot.mdservicebyentering /etc/init.d/boot.md stop 4 Starttheboot.multipathandmultipathdservicesbyenteringthefollowingcommands: /etc/init.d/boot.multipath start /etc/init.s/multipathd start 5 Afterthemultipathingservicesarestarted,verifythatthesoftwareRAIDscomponentdevices arelistedinthe/dev/disk/by-iddirectory.Dooneofthefollowing:
Thedevicesshouldnowbelistedin/dev/disk/by-id,andhavesymboliclinkstotheir DeviceMapperMultipathdevicenames.Forexample:
lrwxrwxrwx 1 root root 10 Jun 15 09:36 scsi-mpath1 -> ../../dm-1 6 Restarttheboot.mdserviceandtheRAIDdevicebyentering /etc/init.d/boot.md start 7 CheckthestatusofthesoftwareRAIDbyentering mdadm --detail /dev/mapper/mpath0
TheRAIDscomponentdevicesshouldmatchtheirDeviceMapperMultipathdevicenamesthat arelistedasthesymboliclinksofdevicesinthe/dev/disk/by-iddirectory.
8 MakeanewinitrdtoensurethattheDeviceMapperMultipathservicesareloadedbeforethe RAIDservicesonreboot.Runningmkinitrdisneededonlyiftheroot(/)deviceoranypartsof it(suchas/var,/etc,/log)areontheSANandmultipathisneededtoboot.
Enter
mkinitrd -f multipath 9 Reboottheservertoapplythesepostinstallconfigurationsettings.
83
10 VerifythatthesoftwareRAIDarraycomesupproperlyontopofthemultipatheddevicesby
checkingtheRAIDstatus.Enter
mdadm --detail /dev/mapper/mpath0
Forexample:
Number Major Minor RaidDevice State
0 253 0 0 active sync /dev/dm-0 1 253 1 1 active sync /dev/dm-1 2 253 2 2 active sync /dev/dm-2
7.9
Syntax
rescan-scsi-bus.sh [options] [host [host ...]]
Youcanspecifyhostsonthecommandline(deprecated),orusethe--hosts=LISToption (recommended).
Options
Formoststoragesubsystems,thescriptcanberunsuccessfullywithoutoptions.However,some specialcasesmightneedtouseoneormoreofthefollowingparametersfortherescan-scsibus.shscript:
Option Description Activates scanning for LUNs 0-7. [Default: 0] Activates scanning for LUNs 0 to NUM. [Default: 0] Scans for target device IDs 0 to 15. [Default: 0 to 7] Enables scanning of channels 0 or 1. [Default: 0] Enables removing of devices. [Default: Disabled] Issues a Fibre Channel LIP reset. [Default: Disabled] Rescans existing devices. Removes and re-adds every device. WARNING: Use with caution, this option is dangerous.
--nooptscan --color
Dont stop looking for LUNs if 0 is not found. Use colored prefixes OLD/NEW/DEL.
84
Option
Description Scans only hosts in LIST, where LIST is a comma-separated list of single values and ranges. No spaces are allowed.
--hosts=LIST
--hosts=A[-B][,C[-D]] --channels=LIST
Scans only channels in LIST, where LIST is a comma-separated list of single values and ranges. No spaces are allowed.
--channels=A[-B][,C[-D]] --ids=LIST
Scans only target IDs in LIST, where LIST is a comma-separated list of single values and ranges. No spaces are allowed.
--ids=A[-B][,C[-D]] --luns=LIST
Scans only LUNs in LIST, where LIST is a comma-separated list of single values and ranges. No spaces are allowed.
--luns=A[-B][,C[-D]]
Procedure
Usethefollowingproceduretoscanthedevicesandmakethemavailabletomultipathingwithout rebootingthesystem.
1 Onthestoragesubsystem,usethevendorstoolstoallocatethedeviceandupdateitsaccess
controlsettingstoallowtheLinuxsystemaccesstothenewstorage.Refertothevendors documentationfordetails.
2 ScanalltargetsforahosttomakeitsnewdeviceknowntothemiddlelayeroftheLinuxkernels
SCSIsubsystem.Ataterminalconsoleprompt,enter
rescan-scsi-bus.sh [options] 3 Checkforscanningprogressinthesystemlog(the/var/log/messagesfile).Ataterminal
consoleprompt,enter
tail -30 /var/log/messages
Thiscommanddisplaysthelast30linesofthelog.Forexample:
# tail . . . Feb 14 Feb 14 Feb 14 Feb 14 Feb 14 Feb 14 Feb 14 Feb 14 -30 /var/log/messages 01:03 kernel: SCSI device sde: 81920000 01:03 kernel: SCSI device sdf: 81920000 01:03 multipathd: sde: path checker registered 01:03 multipathd: sdf: path checker registered 01:03 multipathd: mpath4: event checker started 01:03 multipathd: mpath5: event checker started 01:03:multipathd: mpath4: remaining active paths: 1 01:03 multipathd: mpath5: remaining active paths: 1
areconnectedtothenewdevice.
5 RunthemultipathcommandtorecognizethedevicesforDMMPIOconfiguration.Ata
terminalconsoleprompt,enter
multipath
Youcannowconfigurethenewdeviceformultipathing.
85
7.10
SCSIsubsystem.Ataterminalconsoleprompt,enter
rescan-scsi-bus.sh [options]
Thisgeneratesthedevicemapperdevicesforthepartitionsondm-8.
8 Createafilesystemandlabelforthenewpartitionbyentering mke2fs -j /dev/dm-9 tune2fs -L oradata3 /dev/dm-9 9 RestartDMMPIOtoletitreadthealiasesbyentering /etc/init.d/multipathd restart 10 Verifythatthedeviceisrecognizedbymultipathdbyentering multipath -ll 11 Useatexteditortoaddamountentryinthe/etc/fstabfile.
86
7.11
Thisdisplaysinformationforeachmultipatheddevice.Forexample:
3600601607cf30e00184589a37a31d911 [size=127 GB][features="0"][hwhandler="1 emc"] \_ round-robin 0 [active][first] \_ 1:0:1:2 sdav 66:240 [ready ][active] \_ 0:0:1:2 sdr 65:16 [ready ][active] \_ round-robin 0 [enabled] \_ 1:0:0:2 sdag 66:0 [ready ][active] \_ 0:0:0:2 sdc 8:32 [ready ][active]
Foreachdevice,itshowsthedevicesID,size,features,andhardwarehandlers. Pathstothedeviceareautomaticallygroupedintoprioritygroupsondevicediscovery.Onlyone prioritygroupisactiveatatime.Foranactive/activeconfiguration,allpathsareinthesamegroup. Foranactive/passiveconfiguration,thepassivepathsareplacedinseparateprioritygroups. Thefollowinginformationisdisplayedforeachgroup: SchedulingpolicyusedtobalanceI/Owithinthegroup,suchasroundrobin Whetherthegroupisactive,disabled,orenabled Whetherthegroupisthefirst(highestpriority)group Pathscontainedwithinthegroup Thefollowinginformationisdisplayedforeachpath: Thephysicaladdressashost:bus:target:lun,suchas1:0:1:2 Devicenodename,suchassda Major:minornumbers Statusofthedevice
87
7.12
ThiscommandimmediatelycausesallqueuedI/Otofail. Replacethedevice_IDwiththeIDforyourdevice.Forexample,enter:
dmsetup message 3600601607cf30e00184589a37a31d911 0 fail_if_no_path
TosetupqueuingI/Oforscenarioswhereallpathsfail:
1 Inaterminalconsole,loginastherootuser. 2 Openthe/etc/multipath.conffileinatexteditor. 3 Uncommentthedefaultssectionanditsendingbracket,thenaddthedefault_features
setting,asfollows:
defaults { default_features "1 queue_if_no_path" } 4 Afteryoumodifythe/etc/multipath.conffile,youmustrunmkinitrdtorecreatethe initrdonyoursystem,thenrebootinorderforthechangestotakeeffect. 5 WhenyouarereadytoreturnovertofailoverforthedeviceI/O,enter: dmsetup message mapname 0 fail_if_no_path
88
7.13
7.14
Troubleshooting MPIO
ForinformationabouttroubleshootingmultipathI/OissuesonSUSELinuxEnterpriseServer,seethe followingTechnicalInformationDocuments(TIDs)intheNovellSupportKnowledgebase: TroubleshootingSLESMultipathing(MPIO)Problems(TID3231766)(http://www.novell.com/ support/search.do?cmd=displayKC&docType=kc&externalId=3231766&sliceId=SAL_Public) DMMPIODeviceBlacklistingNotHonoredinmultipath.conf(TID3029706)(http:// www.novell.com/support/ search.do?cmd=displayKC&docType=kc&externalId=3029706&sliceId=SAL_Public&dialogID=5 7872426&stateId=0%200%2057878058) TroubleshootingSCSI(LUN)ScanningIssues(TID3955167)(http://www.novell.com/support/ search.do?cmd=displayKC&docType=kc&externalId=3955167&sliceId=SAL_Public&dialogID=5 7868704&stateId=0%200%2057878206)
7.15
Whats Next
IfyouwanttousesoftwareRAIDs,createandconfigurethembeforeyoucreatefilesystemsonthe devices.Forinformation,seethefollowing: Chapter 8,SoftwareRAIDConfiguration,onpage 91 Chapter 10,ManagingSoftwareRAIDs6and10withmdadm,onpage 101
89
90
ThepurposeofRAID(redundantarrayofindependentdisks)istocombineseveralharddisk partitionsintoonelargevirtualharddisktooptimizeperformance,datasecurity,orboth.MostRAID controllersusetheSCSIprotocolbecauseitcanaddressalargernumberofharddisksinamore effectivewaythantheIDEprotocolandismoresuitableforparallelprocessingofcommands.There aresomeRAIDcontrollersthatsupportIDEorSATAharddisks.SoftwareRAIDprovidesthe advantagesofRAIDsystemswithouttheadditionalcostofhardwareRAIDcontrollers.However, thisrequiressomeCPUtimeandhasmemoryrequirementsthatmakeitunsuitableforrealhigh performancecomputers. IMPORTANT:SoftwareRAIDisnotsupportedunderneathclusteredfilesystemssuchasOCFS2, becauseRAIDdoesnotsupportconcurrentactivation.IfyouwantRAIDforOCFS2,youneedthe RAIDtobehandledbythestoragesubsystem. SUSELinuxEnterpriseofferstheoptionofcombiningseveralharddisksintoonesoftRAIDsystem. RAIDimpliesseveralstrategiesforcombiningseveralharddisksinaRAIDsystem,eachwith differentgoals,advantages,andcharacteristics.ThesevariationsarecommonlyknownasRAID levels. Section 8.1,UnderstandingRAIDLevels,onpage 91 Section 8.2,SoftRAIDConfigurationwithYaST,onpage 93 Section 8.3,TroubleshootingSoftwareRAIDs,onpage 94 Section 8.4,ForMoreInformation,onpage 94
8.1
91
8.1.1
RAID 0
Thislevelimprovestheperformanceofyourdataaccessbyspreadingoutblocksofeachfileacross multiplediskdrives.Actually,thisisnotreallyaRAID,becauseitdoesnotprovidedatabackup,but thenameRAID 0forthistypeofsystemhasbecomethenorm.WithRAID 0,twoormoreharddisks arepooledtogether.Theperformanceisverygood,buttheRAIDsystemisdestroyedandyourdata lostifevenoneharddiskfails.
8.1.2
RAID 1
Thislevelprovidesadequatesecurityforyourdata,becausethedataiscopiedtoanotherharddisk 1:1.Thisisknownasharddiskmirroring.Ifadiskisdestroyed,acopyofitscontentsisavailableon anothermirroreddisk.Alldisksexceptonecouldbedamagedwithoutendangeringyourdata. However,ifdamageisnotdetected,damageddatamightbemirroredtothecorrectdiskandthedata iscorruptedthatway.Thewritingperformancesuffersalittleinthecopyingprocesscomparedto whenusingsinglediskaccess(10to20percentslower),butreadaccessissignificantlyfasterin comparisontoanyoneofthenormalphysicalharddisks,becausethedataisduplicatedsocanbe scannedinparallel.RAID1generallyprovidesnearlytwicethereadtransactionrateofsingledisks andalmostthesamewritetransactionrateassingledisks.
8.1.3
8.1.4
RAID 4
Level 4providesblocklevelstripingjustlikeLevel 0combinedwithadedicatedparitydisk.Ifadata diskfails,theparitydataisusedtocreateareplacementdisk.However,theparitydiskmightcreatea bottleneckforwriteaccess.Nevertheless,Level 4issometimesused.
8.1.5
RAID 5
RAID 5isanoptimizedcompromisebetweenLevel 0andLevel 1intermsofperformanceand redundancy.Theharddiskspaceequalsthenumberofdisksusedminusone.Thedataisdistributed overtheharddisksaswithRAID 0.Parityblocks,createdononeofthepartitions,aretherefor securityreasons.TheyarelinkedtoeachotherwithXOR,enablingthecontentstobereconstructed bythecorrespondingparityblockincaseofsystemfailure.WithRAID 5,nomorethanoneharddisk canfailatthesametime.Ifoneharddiskfails,itmustbereplacedassoonaspossibletoavoidthe riskoflosingdata.
8.1.6
92
8.2
93
8.3
8.4
94
InSUSELinuxEnterpriseServer11,theDeviceMapperRAIDtoolhasbeenintegratedintotheYaST Partitioner.YoucanusethepartitioneratinstalltimetocreateasoftwareRAIDforthesystemdevice thatcontainsyourroot(/)partition. Section 9.1,PrerequisitesfortheSoftwareRAID,onpage 95 Section 9.2,EnablingiSCSIInitiatorSupportatInstallTime,onpage 96 Section 9.3,EnablingMultipathI/OSupportatInstallTime,onpage 96 Section 9.4,CreatingaSoftwareRAIDDevicefortheRoot(/)Partition,onpage 96
9.1
Youneedtwoormoreharddrives,dependingonthetypeofsoftwareRAIDyouplantocreate.
RAID0(Striping):RAID0requirestwoormoredevices.RAID0offersnofaulttolerance benefits,anditisnotrecommendedforthesystemdevice. RAID1(Mirroring):RAID1requirestwodevices. RAID5(RedundantStriping):RAID5requiresthreeormoredevices.
Theharddrivesshouldbesimilarlysized.TheRAIDassumesthesizeofthesmallestdrive. Theblockstoragedevicescanbeanycombinationoflocal(inordirectlyattachedtothe
machine),FibreChannelstoragesubsystems,oriSCSIstoragesubsystems.
IfyouareusinghardwareRAIDdevices,donotattempttorunsoftwareRAIDsontopofit. IfyouareusingiSCSItargetdevices,enabletheiSCSIinitiatorsupportbeforeyoucreatethe
RAIDdevice.
IfyourstoragesubsystemprovidesmultipleI/Opathsbetweentheserveranditsdirectly
attachedlocaldevices,FibreChanneldevices,oriSCSIdevicesthatyouwanttouseinthe softwareRAID,youmustenablethemultipathsupportbeforeyoucreatetheRAIDdevice.
95
9.2
Settingspage.
2 ClickPartitioningtoopenthePreparingHardDiskpage,clickCustomPartitioning(forexperts),
thenclickNext.
3 OntheExpertPartitionerpage,expandHardDisksintheSystemViewpaneltoviewthedefault
proposal.
4 OntheHardDiskspage,selectConfigure>ConfigureiSCSI,thenclickContinuewhenpromptedto
continuewithinitializingtheiSCSIinitiatorconfiguration.
9.3
Settingspage.
2 ClickPartitioningtoopenthePreparingHardDiskpage,clickCustomPartitioning(forexperts),
thenclickNext.
3 OntheExpertPartitionerpage,expandHardDisksintheSystemViewpaneltoviewthedefault
proposal.
4 OntheHardDiskspage,selectConfigure>ConfigureMultipath,thenclickYeswhenpromptedto
9.4
Settingspage.
2 ClickPartitioningtoopenthePreparingHardDiskpage,clickCustomPartitioning(forexperts),
thenclickNext.
3 OntheExpertPartitionerpage,expandHardDisksintheSystemViewpaneltoviewthedefault
proposal,selecttheproposedpartitions,thenclickDelete.
4 Createaswappartition. 4a OntheExpertPartitionerpageunderHardDisks,selectthedeviceyouwanttouseforthe
swappartition,thenclickAddontheHardDiskPartitionstab.
4b UnderNewPartitionType,selectPrimaryPartition,thenclickNext. 4c UnderNewPartitionSize,specifythesizetouse,thenclickNext. 4d UnderFormatOptions,selectFormatpartition,thenselectSwapfromthedropdownlist.
96
RAID.
5a OntheExpertPartitionerpageunderHardDisks,selectthedeviceyouwanttouseinthe
RAID,thenclickAddontheHardDiskPartitionstab.
5b UnderNewPartitionType,selectPrimaryPartition,thenclickNext. 5c UnderNewPartitionSize,specifytousethemaximumsize,thenclickNext. 5d UnderFormatOptions,selectDonotformatpartition,thenselect0xFDLinuxRAIDfromthe
dropdownlist.
5e UnderMountOptions,selectDonotmountpartition. 5f ClickFinish. 5g RepeatStep 5atoStep 5fforeachdevicethatyouplantouseinthesoftwareRAID 6 CreatetheRAIDdevice. 6a IntheSystemViewpanel,selectRAID,thenclickAddRAIDontheRAIDpage.
ThedevicesthatyoupreparedinStep 5arelistedinAvailableDevices.
6b UnderRAIDType,selectRAID0(Striping),RAID1(Mirroring),orRAID5(Redundant
Striping). Forexample,selectRAID1(Mirroring).
6c IntheAvailableDevicespanel,selectthedevicesyouwanttousefortheRAID,thenclickAdd
97
6d ClickNext. 6e UnderRAIDOptions,selectthechunksizefromthedropdownlist.
Ext3)fromtheFilesystemdropdownlist.
6g UnderMountingOptions,selectMountpartition,thenselect/ fromtheMountPointdrop
downlist.
6h ClickFinish.
98
ThesoftwareRAIDdeviceismanagedbyDeviceMapper,andcreatesadeviceunderthe/
dev/md0path.
7 OntheExpertPartitionerpage,clickAccept.
ThenewproposalappearsunderPartitioningontheInstallationSettingspage. Forexample,thesetupforthe
8 Continuewiththeinstall.
99
100
10
10
ThissectiondescribeshowtocreatesoftwareRAID6and10devices,usingtheMultipleDevices Administration(mdadm(8))tool.YoucanalsousemdadmtocreateRAIDs0,1,4,and5.Themdadmtool providesthefunctionalityoflegacyprogramsmdtoolsandraidtools. Section 10.1,CreatingaRAID6,onpage 101 Section 10.2,CreatingNestedRAID10Deviceswithmdadm,onpage 102 Section 10.3,CreatingaComplexRAID10withmdadm,onpage 105 Section 10.4,CreatingaDegradedRAIDArray,onpage 108
10.1
Creating a RAID 6
Section 10.1.1,UnderstandingRAID6,onpage 101 Section 10.1.2,CreatingaRAID6,onpage 102
10.1.1
Understanding RAID 6
RAID6isessentiallyanextensionofRAID5thatallowsforadditionalfaulttolerancebyusinga secondindependentdistributedparityscheme(dualparity).Eveniftwooftheharddiskdrivesfail duringthedatarecoveryprocess,thesystemcontinuestobeoperational,withnodataloss. RAID6providesforextremelyhighdatafaulttolerancebysustainingmultiplesimultaneousdrive failures.Ithandlesthelossofanytwodeviceswithoutdataloss.Accordingly,itrequiresN+2drives tostoreNdrivesworthofdata.Itrequiresaminimumof4devices. TheperformanceforRAID6isslightlylowerbutcomparabletoRAID5innormalmodeandsingle diskfailuremode.Itisveryslowindualdiskfailuremode.
Table 10-1 ComparisonofRAID5andRAID6
Medium impact on write and rebuild More impact on sequential write than RAID 5 Failure of one component device Failure of two component devices
101
10.1.2
Creating a RAID 6
TheprocedureinthissectioncreatesaRAID6device/dev/md0withfourdevices:/dev/sda1,/dev/ sdb1,/dev/sdc1,and/dev/sdd1.Makesuretomodifytheproceduretouseyouractualdevice nodes.
1 Openaterminalconsole,thenloginastherootuserorequivalent. 2 CreateaRAID6device.Atthecommandprompt,enter mdadm --create /dev/md0 --run --level=raid6 --chunk=128 --raid-devices=4 /dev/ sdb1 /dev/sdc1 /dev/sdc1 /dev/sdd1
Thedefaultchunksizeis64KB.
3 CreateafilesystemontheRAID6device/dev/md0,suchasaReiserfilesystem(reiserfs).For
example,atthecommandprompt,enter
mkfs.reiserfs /dev/md0
Modifythecommandifyouwanttouseadifferentfilesystem.
4 Editthe/etc/mdadm.conffiletoaddentriesforthecomponentdevicesandtheRAIDdevice/ dev/md0. 5 Editthe/etc/fstabfiletoaddanentryfortheRAID6device/dev/md0. 6 Reboottheserver.
TheRAID6deviceismountedto/local.
7 (Optional)AddahotsparetoservicetheRAIDarray.Forexample,atthecommandprompt
enter:
mdadm /dev/md0 -a /dev/sde1
10.2
10.2.1
102
Description
RAID 0 (stripe) built RAID 1+0 provides high levels of I/O performance, data redundancy, and with RAID 1 (mirror) disk fault tolerance. Because each member device in the RAID 0 is mirrored arrays individually, multiple disk failures can be tolerated and data remains available as long as the disks that fail are in different mirrors. You can optionally configure a spare for each underlying mirrored array, or configure a spare to serve a spare group that serves all mirrors.
10 (0+1)
RAID 0+1 provides high levels of I/O performance and data redundancy, but slightly less fault tolerance than a 1+0. If multiple disks fail on one side of the mirror, then the other mirror is available. However, if disks are lost concurrently on both sides of the mirror, all data is lost. This solution offers less disk fault tolerance than a 1+0 solution, but if you need to perform maintenance or maintain the mirror on a different site, you can take an entire side of the mirror offline and still have a fully functional storage device. Also, if you lose the connection between the two sites, either site operates independently of the other. That is not true if you stripe the mirrored segments, because the mirrors are managed at a lower level. If a device fails, the mirror on that side fails because RAID 1 is not faulttolerant. Create a new RAID 0 to replace the failed side, then resynchronize the mirrors.
10.2.2
Raw Devices
RAID 1 (mirror)
1 Openaterminalconsole,thenloginastherootuserorequivalent. 2 Create2softwareRAID1devices,usingtwodifferentdevicesforeachRAID1device.Atthe
commandprompt,enterthesetwocommands:
mdadm --create /dev/md0 --run --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
103
usingthesoftwareRAID1devicesyoucreatedinStep 2:
mdadm --create /dev/md2 --run --level=0 --chunk=64 --raid-devices=2 /dev/md0 / dev/md1
Thedefaultchunksizeis64KB.
4 CreateafilesystemontheRAID1+0device/dev/md2,suchasaReiserfilesystem(reiserfs).For
example,atthecommandprompt,enter
mkfs.reiserfs /dev/md2
Modifythecommandifyouwanttouseadifferentfilesystem.
5 Editthe/etc/mdadm.conffiletoaddentriesforthecomponentdevicesandtheRAIDdevice/ dev/md2. 6 Editthe/etc/fstabfiletoaddanentryfortheRAID1+0device/dev/md2. 7 Reboottheserver.
TheRAID1+0deviceismountedto/local.
10.2.3
Raw Devices
RAID 0 (stripe)
1 Openaterminalconsole,thenloginastherootuserorequivalent. 2 CreatetwosoftwareRAID0devices,usingtwodifferentdevicesforeachRAID0device.Atthe
commandprompt,enterthesetwocommands:
mdadm --create /dev/md0 --run --level=0 --chunk=64 --raid-devices=2 /dev/sdb1 / dev/sdc1
104
Thedefaultchunksizeis64KB.
3 CreatethenestedRAID0+1device.Atthecommandprompt,enterthefollowingcommand
usingthesoftwareRAID0devicesyoucreatedinStep 2:
mdadm --create /dev/md2 --run --level=1 --raid-devices=2 /dev/md0 /dev/md1 4 CreateafilesystemontheRAID0+1device/dev/md2,suchasaReiserfilesystem(reiserfs).For
example,atthecommandprompt,enter
mkfs.reiserfs /dev/md2
Modifythecommandifyouwanttouseadifferentfilesystem.
5 Editthe/etc/mdadm.conffiletoaddentriesforthecomponentdevicesandtheRAIDdevice/ dev/md2. 6 Editthe/etc/fstabfiletoaddanentryfortheRAID0+1device/dev/md2. 7 Reboottheserver.
TheRAID0+1deviceismountedto/local.
10.3
10.3.1
105
mdadm RAID10 Option Allows an even or odd number of component devices Managed as a single RAID device Striping occurs in the near or far layout on component devices. The far layout provides sequential read throughput that scales by number of drives, rather than number of RAID 1 pairs.
Nested RAID 10 (1+0) Requires an even number of component devices Manage as a nested RAID device Striping occurs consecutively across component devices
Two or more copies, up to the number of devices in the array A single spare can service all component devices
Copies on each mirrored segment Configure a spare for each underlying mirrored array, or configure a spare to serve a spare group that serves all mirrors.
Near Layout
Withthenearlayout,copiesofablockofdataarestripedneareachotherondifferentcomponent devices.Thatis,multiplecopiesofonedatablockareatsimilaroffsetsindifferentdevices.Nearis thedefaultlayoutforRAID10.Forexample,ifyouuseanoddnumberofcomponentdevicesandtwo copiesofdata,somecopiesareperhapsonechunkfurtherintothedevice. ThenearlayoutforthemdadmRAID10yieldsreadandwriteperformancesimilartoRAID0overhalf thenumberofdrives. Nearlayoutwithanevennumberofdisksandtworeplicas:
106
Nearlayoutwithanoddnumberofdisksandtworeplicas:
sda1 sdb1 sdc1 sde1 sdf1 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12
Far Layout
Thefarlayoutstripesdataovertheearlypartofalldrives,thenstripesasecondcopyofthedataover thelaterpartofalldrives,makingsurethatallcopiesofablockareondifferentdrives.Thesecond setofvaluesstartshalfwaythroughthecomponentdrives. Withafarlayout,thereadperformanceofthemdadmRAID10issimilartoaRAID0overthefull numberofdrives,butwriteperformanceissubstantiallyslowerthanaRAID0becausethereismore seekingofthedriveheads.Itisbestusedforreadintensiveoperationssuchasforreadonlyfile servers. Thespeedoftheraid10forwritingissimilartoothermirroredRAIDtypes,likeraid1andraid10 usingnearlayout,astheelevatorofthefilesystemschedulesthewritesinamoreoptimalwaythan rawwriting.Usingraid10inthefarlayoutwellsuitedformirroredwritingapplications. Farlayoutwithanevennumberofdisksandtworeplicas:
sda1 sdb1 sdc1 sde1 0 1 2 3 4 5 6 7 . . . 3 0 1 2 7 4 5 6
Farlayoutwithanoddnumberofdisksandtworeplicas:
sda1 sdb1 sdc1 sde1 sdf1 0 1 2 3 4 5 6 7 8 9 . . . 4 0 1 2 3 9 5 6 7 8
10.3.2
107
Raw Devices
/dev/md3
1 InYaST,createa0xFDLinuxRAIDpartitiononthedevicesyouwanttouseintheRAID,suchas /dev/sdf1,/dev/sdg1,/dev/sdh1,and/dev/sdi1. 2 Openaterminalconsole,thenloginastherootuserorequivalent. 3 CreateaRAID10command.Atthecommandprompt,enter(allonthesameline): mdadm --create /dev/md3 --run --level=10 --chunk=4 --raid-devices=4 /dev/sdf1 / dev/sdg1 /dev/sdh1 /dev/sdi1 4 CreateaReiserfilesystemontheRAID10device/dev/md3.Atthecommandprompt,enter mkfs.reiserfs /dev/md3 5 Editthe/etc/mdadm.conffiletoaddentriesforthecomponentdevicesandtheRAIDdevice/ dev/md3.Forexample: DEVICE /dev/md3 6 Editthe/etc/fstabfiletoaddanentryfortheRAID10device/dev/md3. 7 Reboottheserver.
TheRAID10deviceismountedto/raid10.
10.4
Tocreateadegradedarrayinwhichsomedevicesaremissing,simplygivethewordmissingin placeofadevicename.Thiscausesmdadmtoleavethecorrespondingslotinthearrayempty.
108
followingatthecommandprompt:
mdadm --create /dev/md0 -l 1 -n 2 /dev/sda1 missing
Thedeviceshouldbethesamesizeorlargerthanthedeviceyouplantoaddtoit.
2 IfthedeviceyouwanttoaddtothemirrorcontainsdatathatyouwanttomovetotheRAID
array,copyitnowtotheRAIDarraywhileitisrunningindegradedmode.
3 Addadevicetothemirror.Forexample,toadd/dev/sdb1totheRAID,enterthefollowingat
thecommandprompt:
mdadm /dev/md0 -a /dev/sdb1
Youcanaddonlyonedeviceatatime.Youmustwaitforthekerneltobuildthemirrorandbring itfullyonlinebeforeyouaddanothermirror.
4 Monitorthebuildprogressbyenteringthefollowingatthecommandprompt: cat /proc/mdstat
Toseetherebuildprogresswhilebeingrefreshedeverysecond,enter
watch -n 1 cat /proc/mdstat
109
110
11
ThissectiondescribeshowtoincreaseorreducethesizeofasoftwareRAID1,4,5,or6devicewith theMultipleDeviceAdministration(mdadm(8))tool. WARNING:Beforestartinganyofthetasksdescribedinthissection,makesurethatyouhaveavalid backupofallofthedata. Section 11.1,UnderstandingtheResizingProcess,onpage 111 Section 11.2,IncreasingtheSizeofaSoftwareRAID,onpage 112 Section 11.3,DecreasingtheSizeofaSoftwareRAID,onpage 116
11.1
11.1.1
Resizinganypartitionorfilesysteminvolvessomerisksthatcanpotentiallyresultinlosingdata.
111
WARNING:Toavoiddataloss,makesuretobackupyourdatabeforeyoubeginanyresizingtask.
11.1.2
Overview of Tasks
ResizingtheRAIDinvolvesthefollowingtasks.Theorderinwhichthesetasksisperformeddepends onwhetheryouareincreasingordecreasingitssize.
Table 11-2 TasksInvolvedinResizingaRAID
Tasks
Description
Increase or decrease the active size of each 1 component partition. You remove only one component partition at a time, modify its size, then return it to the RAID. 2
Resize the software RAID The RAID does not automatically know about the itself. increases or decreases you make to the underlying component partitions. You must inform it about the new size. Resize the file system.
You must resize the file system that resides on the 3 RAID. This is possible only for file systems that provide tools for resizing, such as Ext2, Ext3, and ReiserFS.
11.2
11.2.1
112
Theprocedureinthissectionusesthedevicenamesshowninthefollowingtable.Makesureto modifythenamestousethenamesofyourowndevices.
Table 11-3 ScenarioforIncreasingtheSizeofComponentPartitions
RAID Device
Component Partitions
/dev/md0
ToincreasethesizeofthecomponentpartitionsfortheRAID:
1 Openaterminalconsole,thenloginastherootuserorequivalent. 2 MakesurethattheRAIDarrayisconsistentandsynchronizedbyentering cat /proc/mdstat
IfyourRAIDarrayisstillsynchronizingaccordingtotheoutputofthiscommand,youmust waituntilsynchronizationiscompletebeforecontinuing.
3 RemoveoneofthecomponentpartitionsfromtheRAIDarray.Forexample,toremove/dev/ sda1,enter mdadm /dev/md0 --fail /dev/sda1 --remove /dev/sda1
Inordertosucceed,boththefailandremoveactionsmustbedone.
4 IncreasethesizeofthepartitionthatyouremovedinStep 3bydoingoneofthefollowing:
WaituntiltheRAIDissynchronizedandconsistentbeforecontinuingwiththenextpartition.
6 RepeatStep 2throughStep 5foreachoftheremainingcomponentdevicesinthearray.Make
suretomodifythecommandsforthecorrectcomponentpartition.
7 Ifyougetamessagethattellsyouthatthekernelcouldnotrereadthepartitiontableforthe
RAID,youmustrebootthecomputerafterallpartitionshavebeenresizedtoforceanupdateof thepartitiontable.
8 ContinuewithSection 11.2.2,IncreasingtheSizeoftheRAIDArray,onpage 114.
113
11.2.2
Increasethesizeofthearraytothemaximumavailablesizebyentering
mdadm --grow /dev/md0 -z max
Increasethesizeofthearraytoaspecifiedvaluebyentering
mdadm --grow /dev/md0 -z size
Replacesizewithanintegervalueinkilobytes(akilobyteis1024bytes)forthedesiredsize.
4 Recheckthesizeofyourarrayandthedevicesizeknowntothearraybyentering mdadm -D /dev/md0 | grep -e "Array Size" -e "Device Size" 5 Dooneofthefollowing:
11.2.3
114
Ext2 or Ext3
Ext2andExt3filesystemscanberesizedwhenmountedorunmountedwiththeresize2fs command.
1 Openaterminalconsole,thenloginastherootuserorequivalent. 2 Increasethesizeofthefilesystemusingoneofthefollowingmethods:
ToextendthefilesystemsizetothemaximumavailablesizeofthesoftwareRAIDdevice called/dev/md0,enter
resize2fs /dev/md0
Ifasizeparameterisnotspecified,thesizedefaultstothesizeofthepartition. Toextendthefilesystemtoaspecificsize,enter
resize2fs /dev/md0 size
Forexample,tomountanExt2filesystemforaRAIDnamed/dev/md0atmountpoint/raid, enter
mount -t ext2 /dev/md0 /raid 4 Checktheeffectoftheresizeonthemountedfilesystembyentering df -h
ReiserFS
AswithExt2andExt3,aReiserFSfilesystemcanbeincreasedinsizewhilemountedorunmounted. TheresizeisdoneontheblockdeviceofyourRAIDarray.
1 Openaterminalconsole,thenloginastherootuserorequivalent. 2 IncreasethesizeofthefilesystemonthesoftwareRAIDdevicecalled/dev/md0,usingoneof
thefollowingmethods: Toextendthefilesystemsizetothemaximumavailablesizeofthedevice,enter
resize_reiserfs /dev/md0
Whennosizeisspecified,thisincreasesthevolumetothefullsizeofthepartition. Toextendthefilesystemtoaspecificsize,enter
resize_reiserfs -s size /dev/md0
115
Waituntiltheresizingiscompletedbeforecontinuing.
3 Ifthefilesystemisnotmounted,mountitnow.
Forexample,tomountanReiserFSfilesystemforaRAIDnamed/dev/md0atmountpoint/
raid,enter mount -t reiserfs /dev/md0 /raid 4 Checktheeffectoftheresizeonthemountedfilesystembyentering df -h
11.3
11.3.1
Ext2 or Ext3
TheExt2andExt3filesystemscanberesizedwhenmountedorunmounted.
1 Openaterminalconsole,thenloginastherootuserorequivalent. 2 DecreasethesizeofthefilesystemontheRAIDbyentering
116
Replacesizewithanintegervalueinkilobytesforthedesiredsize.(Akilobyteis1024bytes.) Waituntiltheresizingiscompletedbeforecontinuing.
3 Ifthefilesystemisnotmounted,mountitnow.Forexample,tomountanExt2filesystemfora RAIDnamed/dev/md0atmountpoint/raid,enter mount -t ext2 /dev/md0 /raid 4 Checktheeffectoftheresizeonthemountedfilesystembyentering df -h
ReiserFS
ReiserFSfilesystemscanbedecreasedinsizeonlyifthevolumeisunmounted.
1 Openaterminalconsole,thenloginastherootuserorequivalent. 2 Unmountthedevicebyentering umount /mnt/point
Ifthepartitionyouareattemptingtodecreaseinsizecontainssystemfiles(suchastheroot(/) volume),unmountingispossibleonlywhenbootingfromabootableCDorfloppy.
3 DecreasethesizeofthefilesystemonthesoftwareRAIDdevicecalled/dev/md0byentering resize_reiserfs -s size /dev/md0
Waituntiltheresizingiscompletedbeforecontinuing.
4 Mountthefilesystembyentering mount -t reiserfs /dev/md0 /mnt/point 5 Checktheeffectoftheresizeonthemountedfilesystembyentering df -h
117
11.3.2
RAID Device
Component Partitions
/dev/md0
ToresizethecomponentpartitionsfortheRAID:
1 Openaterminalconsole,thenloginastherootuserorequivalent. 2 MakesurethattheRAIDarrayisconsistentandsynchronizedbyentering cat /proc/mdstat
IfyourRAIDarrayisstillsynchronizingaccordingtotheoutputofthiscommand,youmust waituntilsynchronizationiscompletebeforecontinuing.
3 RemoveoneofthecomponentpartitionsfromtheRAIDarray.Forexample,toremove/dev/ sda1,enter mdadm /dev/md0 --fail /dev/sda1 --remove /dev/sda1
Inordertosucceed,boththefailandremoveactionsmustbedone.
4 IncreasethesizeofthepartitionthatyouremovedinStep 3bydoingoneofthefollowing:
WaituntiltheRAIDissynchronizedandconsistentbeforecontinuingwiththenextpartition.
6 RepeatStep 2throughStep 5foreachoftheremainingcomponentdevicesinthearray.Make
suretomodifythecommandsforthecorrectcomponentpartition.
118
7 Ifyougetamessagethattellsyouthatthekernelcouldnotrereadthepartitiontableforthe
RAID,youmustrebootthecomputerafterresizingallofitscomponentpartitions.
8 ContinuewithSection 11.3.3,DecreasingtheSizeoftheRAIDArray,onpage 119.
11.3.3
Decreasethesizeofthearraytothemaximumavailablesizebyentering
mdadm --grow /dev/md0 -z max
Decreasethesizeofthearraytoaspecifiedvaluebyentering
mdadm --grow /dev/md0 -z size
Replacesizewithanintegervalueinkilobytesforthedesiredsize.(Akilobyteis1024 bytes.)
4 Recheckthesizeofyourarrayandthedevicesizeknowntothearraybyentering mdadm -D /dev/md0 | grep -e "Array Size" -e "Device Size" 5 Dooneofthefollowing:
119
120
12
12
Storageareanetworks(SANs)cancontainmanydiskdrivesthataredispersedacrosscomplex networks.Thiscanmakedevicediscoveryanddeviceownershipdifficult.iSCSIinitiatorsmustbe abletoidentifystorageresourcesintheSANanddeterminewhethertheyhaveaccesstothem. InternetStorageNameService(iSNS)isastandardsbasedservicethatisavailablebeginningwith SUSELinuxEnterpriseServer(SLES)10SupportPack2.iSNSfacilitatestheautomateddiscovery, management,andconfigurationofiSCSIdevicesonaTCP/IPnetwork.iSNSprovidesintelligent storagediscoveryandmanagementservicescomparabletothosefoundinFibreChannelnetworks. IMPORTANT:iSNSshouldbeusedonlyinsecureinternalnetworks. Section 12.1,HowiSNSWorks,onpage 121 Section 12.2,InstallingiSNSServerforLinux,onpage 122 Section 12.3,ConfiguringiSNSDiscoveryDomains,onpage 123 Section 12.4,StartingiSNS,onpage 128 Section 12.5,StoppingiSNS,onpage 128 Section 12.6,ForMoreInformation,onpage 128
12.1
121
BothiSCSItargetsandiSCSIinitiatorsuseiSNSclientstoinitiatetransactionswithiSNSserversby usingtheiSNSprotocol.Theythenregisterdeviceattributeinformationinacommondiscovery domain,downloadinformationaboutotherregisteredclients,andreceiveasynchronousnotification ofeventsthatoccurintheirdiscoverydomain. iSNSserversrespondtoiSNSprotocolqueriesandrequestsmadebyiSNSclientsusingtheiSNS protocol.iSNSserversinitiateiSNSprotocolstatechangenotificationsandstoreproperly authenticatedinformationsubmittedbyaregistrationrequestinaniSNSdatabase. SomeofthebenefitsprovidedbyiSNSforLinuxinclude: Providesaninformationfacilityforregistration,discovery,andmanagementofnetworked storageassets. IntegrateswiththeDNSinfrastructure. Consolidatesregistration,discovery,andmanagementofiSCSIstorage. Simplifiesstoragemanagementimplementations. Improvesscalabilitycomparedtootherdiscoverymethods. AnexampleofthebenefitsiSNSprovidescanbebetterunderstoodthroughthefollowingscenario: Supposeyouhaveacompanythathas100iSCSIinitiatorsand100iSCSItargets.Dependingonyour configuration,alliSCSIinitiatorscouldpotentiallytrytodiscoverandconnecttoanyofthe100iSCSI targets.Thiscouldcreatediscoveryandconnectiondifficulties.Bygroupinginitiatorsandtargets intodiscoverydomains,youcanpreventiSCSIinitiatorsinonedepartmentfromdiscoveringthe iSCSItargetsinanotherdepartment.TheresultisthattheiSCSIinitiatorsinaspecificdepartment onlydiscoverthoseiSCSItargetsthatarepartofthedepartmentsdiscoverydomain.
12.2
122
ToinstalliSNSforLinux:
1 StartYaSTandselectNetworkServices>iSNSServer. 2 Whenpromptedtoinstalltheisnspackage,clickInstall. 3 FollowtheinstalldialoginstructionstoprovidetheSUSELinuxEnterpriseServer11installation
4 InAddressofiSNSServer,specifytheDNSnameorIPaddressoftheiSNSServer. 5 InServiceStart,selectoneofthefollowing:
12.3
123
IMPORTANT:TheSNSservicemustbeinstalledandrunningtoconfigureiSNSdiscoverydomains. Forinformation,seeSection 12.4,StartingiSNS,onpage 128. Section 12.3.1,CreatingiSNSDiscoveryDomains,onpage 124 Section 12.3.2,CreatingiSNSDiscoveryDomainSets,onpage 125 Section 12.3.3,AddingiSCSINodestoaDiscoveryDomain,onpage 126 Section 12.3.4,AddingDiscoveryDomainstoaDiscoveryDomainSet,onpage 128
12.3.1
TheDiscoveryDomainsarealistsalldiscoverydomains.Youcancreatenewdiscoverydomains, ordeleteexistingones.Deletingadomainremovesthemembersfromthedomain,butitdoes notdeletetheiSCSInodemembers. TheDiscoveryDomainMembersarealistsalliSCSInodesassignedtoaselecteddiscoverydomain. Selectingadifferentdiscoverydomainrefreshesthelistwithmembersfromthatdiscovery domain.YoucanaddanddeleteiSCSInodesfromaselecteddiscoverydomain.Deletingan iSCSInoderemovesitfromthedomain,butitdoesnotdeletetheiSCSInode. CreatinganiSCSInodeallowsanodethatisnotyetregisteredtobeaddedasamemberofthe discoverydomain.WhentheiSCSIinitiatorortargetregistersthisnode,thenitbecomespartof thisdomain. WhenaniSCSIinitiatorperformsadiscoveryrequest,theiSNSservicereturnsalliSCSInode targetsthataremembersofthesamediscoverydomain.
124
3 ClicktheCreateDiscoveryDomainbutton.
YoucanalsoselectanexistingdiscoverydomainandclicktheDeletebuttontoremovethat discoverydomain.
4 Specifythenameofthediscoverydomainyouarecreating,thenclickOK. 5 ContinuewithSection 12.3.2,CreatingiSNSDiscoveryDomainSets,onpage 125.
12.3.2
TheDiscoveryDomainSetsarealistsallofthediscoverdomainsets.Adiscoverydomainmustbe amemberofadiscoverydomainsetinordertobeactive. InaniSNSdatabase,adiscoverydomainsetcontainsdiscoverydomains,whichinturncontains iSCSInodemembers. TheDiscoveryDomainSetMembersarealistsalldiscoverydomainsthatareassignedtoaselected discoverydomainset.Selectingadifferentdiscoverydomainsetrefreshesthelistwithmembers fromthatdiscoverydomainset.Youcanaddanddeletediscoverydomainsfromaselected discoverydomainset.Removingadiscoverydomainremovesitfromthedomainset,butitdoes notdeletethediscoverydomain. AddingandiscoverydomaintoasetallowsanotyetregisterediSNSdiscoverydomaintobe addedasamemberofthediscoverydomainset.
125
3 ClicktheCreateDiscoveryDomainSetbutton.
YoucanalsoselectanexistingdiscoverydomainsetandclicktheDeletebuttontoremovethat discoverydomainset.
4 Specifythenameofthediscoverydomainsetyouarecreating,thenclickOK. 5 ContinuewithSection 12.3.3,AddingiSCSINodestoaDiscoveryDomain,onpage 126.
12.3.3
126
3 ReviewthelistofnodestomakesurethattheiSCSItargetsandinitiatorsthatyouwanttouse
theiSNSservicearelisted. IfaniSCSItargetorinitiatorisnotlisted,youmightneedtorestarttheiSCSIserviceonthenode. Youcandothisbyrunningthercopen-iscsi restartcommandtorestartaninitiatororthe rciscsitarget restartcommandtorestartatarget. YoucanselectaniSCSInodeandclicktheDeletebuttontoremovethatnodefromtheiSNS database.ThisisusefulifyouarenolongerusinganiSCSInodeorhaverenamedit. TheiSCSInodeisautomaticallyaddedtothelist(iSNSdatabase)againwhenyourestartthe iSCSIserviceorreboottheserverunlessyouremoveorcommentouttheiSNSportionofthe iSCSIconfigurationfile.
4 ClicktheDiscoveryDomainstab,selectthedesireddiscoverydomain,thenclicktheDisplay
Membersbutton.
5 ClickAddexistingiSCSINode,selectthenodeyouwanttoaddtothedomain,thenclickAdd
Node.
6 RepeatStep 5forasmanynodesasyouwanttoaddtothediscoverydomain,thenclickDone
whenyouarefinishedaddingnodes. AniSCSInodecanbelongtomorethanonediscoverydomain.
7 ContinuewithSection 12.3.4,AddingDiscoveryDomainstoaDiscoveryDomainSet,on
page 128.
127
12.3.4
domainset,thenclickAddDiscoveryDomain.
6 Repeatthelaststepforasmanydiscoverydomainsasyouwanttoaddtothediscoverydomain
set,thenclickDone. Adiscoverydomaincanbelongtomorethanonediscoverydomainset.
12.4
Starting iSNS
iSNSmustbestartedattheserverwhereyouinstallit.Enteroneofthefollowingcommandsata terminalconsoleastherootuser:
rcisns start /etc/init.d/isns start
Youcanalsousethestop,status,andrestartoptionswithiSNS. iSNScanalsobeconfiguredtostartautomaticallyeachtimetheserverisrebooted:
1 StartYaSTandunderNetworkServices,selectiSNSServer. 2 WiththeServicetabselected,specifytheIPaddressofyouriSNSserver,thenclickSaveAddress. 3 IntheServiceStartsectionofthescreen,selectWhenBooting.
12.5
Stopping iSNS
iSNSmustbestoppedattheserverwhereitisrunning.Enteroneofthefollowingcommandsata terminalconsoleastherootuser:
rcisns stop /etc/init.d/isns stop
12.6
128
13
13
Server 2
Server 3
Server 4
Server 5
Server 6
Ethernet Card(s) iSCSI Initiator iSCSI Initiator iSCSI Initiator iSCSI Initiator iSCSI Initiator iSCSI Initiator
Server 7
iSCSI SAN
Ethernet Switch
129
embeddedinIPpacketsandencryptedasnecessarybysoftwarethatiscommonlyknownasthe iSCSIinitiator.ThepacketsaretransferredacrosstheinternalIPnetworktothecorrespondingiSCSI remotestation,calledtheiSCSItarget. ManystoragesolutionsprovideaccessoveriSCSI,butitisalsopossibletorunaLinuxserverthat providesaniSCSItarget.Inthiscase,itisimportanttosetupaLinuxserverthatisoptimizedforfile systemservices.TheiSCSItargetaccessesblockdevicesinLinux.Therefore,itispossibletouse RAIDsolutionstoincreasediskspaceaswellasalotofmemorytoimprovedatacaching.Formore informationaboutRAID,alsoseeChapter 8,SoftwareRAIDConfiguration,onpage 91. Section 13.1,InstallingiSCSI,onpage 130 Section 13.2,SettingUpaniSCSITarget,onpage 131 Section 13.3,ConfiguringiSCSIInitiator,onpage 137 Section 13.4,TroubleshootingiSCSI,onpage 141 Section 13.5,AdditionalInformation,onpage 143
13.1
Installing iSCSI
YaSTincludesentriesforiSCSITargetandiSCSIInitiatorsoftware,butthepackagesarenotinstalled bydefault. IMPORTANT:ItisnotsupportedtoruniSCSItargetsoftwareandiSCSIinitiatorsoftwareonthe sameserverinaproductionenvironment. Section 13.1.1,InstallingiSCSITargetSoftware,onpage 130 Section 13.1.2,InstallingtheiSCSIInitiatorSoftware,onpage 130
13.1.1
Whentheinstallationiscomplete,YaSTopenstotheiSCSITargetOverviewpagewiththe Servicetabselected.
5 ContinuewithSection 13.2,SettingUpaniSCSITarget,onpage 131.
13.1.2
130
4 Followtheonscreeninstallinstructions,andprovidetheinstallationmediaasneeded.
Whentheinstallationiscomplete,YaSTopenstotheiSCSIInitiatorOverviewpagewiththe Servicetabselected.
5 ContinuewithSection 13.3,ConfiguringiSCSIInitiator,onpage 137.
13.2
13.2.1
Partitioning Devices
1 Loginastherootuser,thenopenYaST. 2 SelectSystem>Partitioner. 3 ClickYestocontinuethroughthewarningaboutusingthePartitioner. 4 ClickAddtocreateapartition,butdonotformatit,anddonotmountit.
iSCSItargetscanuseunformattedpartitionswithLinux,LinuxLVM,orLinuxRAIDfilesystem IDs.
4a SelectPrimaryPartition,thenclickNext. 4b Specifytheamountofspacetouse,thenclickNext. 4c SelectDonotformat,thenspecifythefilesystemIDtype. 4d SelectDonotmount. 4e ClickFinish. 5 RepeatStep 4foreachareathatyouwanttouselaterasaniSCSILUN. 6 ClickAccepttokeepyourchanges,thencloseYaST.
131
usingtheprocessinPartitioningDevicesonpage 131.
13.2.2
132
Target TheTargetlinehasafixedsyntaxthatlookslikethefollowing:
iqn.yyyy-mm.<reversed domain name>:unique_id
Italwaysstartswithiqn.yyyymmistheformatofthedatewhenthistargetisactivated.Find moreaboutnamingconventionsinRFC3722(http://www.ietf.org/rfc/rfc3722.txt). Identifier TheIdentifierisfreelyselectable.Itshouldfollowsomeschemetomakethewholesystemmore structured. LUN ItispossibletoassignseveralLUNstoatarget.Todothis,selectatargetintheTargetstab,then clickEdit.Then,addnewLUNstoanexistingtarget. Path Addthepathtotheblockdeviceorfilesystemimagetoexport. Thenextmenuconfigurestheaccessrestrictionsofthetarget.Theconfigurationisverysimilartothe configurationofthediscoveryauthentication.Inthiscase,atleastanincomingauthenticationshould besetup. Nextfinishestheconfigurationofthenewtarget,andbringsyoubacktotheoverviewpageofthe Targettab.ActivateyourchangesbyclickingFinish. Tocreateatargetdevice:
1 OpenYaST,andloginastherootuser. 2 SelectNetworkServices>iSCSITarget.
YaSTopenstotheiSCSITargetOverviewpagewiththeServicetabselected.
3 IntheServiceStartarea,selectoneofthefollowing:
Whenbooting:Automaticallystarttheinitiatorserviceonsubsequentserverreboots.
133
Manually(default):Starttheservicemanually.
4 IfyouareusingiSNSfortargetadvertising,selecttheiSNSAccessControlcheckbox,thentype
theIPaddress.
5 Ifdesired,openthefirewallportstoallowaccesstotheserverfromremotecomputers. 5a SelecttheOpenPortinFirewallcheckbox. 5b SpecifythenetworkinterfaceswhereyouwanttoopentheportbyclickingFirewallDetails,
selectingthecheckboxnexttoanetworkinterfacetoenableit,thenclickingOKtoaccept thesettings.
6 Ifauthenticationisrequiredtoconnecttotargetdevicesyousetuponthisserver,selectthe
thenconfirmthedeletionbyclickingContinue.
7c ClickAddtoaddanewiSCSItarget.
TheiSCSItargetautomaticallypresentsanunformattedpartitionorblockdeviceand completestheTargetandIdentifierfields.
7d Youcanacceptthis,orbrowsetoselectadifferentspace.
134
iSCSItargetstoafile. Thismakesiteasiertolaterprovidethisinformationtoconsumersoftheresources.
7h ClickFinishtocreatethedevices,thenclickYestorestarttheiSCSIsoftwarestack.
13.2.3
ThisconfigurationmakestheiSCSItargetregisteritselfwiththeiSNSserver,whichinturnprovides thediscoveryforinitiators.FormoreaboutiSNS,seeChapter 12,iSNSforLinux,onpage 121.The accesscontrolfortheiSNSdiscoveryisnotsupported.JustkeepiSNSAccessControl no. AlldirectiSCSIauthenticationcanbedoneintwodirections.TheiSCSItargetcanrequiretheiSCSI initiatortoauthenticatewiththeIncomingUser,whichcanbeaddedmultipletimes.TheiSCSI initiatorcanalsorequiretheiSCSItargettoauthenticate.UseOutgoingUserforthis.Bothhavethe samesyntax:
IncomingUser <username> <password> OutgoingUser <username> <password>
IntheTargetline,yyyy-mmisthedatewhenthistargetisactivated,andidentifierisfreely selectable.FindmoreaboutnamingconventionsinRFC3722(http://www.ietf.org/rfc/rfc3722.txt). Threedifferentblockdevicesareexportedinthisexample.Thefirstblockdeviceisalogicalvolume (seealsoChapter 4,LVMConfiguration,onpage 27),thesecondisanIDEpartition,andthethird isanimageavailableinthelocalfilesystem.AlltheselooklikeblockdevicestoaniSCSIinitiator. BeforeactivatingtheiSCSItarget,addatleastoneIncomingUseraftertheLundefinitions.Itdoesthe authenticationfortheuseofthistarget. Toactivateallyourchanges,restarttheiscsitargetdaemonwithrcopen-iscsi restart.Checkyour configurationinthe/procfilesystem:
cat /proc/net/iet/volume tid:1 name:iqn.2006-02.com.example.iserv:systems lun:0 state:0 iotype:fileio path:/dev/mapper/system-v3 lun:1 state:0 iotype:fileio path:/dev/hda4 lun:2 state:0 iotype:fileio path:/var/lib/xen/images/xen-1
135
13.2.4
Tosetupthisconfigurationmanually,proceedasfollows:
1 Createanewtargetwiththecommandietadm --op new --tid=2 --params Name=iqn.2006-02.com.example.iserv:system2. 2 Addalogicalunitwithietadm --op new --tid=2 --lun=0 --params Path=/dev/mapper/ system-swap2. 3 Settheusernameandpasswordcombinationonthistargetwithietadm --op new --tid=2 -user --params=IncomingUser=joe,Password=secret. 4 Checktheconfigurationwithcat /proc/net/iet/volume.
Itisalsopossibletodeleteactiveconnections.First,checkallactiveconnectionswiththecommand
cat /proc/net/iet/session.Thismightlooklike: cat /proc/net/iet/session tid:1 name:iqn.2006-03.com.example.iserv:system sid:281474980708864 initiator:iqn.1996-04.com.example:01.82725735af5 cid:0 ip:192.168.178.72 state:active hd:none dd:none
TodeletethesessionwiththesessionID281474980708864,usethecommandietadm --op delete -tid=1 --sid=281474980708864 --cid=0.Beawarethatthismakesthedeviceinaccessibleonthe clientsystemandprocessesaccessingthisdevicearelikelytohang. ietadmcanalsobeusedtochangevariousconfigurationparameters.Obtainalistoftheglobal variableswithietadm --op show --tid=1 --sid=0.Theoutputlookslike:
136
InitialR2T=Yes ImmediateData=Yes MaxConnections=1 MaxRecvDataSegmentLength=8192 MaxXmitDataSegmentLength=8192 MaxBurstLength=262144 FirstBurstLength=65536 DefaultTime2Wait=2 DefaultTime2Retain=20 MaxOutstandingR2T=1 DataPDUInOrder=Yes DataSequenceInOrder=Yes ErrorRecoveryLevel=0 HeaderDigest=None DataDigest=None OFMarker=No IFMarker=No OFMarkInt=Reject IFMarkInt=Reject
Alloftheseparameterscanbeeasilychanged.Forexample,ifyouwanttochangethemaximum numberofconnectionstotwo,use
ietadm --op update --tid=1 --params=MaxConnections=2.
13.3
13.3.1
137
Onthispage,youcanselectatargetdevice,thentogglethestartupsettingforeachiSCSItarget device: Automatic:ThisoptionisusedforiSCSItargetsthataretobeconnectedwhentheiSCSI serviceitselfstartsup.Thisisthetypicalconfiguration. Onboot:ThisoptionisusedforiSCSItargetsthataretobeconnectedduringboot;thatis, whenroot(/)isoniSCSI.Assuch,theiSCSItargetdevicewillbeevaluatedfromtheinitrd onserverboots. DiscoveredTargets:DiscoveredTargetsprovidesthepossibilityofmanuallydiscoveringiSCSI targetsinthenetwork. ConfiguringtheiSCSIInitiatoronpage 138 DiscoveringiSCSITargetsbyUsingiSNSonpage 139 DiscoveringiSCSITargetsManuallyonpage 139 SettingtheStartupPreferenceforiSCSITargetDevicesonpage 140
YaSTopenstotheiSCSIInitiatorOverviewpagewiththeServicetabselected.
3 IntheServiceStartarea,selectoneofthefollowing:
Whenbooting:Automaticallystarttheinitiatorserviceonsubsequentserverreboots. Manually(default):Starttheservicemanually.
4 SpecifyorverifytheInitiatorName.
138
iqn.yyyy-mm.com.mycompany:n1:n2
wheren1andn2arealphanumericcharacters.Forexample:
iqn.1996-04.de.suse:01:9c83a3e15f64
TheInitiatorNameisautomaticallycompletedwiththecorrespondingvaluefromthe/etc/
iscsi/initiatorname.iscsifileontheserver.
Thedefaultportis3205.
3 OntheiSCSIInitiatorOverviewpage,clickFinishtosaveandapplyyourchanges.
Thedefaultportis3260.
4 Ifauthenticationisrequired,deselectNoAuthentication,thenspecifythecredentialstheIncoming
orOutgoingauthentication.
5 ClickNexttostartthediscoveryandconnecttotheiSCSItargetserver. 6 Ifcredentialsarerequired,afterasuccessfuldiscovery,useLogintoactivatethetarget.
YouarepromptedforauthenticationcredentialstousetheselectediSCSItarget.
7 ClickNexttofinishtheconfiguration.
Ifeverythingwentwell,thetargetnowappearsinConnectedTargets. ThevirtualiSCSIdeviceisnowavailable.
8 OntheiSCSIInitiatorOverviewpage,clickFinishtosaveandapplyyourchanges.
139
devicesthatarecurrentlyconnectedtotheserver.
2 SelecttheiSCSItargetdevicethatyouwanttomanage. 3 ClickToggleStartUptomodifythesetting:
13.3.2
Thenewlygenerateddevicesshowupintheoutputoflsscsiandcannowbeaccessedbymount.
140
13.3.3
RemoveobsoletedatasetswiththedeleteoperationIfthetargetiqn.200602.com.example.iserv:systemsisnolongeravalidrecord,deletethisrecordwiththefollowing command:
iscsiadm -m node -n iqn.2006-02.com.example.iserv:systems --op=delete
13.4
Troubleshooting iSCSI
Section 13.4.1,HotplugDoesntWorkforMountingiSCSITargets,onpage 142 Section 13.4.2,DataPacketsDroppedforiSCSITraffic,onpage 142 Section 13.4.3,UsingiSCSIVolumeswithLVM,onpage 142
141
13.4.1
ForSLES11,thehotplugoptionnolongerworks.Usethenofailoptioninstead.Forexample:
/dev/sdb1 /mnt/mountpoint ext3 acl,user,nofail 0 0
Forinformation,seeTID7004427:/etc/fstabentrydoesnotmountiSCSIdeviceonbootup(http:// www.novell.com/support/php/search.do?cmd=displayKC&docType=kc&externalId=7004427).
13.4.2
13.4.3
142
13.5
Additional Information
TheiSCSIprotocolhasbeenavailableforseveralyears.Therearemanyreviewsandadditional documentationcomparingiSCSIwithSANsolutions,doingperformancebenchmarks,orjust describinghardwaresolutions.Importantpagesformoreinformationaboutopeniscsiare: OpeniSCSIProject(http://www.openiscsi.org/) AppNote:iFolderonOpenEnterpriseServerLinuxClusterusingiSCSI(http://www.novell.com/ coolsolutions/appnote/15394.html) Thereisalsosomeonlinedocumentationavailable.Seethemanpagesforiscsiadm,iscsid, ietd.conf,andietdandtheexampleconfigurationfile/etc/iscsid.conf.
143
144
14
14
Volume Snapshots
Afilesystemsnapshotisacopyonwritetechnologythatmonitorschangestoanexistingvolumes datablockssothatwhenawriteismadetooneoftheblocks,theblocksvalueatthesnapshottimeis copiedtoasnapshotvolume.Inthisway,apointintimecopyofthedataispreserveduntilthe snapshotvolumeisdeleted. Section 14.1,UnderstandingVolumeSnapshots,onpage 145 Section 14.2,CreatingLinuxSnapshotswithLVM,onpage 146 Section 14.3,MonitoringaSnapshot,onpage 146 Section 14.4,DeletingLinuxSnapshots,onpage 146
14.1
Volume Snapshots
145
14.2
Forexample:
lvcreate -s -L 1G -n linux01-snap /dev/lvm/linux01
Thesnapshotiscreatedasthe/dev/lvm/linux01-snapvolume.
14.3
Monitoring a Snapshot
1 Openaterminalconsole,loginastherootuser,thenenter lvdisplay snap_volume
Forexample:
lvdisplay /dev/vg01/linux01-snap --- Logical volume --LV Name VG Name LV UUID LV Write Access LV snapshot status LV Status # open LV Size Current LE COW-table size COW-table LE Allocated to snapshot Snapshot chunk size Segments Allocation Read ahead sectors Block device /dev/lvm/linux01 vg01 QHVJYh-PR3s-A4SG-s4Aa-MyWN-Ra7a-HL47KL read/write active destination for /dev/lvm/linux01 available 0 80.00 GB 1024 8.00 GB 512 30% 8.00 KB 1 inherit 0 254:5
14.4
Forexample:
lvremove /dev/lvm/linux01-snap
146
15
15
Thissectiondescribeshowtoworkaroundknownissuesfordevices,softwareRAIDs,multipathI/O, andvolumes. Section 15.1,IsDMMPIOAvailablefortheBootPartition?,onpage 147 Section 15.2,IssuesforiSCSI,onpage 147 Section 15.3,IssuesforMultipathI/O,onpage 147 Section 15.4,IssuesforSoftwareRAIDs,onpage 147
15.1
147
148
Documentation Updates
ThissectioncontainsinformationaboutdocumentationcontentchangesmadetotheSUSELinux EnterpriseServerStorageAdministrationGuidesincetheinitialreleaseofSUSELinuxEnterpriseServer 11.Ifyouareanexistinguser,reviewthechangeentriestoreadilyidentifymodifiedcontent.Ifyou areanewuser,simplyreadtheguideinitscurrentstate. Thisdocumentwasupdatedonthefollowingdates: Section A.1,December15,2011,onpage 149 Section A.2,September8,2011,onpage 150 Section A.3,July12,2011,onpage 151 Section A.4,June14,2011,onpage 151 Section A.5,May5,2011,onpage 151 Section A.6,January2011,onpage 152 Section A.7,September16,2010,onpage 153 Section A.8,June21,2010,onpage 153 Section A.9,May2010(SLES11SP1),onpage 154 Section A.10,February23,2010,onpage 156 Section A.11,December1,2009,onpage 157 Section A.12,October20,2009,onpage 158 Section A.13,August3,2009,onpage 159 Section A.14,June22,2009,onpage 159 Section A.15,May21,2009,onpage 160
A.1
Documentation Updates
149
A.1.1
Table 7-6, Multipath Attributes, on page 72 Recommendations were added for the no_path_retry and failback settings when multipath I/O is used in a cluster environment. Table 7-6, Multipath Attributes, on page 72 The path-selector option names and settings were corrected: round-robin 0 least-pending 0 service-time 0 queue-length 0
A.1.2
A.2
September 8, 2011
Updatesweremadetothefollowingsection.Thechangesareexplainedbelow. Section A.2.1,ManagingMultipathI/OforDevices,onpage 150
A.2.1
Configuring Default Multipath Behavior in / The default getuid path for SLES 11 is /lib/udev/scsi_id. etc/multipath.conf on page 70
In the dmsetup message commands, the 0 value represents the sector and is used when sector information is not needed.
150
A.3
A.3.1
A.4
A.4.1
A.4.2
Section 2.2.12, Change from Multibus to This section is new. Failover as the Default Setting for the MPIO Path Grouping Policy, on page 24
A.5
May 5, 2011
Thisreleasefixesbrokenlinksandremovesobsoletereferences.
Documentation Updates
151
A.6
January 2011
Updatesweremadetothefollowingsection.Thechangesareexplainedbelow. Section A.6.1,LVMConfiguration,onpage 152 Section A.6.2,ManagingMultipathI/OforDevices,onpage 152 Section A.6.3,ResizingFileSystems,onpage 152
A.6.1
LVM Configuration
Location Section 4.3, Creating Volume Groups, on page 30 Change LVM2 does not restrict the number of physical extents. Having a large number of extents has no impact on I/O performance to the logical volume, but it slows down the LVM tools.
A.6.2
A.6.3
152
A.7
A.7.1
LVM Configuration
Location Creating LVM Partitions on page 29 Change The discussion and procedure were expanded to explain how to configure a partition that uses the entire disk. The procedure was modified to use the Hard Disk partitioning feature in the YaST Partitioner. All LVM Management sections Resizing a Volume Group on page 36 Resizing a Logical Volume with YaST on page 36 Deleting a Volume Group on page 38 Deleting an LVM Partition (Physical Volume) on page 38 Procedures throughout the chapter were modified to use Volume Management in the YaST Partitioner. This section is new. This section is new. This section is new. This section is new.
A.8
A.8.1
LVM Configuration
Location Creating LVM Partitions on page 29 Change Details were added to the procedure.
Documentation Updates
153
A.8.2
A.8.3
A.8.4
A.9
154
A.9.1
Enabling Multipath I/O at Install Time on an This section is new. Active/Active Multipath Storage LUN on page 80 Enabling Multipath I/O at Install Time on an This section is new. Active/Passive Multipath Storage LUN on page 80
A.9.2
Documentation Updates
155
A.9.3
A.9.4
Whats New
Location Change
Section 2.1, Whats New in SLES 11 SP1, This section is new. on page 19
A.10
A.10.1
A.10.2
156
A.11
December 1, 2009
Updatesweremadetothefollowingsections.Thechangesareexplainedbelow. Section A.11.1,ManagingMultipathI/OforDevices,onpage 157 Section A.11.2,ResizingFileSystems,onpage 157 Section A.11.3,WhatsNew,onpage 157
A.11.1
A.11.2
A.11.3
Whats New
Location Section 2.2.10, Location Change for Multipath Tool Callouts, on page 24 Section 2.2.11, Change from mpath to multipath for the mkinitrd -f Option, on page 24 Change This section is new.
Documentation Updates
157
A.12
A.12.1
LVM Configuration
Location Section 4.1, Understanding the Logical Volume Manager, on page 27 Change In the YaST Control Center, select System > Partitioner.
A.12.2
Configuring Default Multipath Behavior in / Changed getuid_callout to getuid. etc/multipath.conf on page 70 Understanding Priority Groups and Attributes on page 72 path_selector on page 75 Changed getuid_callout to getuid.
A.12.3
Whats New
Location Section 2.2.9, Advanced I/O LoadBalancing Options for Multipath, on page 24 Change This section is new.
158
A.13
August 3, 2009
Updatesweremadetothefollowingsection.Thechangeisexplainedbelow. Section A.13.1,ManagingMultipathI/O,onpage 159
A.13.1
A.14
A.14.1
Section 7.10, Scanning for New Partitioned Corrected the syntax for the command lines in Step 2. Devices without Rebooting, on page 86 Section 7.10, Scanning for New Partitioned Step 7 on page 86 replaces old Step 7 and Step 8. Devices without Rebooting, on page 86
A.14.2
Documentation Updates
159
A.14.3
Onboot: This option is used for iSCSI targets that are to be connected during boot; that is, when root (/) is on iSCSI. As
such, the iSCSI target device will be evaluated from the initrd on server boots.
A.15
A.15.1
Configuring Default Settings for zSeries in / This section is new. etc/multipath.conf on page 70 Section 7.7, Configuring Multipath I/O for the Root Device, on page 79 DM-MP is now available and supported for /boot and /root in SUSE Linux Enterprise Server 11.
160