Red Hat Enterprise Linux 7 Storage Administration Guide

Transcription

Red Hat Enterprise Linux 7Storage Administration GuideDeploying and configuring single-node storage in Red Hat EnterpriseLinux 7Red Hat Subject Matter ExpertsJosef BacikKamil DudkaHans de GoedeDoug LedfordDaniel NovotnyDavid WysochanskiContributorsSachin PrabhuRob EversDavid LehmanJeff MoyerMike SnitzerHarald HoyerNathan StrazMichael ChristieDavid HowellsEric Sandeen

Red Hat Enterprise Linux 7 Storage Administration GuideDeploying and configuring single-node storage in Red Hat EnterpriseLinux 7Jo sef BacikServer Develo pment Kernel File Systemjwhiter@redhat.co mDisk Quo tasKamil DudkaBase Operating System Co re Services - BRNOkdudka@redhat.co mAccess Co ntro l ListsHans de Go edeBase Operating System Installerhdego ede@redhat.co mPartitio nsHarald Ho yerEngineering So ftware Engineeringharald@redhat.co mFile SystemsDo ug Ledfo rdServer Develo pment Hardware Enablementdledfo rd@redhat.co mRAIDDaniel No vo tnyBase Operating System Co re Services - BRNOdno vo tny@redhat.co mThe /pro c File SystemNathan StrazQuality Engineering QE - Platfo rmnstraz@redhat.co mGFS2David Wyso chanskiServer Develo pment Kernel Sto ragedwyso cha@redhat.co mLVM/LVM2Michael ChristieServer Develo pment Kernel Sto ragemchristi@redhat.co mOnline Sto rageSachin PrabhuSo ftware Maintenance Engineeringsprabhu@redhat.co mNFSRo b EversServer Develo pment Kernel Sto ragerevers@redhat.co mOnline Sto rage

David HowellsLegalNoticeServer Develo pment Hardware Enablementdhowells@redhat.coCopyright 2013 mRed Hat Inc. and others.FS-CacheThis document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 UnportedDavid LehmanLicense.If youSystemdistributethis document, or a modified version of it, you must provide attribution to RedBaseOperatingInstallerHat, Inc. and providedlehman@redhat.com a link to the original. If the document is modified, all Red Hat trademarks must beremoved.Storage co nfiguratio n during installatio nJeffyer as the licensor of this document, waives the right to enforce, and agrees not to assert, SectionRedMoHat,Server Develo pment Kernel File System4d of CC-BY-SA to the fullest extent permitted by applicable law.jmo yer@redhat.co mSo lid-State DisksRed Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo,andRHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.Eric SandeenServer Develo pment Kernel File Systemesandeen@redhat.coLinux is the registeredmtrademark of Linus T orvalds in the United States and other countries.ext3, ext4 , XFS, Encrypted File SystemsJava is a registered trademark of Oracle and/or its affiliates.Mike SnitzerServer Develo pment Kernel Sto rageXFS is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United Statesmsnitzer@redhat.co mand/orcountries.I/O Stackotherand LimitsMySQL is a registeredtrademark of MySQL AB in the United States, the European Union and otherRed Hat SubjectMatter Expertscountries.Co ntributo rsNode.js is an official trademark of Joyent. Red Hat Software Collections is not formally related to orEditedbyby the official Joyent Node.js open source or commercial project.endorsedJacquelynn EastThe OpenStack ServicesWord Mark and OpenStack Logo are either registered trademarks/service marks orEngineeringCo ntentjeast@redhat.co mtrademarks/servicemarks of the OpenStack Foundation, in the United States and other countries andare used with the OpenStack Foundation's permission. We are not affiliated with, endorsed orDo n Do mingosponsoredby the OpenStack Foundation, or the OpenStack community.Engineering Co ntent Servicesddo mingo @redhat.co mAll other trademarks are the property of their respective owners.AbstractT his guide provides instructions on how to effectively manage storage devices and file systems on RedHat Enterprise Linux 7. It is intended for use by system administrators with basic to intermediateknowledge of Red Hat Enterprise Linux or Fedora.

T able of ContentsTable of Contents. .hapter C. . . . . . 1. . Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . 1.1. What's New in Red Hat Enterprise Linux 77. . . . . . . . .noteCryptfs. . . included. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . . . . . . . .StorageSystem. . . . . . . Manager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . . . . isXFS. . the. . . .default. . . . . . .File. . . .System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . . . . systemFile. . . . . . . restructure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . .Snapper. . . RFSBT. . . . (T. . echnology. . . . . . . . . .Preview). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . . . . . . .noNFSv2. . longer. . . . . . .supported. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . .art P. . .I. File. . . . Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8. . . . . . . . . .hapter C. . . . . . 2. . File. . . . System. . . . . . . Structure. . . . . . . . . and. . . . Maintenance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9. . . . . . . . . 2.1. Why Share a Common Structure?9 2.2. Overview of Filesystem Hierarchy Standard (FHS)9 2.3. Special Red Hat Enterprise Linux File Locations16 2.4. T he /proc Virtual File System17 2.5. Discard unused blocks17. .hapter C. . . . . . 3. . Btrfs. . . . . (T. . echnology. . . . . . . . . .Preview). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19. 3.1. Creating a btrfs File System19 3.2. Mounting a btrfs file system19 3.3. Resizing a btrfs file system20. . . . . . . . . .a. btrfsEnlarging. . . . .File. . . .System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20.aShrinking. . btrfs. . . . .File. . . .System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.Set. . . the. . . .File. . . System. . . . . . . Size. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21. 3.4. Integrated Volume Management of Multiple Devices21 3.5. SSD Optimization25 3.6. btrfs references26. .hapter C. . . . . . 4. . .T.he. . .Ext3. . . . File. . . .System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27. 4 .1. Creating an Ext3 File System28 4 .2. Converting to an Ext3 File System28 4 .3. Reverting to an Ext2 File System29. .hapter C. . . . . . 5.T. .he. . Ext4. . . . . File. . . .System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30. 5.1. Creating an Ext4 File System31 5.2. Mounting an Ext4 File System32.Write. . . . .Barriers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32. 5.3. Resizing an Ext4 File System33 5.4. Other Ext4 File System Utilities33. .hapter C. . . . . . 6.T. .he. . XFS. . . . File. . . . System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35. 6.1. Creating an XFS File System36 6.2. Mounting an XFS File System36.Write. . . . .Barriers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37. 6.3. XFS Quota Management371

Red Hat Enterprise Linux 7 Storage Administration Guide.Setting. . . . . . .Project. . . . . . .Limits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39. 6.4. Increasing the Size of an XFS File System39 6.5. Repairing an XFS File System40 6.6. Suspending an XFS File System40 6.7. Backup and Restoration of XFS File Systems40. . . . . . .ModeSimple. . . . . for. . . xfsrestore. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4. 2. . . . . . . . . . . . . . . . . . . ModeCumulative. . . . . for. . . xfsrestore. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4. 2. . . . . . . . .Interactive. . . . . . . . . .Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4. 2. . . . . . . . . 6.8. Other XFS File System Utilities43 6.9. Migrating from ext4 to XFS44. .hapter C. . . . . . 7. . Global. . . . . . .File. . . .System. . . . . . .2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4. 7. . . . . . . . . .hapter C. . . . . . 8. . Network. . . . . . . . File. . . . System. . . . . . . (NFS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4. 8. . . . . . . . . 8.1. How It Works48 8.2. pNFS50 8.3. NFS Client Configuration51 8.4. autofs52 8.5. Common NFS Mount Options58 8.6. Starting and Stopping NFS60 8.7. NFS Server Configuration60 8.8. Securing NFS66 8.9. NFS and rpcbind68 8.10. References70. . . . . . . . .DocumentationInstalled. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70. . . . . . .WebsitesUseful. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70. . . . . . . .BooksRelated. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70. .hapter C. . . . . . 9. . FS-Cache. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71. 9.1. Performance Guarantee72 9.2. Setting Up a Cache72 9.3. Using the Cache With NFS73 9.4. Setting Cache Cull Limits75 9.5. Statistical Information76 9.6. References76. .art P. . .II. .Storage. . . . . . . .Administration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77. .hapter C. . . . . . 10. . . .Storage. . . . . . . Considerations. . . . . . . . . . . . . . .During. . . . . . Installation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78. 10.1. Special Considerations78. . . . . . . . . PartitionsSeparate. . . . . . . . . .for. . ./home,. . . . . . /opt,. . . . ./usr/local. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78. . . . . . andDASD. . . . zFCP. . . . . Devices. . . . . . . .on. . .IBM. . . .System. . . . . . .Z. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78. . . . . . . . . . .BlockEncrypting. . . . . Devices. . . . . . . .Using. . . . . LUKS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78. . . . . .BIOSStale. . . . .RAID. . . . .Metadata. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78. . . . . .DetectioniSCSI. . . . . . . . . and. . . . Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79. . . . . .DetectionFCoE. . . . . . . . . and. . . . Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79DASD. . . . . .DevicesBlock. . . . . . . .with. . . .DIF/DIX. . . . . . .Enabled. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79.2

T able of Contents. .hapter C. . . . . . 11. . . .File. . . System. . . . . . . Check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80. 11.1. Best Practices for fsck80 11.2. Filesystem-Specific Information for fsck81. .hapter C. . . . . . 12. . . .Partitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85. 12.1. Viewing the Partition T able86 12.2. Creating a Partition87 12.3. Removing a Partition89 12.4. Resizing a Partition89. .hapter C. . . . . . 13. . . LVM. . . . .(Logical. . . . . . . Volume. . . . . . . Manager). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91. 13.1. What is LVM2?92 13.2. References92. . . . . . . . .DocumentationInstalled. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92. . . . . . .WebsitesUseful. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92. .hapter C. . . . . . 14. . . .Snapper. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93. 14.1. Initial Snapper Setup93 14.2. Creating a Snapper Snapshot93 14.3. Snapper status Command94 14.4. Other Snapper Commands96. .hapter C. . . . . . 15. . . .Swap. . . . .Space. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97. 15.1. What is Swap Space?97 15.2. Adding Swap Space97 15.3. Removing Swap Space99 15.4. Moving Swap Space101. .hapter C. . . . . . 16. . . .System. . . . . . .Storage. . . . . . . Manager. . . . . . . . .(SSM). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102. 16.1. SSM Installation102 16.2. SSM Commands102 16.3. SSM Backends111 16.4. SSM References113. .hapter C. . . . . . 17. . . .Disk. . . .Quotas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114. 17.1. Configuring Disk Quotas114 17.2. Managing Disk Quotas118 17.3. References120. .hapter C. . . . . . 18. . . .Redundant. . . . . . . . . .Array. . . . . of. . .Independent. . . . . . . . . . . Disks. . . . . .(RAID). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121. 18.1. What is RAID?121 18.2. Who Should Use RAID?121 18.3. RAID T ypes121. . . . . . . . . RAIDFirmware. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121. . . . . . . . . .RAIDHardware. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121.Software. . . . . . . . RAID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122. 18.4. RAID Levels and Linear Support122 18.5. Linux RAID Subsystems124. . . . . .HardwareLinux. . . . . . . . .RAID. . . . .controller. . . . . . . . . drivers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124mdraid.dmraid. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124. 18.6. RAID Support in the Installer125 18.7. Configuring RAID Sets1253

Red Hat Enterprise Linux 7 Storage Administration Guide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125mdadm.dmraid. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125. 18.8. Advanced RAID Device Creation125. .hapter C. . . . . . 19. . . .Using. . . . . the. . . .mount. . . . . .Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127. 19.1. Listing Currently Mounted File Systems127 19.2. Mounting a File System128 19.3. Unmounting a File System135 19.4. Documentation136. .hapter C. . . . . . 20. . . .T.he. . .volume key. . . . . . . . . . .function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137. 20.1. Commands137 20.2. Using volume key as an individual user138 20.3. Using volume key in a larger organization139 20.4. Documentation141. .hapter C. . . . . . 21. . . .Access. . . . . . Control. . . . . . . .Lists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14. . 2. . . . . . . . . 21.1. Mounting File Systems142 21.2. Setting Access ACLs142 21.3. Setting Default ACLs144 21.4. Retrieving ACLs144 21.5. Archiving File Systems With ACLs144 21.6. Compatibility with Older Systems145 21.7. References146. .hapter C. . . . . . 22. . . .Solid-State. . . . . . . . . . Disk. . . . .Deployment. . . . . . . . . . .Guidelines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14. . 7. . . . . . . . . 22.1. Deployment Considerations147 22.2. T uning Considerations148. . . SchedulerI/O. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14. . 8. . . . . . . . . . . . . . .MemoryVirtual. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14. . 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14Swap. . 8. . . . . . . . . .hapter C. . . . . . 23. . . Write. . . . . .Barriers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14. . 9. . . . . . . . . 23.1. Importance of Write Barriers149.How. . . .Write. . . . .Barriers. . . . . . . .Work. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14. . 9. . . . . . . . . 23.2. Enabling/Disabling Write Barriers149 23.3. Write Barrier Considerations150. . . . . . . . . WriteDisabling. . . . . .Caches. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150. . . . . . . . . . . . . . . WriteBattery-Backed. . . . . .Caches. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150. . . . . . . . . ArraysHigh-End. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151NFS. .hapter C. . . . . . 24. . . .Storage. . . . . . . I/O. . . Alignment. . . . . . . . . .and. . . .Size. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .152. 24.1. Parameters for Storage Access152 24.2. Userspace Access153. . . . . .Interfacesysfs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.Block. . . . .Device. . . . . . .ioctls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153. 24.3. Standards154. . .A. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154AT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154SCSI.4

T able of Contents.SCSI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154. 24.4. Stacking I/O Parameters154 24.5. Logical Volume Manager155 24.6. Partition and File System T ools155. . . . . . . . . . . . . libblkidutil-linux-ng's. . . . . . . and. . . . fdisk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155. . . . . . .andparted. . . .libparted. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155. . . . SystemFile. . . . . . . tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156. .hapter C. . . . . . 25. . . .Setting. . . . . . .Up. . .A. Remote. . . . . . . .Diskless. . . . . . . .System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157. 25.1. Configuring a tftp Service for Diskless Clients157 25.2. Configuring DHCP for Diskless Clients157 25.3. Configuring an Exported File System for Diskless Clients158. .hapter C. . . . . . 26. . . . Online. . . . . . Storage. . . . . . . . Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .160. 26.1. Fibre Channel160 26.2. iSCSI162 26.3. Persistent Naming164 26.4. Removing a Storage Device166 26.5. Removing a Path to a Storage Device167 26.6. Adding a Storage Device or Path168 26.7. Configuring a Fibre-Channel Over Ethernet Interface169 26.8. Configuring an FCoE Interface to Automatically Mount at Boot173 26.9. Scanning Storage Interconnects175 26.10. iSCSI Discovery Configuration176 26.11. Configuring iSCSI Offload and Interface Binding176 26.12. Scanning iSCSI Interconnects180 26.13. Logging In to an iSCSI T arget183 26.14. Resizing an Online Logical Unit183 26.15. Adding/Removing a Logical Unit T hrough rescan-scsi-bus.sh188.Known. . . . . .Issues. . . . . . With. . . . .rescan-scsi-bus.sh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .188. 26.16. Modifying Link Loss Behavior188.SCSI. . . . Error. . . . . Handler. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .190. 26.16.2.2. replacement timeout190 26.16.3. iSCSI Root191.Configuring.T. .imeouts. . . . . . . for. . . a. .Specific. . . . . . . .Session. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191. 26.17. Controlling the SCSI Command T imer and Device Status191. . . . . . . StatesDevice. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192.Command. . . . . . . . .T. imer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192. 26.18. T roubleshooting192. .hapter C. . . . . . 27. . . .Device. . . . . . Mapper. . . . . . . Multipathing. . . . . . . . . . . . and. . . . Virtual. . . . . . Storage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .194. 27.1. Virtual Storage194 27.2. DM-Multipath194. .hapter C. . . . . . 28. . . .External. . . . . . . .Array. . . . . Management. . . . . . . . . . . . (libStorageMgmt). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .196. 28.1. What is libStorageMgmt196 28.2. T erminology from libStorageMgmt197 28.3. Installation198 28.4. Use of the libStorageMgmt199 28.5. libStorageMgmt Documentation203. . . . . . . . .HistoryRevision. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204. I.ndex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .207.5

Red Hat Enterprise Linux 7 Storage Administration Guide6

C hapter 1. OverviewChapter 1. OverviewT he Storage Administration Guide contains extensive information on supported file systems and datastorage features in Red Hat Enterprise Linux 7. T his book is intended as a quick reference foradministrators managing single-node (that is, non-clustered) storage solutions.T he Storage Administration Guide is split into two parts: File Systems, and Storage Administration.T he File Systems part details the various file systems Red Hat Enterprise Linux 7 supports. It describesthem and explains how best to utilize them.T he Storage Administration part details the various tools and storage administration tasks Red HatEnterprise Linux 7 supports. It describes them and explains how best to utilize them.1.1. What's New in Red Hat Enterprise Linux 7Red Hat Enterprise Linux 7 features the following file system enhancements:eCryptfs not includedAs of Red Hat Enterprise Linux 7 eCryptfs is not included. Refer to Red Hat's Security Guide forinformation on encrypting file systems.System Storage ManagerRed Hat Enterprise Linux 7 includes a new application called System Storage Manager. T his provides acommand-line interface to manage various storage technologies. For more information, see Chapter 16,System Storage Manager (SSM).XFS is the default File SystemAs of Red Hat Enterprise Linux 7, XFS is the default file system. For more information about the XFS filesystem, see Chapter 6, The XFS File System.File system restructureRed Hat Enterprise Linux 7 introduces a new file system structure. T he directories /bin, /sbin, /lib,and /lib64 are now nested under /usr.SnapperRed Hat Enterprise Linux 7 introduces a new tool called snapper that allows for the easy creation andmanagement of snapshots for LVM and BT RFS. For more information refer to Chapter 14, Snapper.BT RFS (T echnology Preview)BT RFS is a local file system that aims to provide better performance and scalability, including integratedLVM operations. T his file system is not fully supported by Red Hat and as such is a technology preview.For more information on Btrfs, see Chapter 3, Btrfs (Technology Preview).NFSv2 no longer supportedAs of Red Hat Enterprise Linux 7, NFSv2 is no longer supported.7

Red Hat Enterprise Linux 7 Storage Administration Guide Part I. File SystemsT he File Systems section explains file system structure followed by two technology previews: eCryptfs andBtrfs. T his is followed by the file systems Red Hat fully supports: ext3, ext4, global file system 2, XFS, NFS,and FS-Cache.A comparison guide of what each file system supports can be accessed limits. Note that currently it only covers up to Red HatEnterprise 6. T his will be updated when Red Hat Enterprise Linux 7 is available.8

C hapter 2. File System Structure and MaintenanceChapter 2. File System Structure and Maintenance2.1. Why Share a Common Structure?T he file system structure is the most basic level of organization in an operating system. T he way anoperating system interacts with its users, applications, and security model nearly always depends on howthe operating system organizes files on storage devices. Providing a common file system structureensures users and programs can access and write files.File systems break files down into two logical categories:Shareable vs. unsharable filesVariable vs. static filesShareable files can be accessed locally and by remote hosts; unsharable files are only available locally.Variable files, such as documents, can be changed at any time; static files, such as binaries, do not changewithout an action from the system administrator.Categorizing files in this manner helps correlate the function of each file with the permissions assigned tothe directories which hold them. How the operating system and its users interact with a file determines thedirectory in which it is placed, whether that direct

Red Hat Enterprise Linux 7 Storage Administration Guide Deploying and configuring single-node storage in Red Hat Enterprise Linux 7 Josef Bacik Server Development Kernel File System jwhiter@redhat.com Disk Quotas Kamil Dudka Base Operating System Core Services - BRNO kdudka@redhat.com Access Control Lists Hans de Goede Base Operating System .