217
Red Hat Subject Matter ExpertsJosef Bacik Kamil Dudka Hans de Goede Doug Ledford Daniel Novotny Nathan Straz David Wysochanski Contributors Michael Christie Sachin Prabhu Rob Evers David Howells David Lehman Jeff Moyer Eric Sandeen Mike Snitzer Red Hat Enterprise Linux 6 Storage Administration Guide Deploying and configuring single-node storage in Red Hat Enterprise Linux 6 Edition 2

Red Hat Enterprise Linux-6-Storage Administration Guide-En-US

Embed Size (px)

DESCRIPTION

Red hat

Citation preview

  • Red Hat Subject Matter ExpertsJosef BacikKamil Dudka Hans de Goede Doug LedfordDaniel Novotny Nathan Straz David WysochanskiContributors Michael Christ ie Sachin PrabhuRob Evers David Howells David LehmanJeff Moyer Eric Sandeen Mike Snitzer

    Red Hat Enterprise Linux 6Storage Administration Guide

    Deploying and configuring single-node storage in Red Hat Enterprise Linux6Edit ion 2

  • Red Hat Enterprise Linux 6 Storage Administrat ion Guide

    Deploying and configuring single-node storage in Red Hat Enterprise Linux6Edit ion 2

    Josef BacikServer Development Kernel File [email protected] QuotasKamil DudkaBase Operating System Core Services - [email protected] Contro l ListsHans de GoedeBase Operating System [email protected] LedfordServer Development Hardware [email protected] NovotnyBase Operating System Core Services - [email protected] /proc File SystemNathan StrazQuality Engineering QE - [email protected] WysochanskiServer Development Kernel [email protected]/LVM2Michael ChristieServer Development Kernel [email protected] StorageSachin PrabhuSoftware Maintenance [email protected] EversServer Development Kernel Storage

  • [email protected] StorageDavid HowellsServer Development Hardware [email protected] LehmanBase Operating System [email protected] configuration during installationJeff MoyerServer Development Kernel File [email protected] DisksEric SandeenServer Development Kernel File [email protected], ext4 , XFS, Encrypted File SystemsMike SnitzerServer Development Kernel [email protected]/O Stack and LimitsRed Hat Subject Matter ExpertsContributors

    Edited byJacquelynn EastCustomer Content [email protected] DomingoCustomer Content [email protected]

  • Legal NoticeCopyright 2013 Red Hat Inc. and o thers.This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0Unported License. If you distribute this document, o r a modified version o f it, you must provideattribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all RedHat trademarks must be removed.Red Hat, as the licensor o f this document, waives the right to enforce, and agrees not to assert,Section 4d o f CC-BY-SA to the fullest extent permitted by applicable law.Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the InfinityLogo, and RHCE are trademarks o f Red Hat, Inc., registered in the United States and o thercountries.Linux is the registered trademark o f Linus Torvalds in the United States and o ther countries.Java is a registered trademark o f Oracle and/or its affiliates.XFS is a trademark o f Silicon Graphics International Corp. or its subsidiaries in the UnitedStates and/or o ther countries.MySQL is a registered trademark o f MySQL AB in the United States, the European Union andother countries.Node.js is an o fficial trademark o f Joyent. Red Hat Software Collections is not fo rmallyrelated to or endorsed by the o fficial Joyent Node.js open source or commercial pro ject.The OpenStack Word Mark and OpenStack Logo are either registered trademarks/servicemarks or trademarks/service marks o f the OpenStack Foundation, in the United States and o thercountries and are used with the OpenStack Foundation's permission. We are not affiliated with,endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.All o ther trademarks are the property o f their respective owners.

    AbstractThis guide provides instructions on how to effectively manage storage devices and file systemson Red Hat Enterprise Linux 6 . It is intended for use by system administrators with basic tointermediate knowledge o f Red Hat Enterprise Linux or Fedora.

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Table of ContentsPreface

    1. Do cument Co nventio ns1.1. Typ o g rap hic Co nventio ns1.2. Pull-q uo te Co nventio ns1.3. No tes and Warning s

    2. Getting Help and G iving Feed b ack2.1. Do Yo u Need Help ?2.2. We Need Feed b ack

    Chapt er 1 . Overview1.1. What's New in Red Hat Enterp rise Linux 6

    File System Encryp tio n (Techno lo g y Preview)File System Caching (Techno lo g y Preview)Btrfs (Techno lo g y Preview)I/O Limit Pro cessingext4 Sup p o rtNetwo rk Blo ck Sto rag e

    Part I. File Syst ems

    Chapt er 2 . File Syst em St ruct ure and Maint enance2.1. Overview o f Filesystem Hierarchy Stand ard (FHS)

    2.1.1. FHS Org anizatio n2.1.1.1. Gathering File System Info rmatio n2.1.1.2. The /b o o t/ Directo ry2.1.1.3. The /d ev/ Directo ry2.1.1.4. The /etc/ Directo ry2.1.1.5. The /l ib / Directo ry2.1.1.6 . The /med ia/ Directo ry2.1.1.7. The /mnt/ Directo ry2.1.1.8 . The /o p t/ Directo ry2.1.1.9 . The /p ro c/ Directo ry2.1.1.10 . The /sb in/ Directo ry2.1.1.11. The /srv/ Directo ry2.1.1.12. The /sys/ Directo ry2.1.1.13. The /usr/ Directo ry2.1.1.14. The /var/ Directo ry

    2.2. Sp ecial Red Hat Enterp rise Linux File Lo catio ns2.3. The /p ro c Virtual File System2.4. Discard unused b lo cks

    Chapt er 3. Encrypt ed File Syst em3.1. Mo unting a File System as Encryp ted3.2. Ad d itio nal Info rmatio n

    Chapt er 4 . Bt rfs4.1. Btrfs Features

    Chapt er 5. T he Ext 3 File Syst em5.1. Creating an Ext3 File System5.2. Co nverting to an Ext3 File System5.3. Reverting to an Ext2 File System

    Chapt er 6 . T he Ext 4 File Syst em

    8889

    10101011

    1 212121212121213

    1 4

    1 515151517171818181818191919202021232324

    2 52526

    2 727

    2 8292930

    32

    T able of Cont ent s

    1

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Chapt er 6 . T he Ext 4 File Syst em6 .1. Creating an Ext4 File System6 .2. Mo unting an Ext4 File System

    Write Barriers6 .3. Resiz ing an Ext4 File System6 .4. Backup ext2/3/4 File Systems6 .5. Resto re an ext2/3/4 File System6 .6 . O ther Ext4 File System Util i ties

    Chapt er 7 . G lobal File Syst em 2

    Chapt er 8 . T he XFS File Syst em8 .1. Creating an XFS File System8 .2. Mo unting an XFS File System

    Write Barriers8 .3. XFS Quo ta Manag ement

    Setting Pro ject Limits8 .4. Increasing the Size o f an XFS File System8 .5. Rep airing an XFS File System8 .6 . Susp end ing an XFS File System8 .7. Backup and Resto ratio n o f XFS File Systems

    Simp le Mo d e fo r xfsresto reCumulative Mo d e fo r xfsresto reInteractive Op eratio n

    8 .8 . O ther XFS File System Util i ties

    Chapt er 9 . Net work File Syst em (NFS)9 .1. Ho w NFS Wo rks

    9 .1.1. Req uired Services9 .2. p NFS9 .3. NFS Client Co nfig uratio n

    9 .3.1. Mo unting NFS File Systems using /etc/fs tab9 .4. auto fs

    9 .4.1. Imp ro vements in auto fs Vers io n 5 o ver Vers io n 49 .4.2. auto fs Co nfig uratio n9 .4.3. Overrid ing o r Aug menting Site Co nfig uratio n Files9 .4.4. Using LDAP to Sto re Auto mo unter Map s

    9 .5. Co mmo n NFS Mo unt Op tio ns9 .6 . Starting and Sto p p ing NFS9 .7. NFS Server Co nfig uratio n

    9 .7.1. The /etc/exp o rts Co nfig uratio n File9 .7.2. The exp o rtfs Co mmand

    9 .7.2.1. Using exp o rtfs with NFSv49 .7.3. Running NFS Behind a Firewall

    9 .7.3.1. Disco vering NFS exp o rts9 .7.4. Ho stname Fo rmats9 .7.5. NFS o ver RDMA

    9 .8 . Securing NFS9 .8 .1. NFS Security with AUTH_SYS and exp o rt co ntro ls9 .8 .2. NFS security with AUTH_GSS

    9 .8 .2.1. NFS security with NFSv49 .8 .3. File Permissio ns

    9 .9 . NFS and rp cb ind9 .9 .1. Tro ub lesho o ting NFS and rp cb ind

    9 .10 . References

    3233343435353738

    4 0

    4 141424343454545464648484848

    50505152535454555658596 16 26 36 36 66 76 76 86 86 97070707171727273

    St orage Administ rat ion Guide

    2

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    9 .10 . ReferencesInstalled Do cumentatio nUseful Web sitesRelated Bo o ks

    Chapt er 1 0 . FS- Cache10 .1. Perfo rmance Guarantee10 .2. Setting Up a Cache10 .3. Using the Cache With NFS

    10 .3.1. Cache Sharing10 .3.2. Cache Limitatio ns With NFS

    10 .4. Setting Cache Cull Limits10 .5. Statis tical Info rmatio n10 .6 . References

    Part II. St orage Administ rat ion

    Chapt er 1 1 . St orage Considerat ions During Inst allat ion11.1. Up d ates to Sto rag e Co nfig uratio n During Installatio n11.2. Overview o f Sup p o rted File Systems11.3. Sp ecial Co nsid eratio ns

    Sep arate Partitio ns fo r /ho me, /o p t, /usr/lo calDASD and zFCP Devices o n IBM System ZEncryp ting Blo ck Devices Using LUKSStale BIOS RAID Metad ataiSCSI Detectio n and Co nfig uratio nFCo E Detectio n and Co nfig uratio nDASDBlo ck Devices with DIF/DIX Enab led

    Chapt er 1 2 . File Syst em Check12.1. Best Practices fo r fsck12.2. Filesystem-Sp ecific Info rmatio n fo r fsck

    12.2.1. ext2, ext3, and ext412.2.2. XFS12.2.3. Btrfs

    Chapt er 1 3. Part it ions13.1. Viewing the Partitio n Tab le13.2. Creating a Partitio n

    13.2.1. Making the Partitio n13.2.2. Fo rmatting and Lab eling the Partitio n13.2.3. Ad d to /etc/fs tab

    13.3. Remo ving a Partitio n13.4. Resiz ing a Partitio n

    Chapt er 1 4 . LVM (Logical Volume Manager)14.1. What is LVM2?14.2. Using system-co nfig -lvm

    14.2.1. Uti l iz ing Uninitialized Entities14.2.2. Ad d ing Unallo cated Vo lumes to a Vo lume Gro up14.2.3. Mig rating Extents14.2.4. Ad d ing a New Hard Disk Using LVM14.2.5. Ad d ing a New Vo lume Gro up14.2.6 . Extend ing a Vo lume Gro up14.2.7. Ed iting a Lo g ical Vo lume

    73737373

    7 57676777778798 08 0

    8 1

    8 28 28 28 38 38 38 38 48 48 48 48 4

    8 68 68 78 78 89 0

    9 19 29 39 39 49 49 59 5

    9 79 89 8

    10 110 210 510 710 810 9111

    T able of Cont ent s

    3

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    14.2.7. Ed iting a Lo g ical Vo lume14.3. LVM References

    Installed Do cumentatio nUseful Web sites

    Chapt er 1 5. Swap Space15.1. Ad d ing Swap Sp ace

    15.1.1. Extend ing Swap o n an LVM2 Lo g ical Vo lume15.1.2. Creating an LVM2 Lo g ical Vo lume fo r Swap15.1.3. Creating a Swap File

    15.2. Remo ving Swap Sp ace15.2.1. Red ucing Swap o n an LVM2 Lo g ical Vo lume15.2.2. Remo ving an LVM2 Lo g ical Vo lume fo r Swap15.2.3. Remo ving a Swap File

    15.3. Mo ving Swap Sp ace

    Chapt er 1 6 . Disk Quot as16 .1. Co nfig uring Disk Quo tas

    16 .1.1. Enab ling Quo tas16 .1.2. Remo unting the File Systems16 .1.3. Creating the Quo ta Datab ase Files16 .1.4. Assig ning Quo tas p er User16 .1.5. Assig ning Quo tas p er Gro up16 .1.6 . Setting the Grace Perio d fo r So ft Limits

    16 .2. Manag ing Disk Quo tas16 .2.1. Enab ling and Disab ling16 .2.2. Rep o rting o n Disk Quo tas16 .2.3. Keep ing Quo tas Accurate

    16 .3. Disk Quo ta References

    Chapt er 1 7 . Redundant Array of Independent Disks (RAID)17.1. RAID Typ es

    Firmware RAIDHard ware RAIDSo ftware RAID

    17.2. RAID Levels and Linear Sup p o rt17.3. Linux RAID Sub systems

    Linux Hard ware RAID co ntro ller d riversmd raidd mraid

    17.4. RAID Sup p o rt in the Installer17.5. Co nfig uring RAID Sets

    md ad md mraid

    17.6 . Ad vanced RAID Device Creatio n

    Chapt er 1 8 . Using t he mount Command18 .1. Lis ting Currently Mo unted File Systems

    18 .1.1. Sp ecifying the File System Typ e18 .2. Mo unting a File System

    18 .2.1. Sp ecifying the File System Typ e18 .2.2. Sp ecifying the Mo unt Op tio ns18 .2.3. Sharing Mo unts18 .2.4. Mo ving a Mo unt Po int

    18 .3. Unmo unting a File System

    111114114114

    1 1 5115116116117117117118118119

    1 2 0120120121121122123124124124124125126

    1 2 7127127127127128130130130130131131131131131

    1 33133133134135136137140141

    St orage Administ rat ion Guide

    4

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    18 .3. Unmo unting a File System18 .4. mo unt Co mmand References

    18 .4.1. Manual Pag e Do cumentatio n18 .4.2. Useful Web sites

    Chapt er 1 9 . T he volume_key funct ion19 .1. Co mmand s19 .2. Using vo lume_key as an ind ivid ual user19 .3. Using vo lume_key in a larg er o rg anizatio n

    19 .3.1. Prep aratio n fo r saving encryp tio n keys19 .3.2. Saving encryp tio n keys19 .3.3. Resto ring access to a vo lume19 .3.4. Setting up emerg ency p assp hrases

    19 .4. vo lume_key References

    Chapt er 2 0 . Access Cont rol List s20 .1. Mo unting File Systems

    20 .1.1. NFS20 .2. Setting Access ACLs20 .3. Setting Default ACLs20 .4. Retrieving ACLs20 .5. Archiving File Systems With ACLs20 .6 . Co mp atib il i ty with O ld er Systems20 .7. ACL References

    Chapt er 2 1 . Solid- St at e Disk Deployment Guidelines21.1. Dep lo yment Co nsid eratio ns21.2. Tuning Co nsid eratio ns

    I/O Sched ulerVirtual Memo rySwap

    Chapt er 2 2 . Writ e Barriers22.1. Imp o rtance o f Write Barriers

    Ho w Write Barriers Wo rk22.2. Enab ling /Disab ling Write Barriers22.3. Write Barrier Co nsid eratio ns

    Disab ling Write CachesBattery-Backed Write CachesHig h-End ArraysNFS

    Chapt er 2 3. St orage I/O Alignment and Size23.1. Parameters fo r Sto rag e Access23.2. Usersp ace Access

    sysfs InterfaceBlo ck Device io ctls

    23.3. Stand ard sATASCSI

    23.4. Stacking I/O Parameters23.5. Lo g ical Vo lume Manag er23.6 . Partitio n and File System To o ls

    util-l inux-ng 's l ib b lkid and fd iskp arted and l ib p artedFile System to o ls

    141141142142

    1 4 3143144145145146146147147

    1 4 8148148148149150150151152

    1 53153154154154154

    1 55155155155156156156157157

    1 5815815915915916 016 016 016 016 116 116 116 116 2

    T able of Cont ent s

    5

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    File System to o ls

    Chapt er 2 4 . Set t ing Up A Remot e Diskless Syst em24.1. Co nfig uring a tftp Service fo r Diskless Clients24.2. Co nfig uring DHCP fo r Diskless Clients24.3. Co nfig uring an Exp o rted File System fo r Diskless Clients

    Chapt er 2 5. Device Mapper Mult ipat hing and Virt ual St orage25.1. Virtual Sto rag e25.2. DM-Multip ath

    Part III. Online St orage

    Chapt er 2 6 . Fibre Channel26 .1. Fib re Channel API26 .2. Native Fib re Channel Drivers and Cap ab il ities

    Chapt er 2 7 . Set up an iSCSI T arget and Init iat or27.1. iSCSI Targ et Creatio n27.2. iSCSI Initiato r Creatio n

    Chapt er 2 8 . Persist ent Naming28 .1. WWID28 .2. UUID and Other Pers istent Id entifiers

    Chapt er 2 9 . Removing a St orage Device

    Chapt er 30 . Removing a Pat h t o a St orage Device

    Chapt er 31 . Adding a St orage Device or Pat h

    Chapt er 32 . Configuring a Fibre- Channel Over Et hernet Int erface32.1. Fib re-Channel o ver Ethernet (FCo E) Targ et Set up

    Chapt er 33. Configuring an FCoE Int erface t o Aut omat ically Mount at Boot

    Chapt er 34 . Scanning St orage Int erconnect s

    Chapt er 35. Configuring iSCSI Offload and Int erface Binding35.1. Viewing Availab le iface Co nfig uratio ns35.2. Co nfig uring an iface fo r So ftware iSCSI35.3. Co nfig uring an iface fo r iSCSI O fflo ad35.4. Bind ing /Unb ind ing an iface to a Po rtal

    Chapt er 36 . Scanning iSCSI T arget s wit h Mult iple LUNs or Port als

    Chapt er 37 . Resizing an Online Logical Unit37.1. Resiz ing Fib re Channel Lo g ical Units37.2. Resiz ing an iSCSI Lo g ical Unit37.3. Up d ating the Size o f Yo ur Multip ath Device37.4. Chang ing the Read /Write State o f an Online Lo g ical Unit

    37.4.1. Rescanning lo g ical units37.4.2. Up d ating the R/W state o f a multip ath d evice37.4.3. Do cumentatio n

    Chapt er 38 . Adding/Removing a Logical Unit T hrough rescan- scsi- bus.shKno wn Issues With rescan-scsi-b us.sh

    Chapt er 39 . Modifying Link Loss Behavior

    16 2

    1 6 316 316 316 4

    1 6 616 616 6

    1 6 8

    1 6 916 9170

    1 7 1171173

    1 7 5175176

    1 7 8

    1 8 0

    1 8 1

    1 8 318 4

    1 8 7

    1 8 9

    1 9 019 019 119 219 3

    1 9 5

    1 9 719 719 719 819 920 020 120 1

    2 0 220 2

    2 0 3

    St orage Administ rat ion Guide

    6

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    39 .1. Fib re Channel39 .2. iSCSI Setting s With d m-multip ath

    39 .2.1. NOP-Out Interval/Timeo utSCSI Erro r Hand ler

    39 .2.2. rep lacement_timeo ut39 .3. iSCSI Ro o t

    Co nfig uring Timeo uts fo r a Sp ecific Sessio n

    Chapt er 4 0 . Cont rolling t he SCSI Command T imer and Device St at usDevice StatesCo mmand Timer

    Chapt er 4 1 . Online St orage Configurat ion T roubleshoot ing

    Appendix A. Revision Hist ory

    20 320 320 420 420 420 520 5

    2 0 720 720 7

    2 0 8

    2 0 9

    T able of Cont ent s

    7

  • Preface

    1. Document Convent ionsThis manual uses several conventions to highlight certain words and phrases and draw attention tospecific pieces of information.

    1.1. T ypographic Convent ionsFour typographic conventions are used to call attention to specific words and phrases. Theseconventions, and the circumstances they apply to, are as follows.

    Mono-spaced Bold

    Used to highlight system input, including shell commands, file names and paths. Also used tohighlight keys and key combinations. For example:

    To see the contents of the file my_next_bestselling_novel in your currentworking directory, enter the cat my_next_bestselling_novel command at theshell prompt and press Enter to execute the command.

    The above includes a file name, a shell command and a key, all presented in mono-spaced bold andall distinguishable thanks to context.

    Key combinations can be distinguished from an individual key by the plus sign that connects eachpart of a key combination. For example:

    Press Enter to execute the command.

    Press Ctrl+Alt+F2 to switch to a virtual terminal.

    The first example highlights a particular key to press. The second example highlights a keycombination: a set of three keys pressed simultaneously.

    If source code is discussed, class names, methods, functions, variable names and returned valuesmentioned within a paragraph will be presented as above, in mono-spaced bold . For example:

    File-related classes include filesystem for file systems, file for files, and dir fordirectories. Each class has its own associated set of permissions.

    Proport ional Bold

    This denotes words or phrases encountered on a system, including application names; dialog-boxtext; labeled buttons; check-box and radio-button labels; menu titles and submenu titles. Forexample:

    Choose System Preferences Mouse from the main menu bar to launchMouse Preferences . In the Buttons tab, select the Left-handed mouse checkbox and click Close to switch the primary mouse button from the left to the right(making the mouse suitable for use in the left hand).

    To insert a special character into a gedit file, choose Applicat ions Accessories Character Map from the main menu bar. Next, choose Search Find from the Character Map menu bar, type the name of the character in the Search field and click Next. The character you sought will be highlighted in the

    St orage Administ rat ion Guide

    8

  • Character Table. Double-click this highlighted character to place it in the Text to copy field and then click the Copy button. Now switch back to your documentand choose Edit Paste from the gedit menu bar.

    The above text includes application names; system-wide menu names and items; application-specificmenu names; and buttons and text found within a GUI interface, all presented in proportional boldand all distinguishable by context.

    Mono-spaced Bold Italic or Proportional Bold Italic

    Whether mono-spaced bold or proportional bold, the addition of italics indicates replaceable orvariable text. Italics denotes text you do not input literally or displayed text that changes dependingon circumstance. For example:

    To connect to a remote machine using ssh, type ssh [email protected] at ashell prompt. If the remote machine is example.com and your username on thatmachine is john, type ssh [email protected].

    The mount -o remount file-system command remounts the named file system.For example, to remount the /home file system, the command is mount -o remount /home.

    To see the version of a currently installed package, use the rpm -q packagecommand. It will return a result as follows: package-version-release.

    Note the words in bold italics above: username, domain.name, file-system, package, version andrelease. Each word is a placeholder, either for text you enter when issuing a command or for textdisplayed by the system.

    Aside from standard usage for presenting the title of a work, italics denotes the first use of a new andimportant term. For example:

    Publican is a DocBook publishing system.

    1.2. Pull-quote Convent ionsTerminal output and source code listings are set off visually from the surrounding text.

    Output sent to a terminal is set in mono-spaced roman and presented thus:

    books Desktop documentation drafts mss photos stuff svnbooks_tests Desktop1 downloads images notes scripts svgs

    Source-code listings are also set in mono-spaced roman but add syntax highlighting as follows:

    static int kvm_vm_ioctl_deassign_device(struct kvm *kvm, struct kvm_assigned_pci_dev *assigned_dev){ int r = 0; struct kvm_assigned_dev_kernel *match;

    mutex_lock(&kvm->lock);

    match = kvm_find_assigned_dev(&kvm->arch.assigned_dev_head, assigned_dev->assigned_dev_id); if (!match) { printk(KERN_INFO "%s: device hasn't been assigned

    Preface

    9

  • before, " "so cannot be deassigned\n", __func__); r = -EINVAL; goto out; }

    kvm_deassign_device(kvm, match);

    kvm_free_assigned_device(kvm, match);

    out: mutex_unlock(&kvm->lock); return r;}

    1.3. Notes and WarningsFinally, we use three visual styles to draw attention to information that might otherwise be overlooked.

    NoteNotes are tips, shortcuts or alternative approaches to the task at hand. Ignoring a note shouldhave no negative consequences, but you might miss out on a trick that makes your life easier.

    ImportantImportant boxes detail things that are easily missed: configuration changes that only apply tothe current session, or services that need restarting before an update will apply. Ignoring abox labeled Important will not cause data loss but may cause irritation and frustration.

    WarningWarnings should not be ignored. Ignoring warnings will most likely cause data loss.

    2. Get t ing Help and Giving Feedback

    2.1. Do You Need Help?If you experience difficulty with a procedure described in this documentation, visit the Red HatCustomer Portal at http://access.redhat.com. From the Customer Portal, you can:

    Search or browse through a knowledge base of technical support articles about Red Hatproducts.

    Submit a support case to Red Hat Global Support Services (GSS).

    Access other product documentation.

    St orage Administ rat ion Guide

    10

  • Red Hat also hosts a large number of electronic mailing lists for discussion of Red Hat software andtechnology. You can find a list of publicly available mailing lists athttps://www.redhat.com/mailman/listinfo. Click the name of any mailing list to subscribe to that list orto access the list archives.

    2.2. We Need FeedbackIf you find a typographical error in this manual, or if you have thought of a way to make this manualbetter, we would love to hear from you. Please submit a report in Bugzilla: http://bugzilla.redhat.com/against the product Red Hat Enterprise Linux 6.

    When submitting a bug report, be sure to mention the manual's identifier: doc-Storage_Admin_Guide

    If you have a suggestion for improving the documentation, try to be as specific as possible whendescribing it. If you have found an error, please include the section number and some of thesurrounding text so we can find it easily.

    Preface

    11

  • Chapter 1. OverviewThe Storage Administration Guide contains extensive information on supported file systems and datastorage features in Red Hat Enterprise Linux 6. This book is intended as a quick reference foradministrators managing single-node (that is, non-clustered) storage solutions.

    The Storage Administration Guide is split into two parts: File Systems, and Storage Administration.

    The File Systems part details the various file systems Red Hat Enterprise Linux 6 supports. Itdescribes them and explains how best to utilize them.

    The Storage Administration part details the various tools and storage administration tasks Red HatEnterprise Linux 6 supports. It describes them and explains how best to utilize them.

    1.1. What 's New in Red Hat Enterprise Linux 6Red Hat Enterprise Linux 6 features the following file system enhancements:

    File System Encrypt ion (T echnology Preview)

    It is now possible to encrypt a file system at mount using eCryptfs , providing an encryption layeron top of an actual file system. This "pseudo-file system" allows per-file and file name encryption,which offers more granular encryption than encrypted block devices. For more information about filesystem encryption, refer to Chapter 3, Encrypted File System.

    File System Caching (T echnology Preview)

    FS-Cache[1] allows the use of local storage for caching data from file systems served over the network(for example, through NFS). This helps minimize network traffic, although it does not guarantee fasteraccess to data over the network. FS-Cache allows a file system on a server to interact directly with aclient's local cache without creating an overmounted file system. For more information about FS-Cache, refer to Chapter 10, FS-Cache.

    Btrfs (T echnology Preview)

    Btrfs[1] is a local file system that is now available. It aims to provide better performance andscalability, including integrated LVM operations. For more information on Btrfs, refer to Chapter 4,Btrfs.

    I/O Limit ProcessingThe Linux I/O stack can now process I/O limit information for devices that provide it. This allowsstorage management tools to better optimize I/O for some devices. For more information on this, referto Chapter 23, Storage I/O Alignment and Size.

    ext4 SupportThe ext4 file system is fully supported in this release. It is now the default file system of Red HatEnterprise Linux 6, supporting an unlimited number of subdirectories. It also features more granulartimestamping, extended attributes support, and quota journaling. For more information on ext4, referto Chapter 6, The Ext4 File System.

    Network Block Storage

    [1]

    St orage Administ rat ion Guide

    12

  • Network Block StorageFibre-channel over Ethernet is now supported. This allows a fibre-channel interface to use 10-GigabitEthernet networks while preserving the fibre-channel protocol. For instructions on how to set this up,refer to Chapter 32, Configuring a Fibre-Channel Over Ethernet Interface.

    [1] This feature is b eing p ro vid ed in this release as a technology preview. Techno lo g y Preview featuresare currently no t sup p o rted und er Red Hat Enterp rise Linux sub scrip tio n services, may no t b efunctio nally co mp lete, and are g enerally no t suitab le fo r p ro d uctio n use. Ho wever, these features areinc lud ed as a custo mer co nvenience and to p ro vid e the feature with wid er exp o sure.

    Yo u are free to p ro vid e feed b ack and functio nality sug g estio ns fo r a techno lo g y p review feature b efo reit b eco mes fully sup p o rted . Erratas wil l b e p ro vid ed fo r hig h-severity security issues.

    Chapt er 1 . Overview

    13

  • Part I. File SystemsThe File Systems section explains file system structure followed by two technology previews: eCryptfsand Btrfs. This is followed by the file systems Red Hat fully supports: ext3, ext4, global file system 2,XFS, NFS, and FS-Cache.

    St orage Administ rat ion Guide

    14

  • Chapter 2. File System Structure and MaintenanceThe file system structure is the most basic level of organization in an operating system. The way anoperating system interacts with its users, applications, and security model nearly always depends onhow the operating system organizes files on storage devices. Providing a common file systemstructure ensures users and programs can access and write files.

    File systems break files down into two logical categories:

    Shareable versus unshareable files

    Variable versus static files

    Shareable files can be accessed locally and by remote hosts; unshareable files are only availablelocally. Variable files, such as log files, can be changed at any time; static files, such as binaries, donot change without an action from the system administrator.

    Categorizing files in this manner helps correlate the function of each file with the permissionsassigned to the directories which hold them. How the operating system and its users interact with afile determines the directory in which it is placed, whether that directory is mounted with read-only orread/write permissions, and the level of access each user has to that file. The top level of thisorganization is crucial; access to the underlying directories can be restricted, otherwise securityproblems could arise if, from the top level down, access rules do not adhere to a rigid structure.

    2.1. Overview of Filesystem Hierarchy Standard (FHS)Red Hat Enterprise Linux uses the Filesystem Hierarchy Standard (FHS) file system structure, whichdefines the names, locations, and permissions for many file types and directories.

    The FHS document is the authoritative reference to any FHS-compliant file system, but the standardleaves many areas undefined or extensible. This section is an overview of the standard and adescription of the parts of the file system not covered by the standard.

    The two most important elements of FHS compliance are:

    Compatibility with other FHS-compliant systems

    The ability to mount a /usr/ partition as read-only. This is especially crucial, since /usr/contains common executables and should not be changed by users. In addition, since /usr/ ismounted as read-only, it should be mountable from the CD-ROM drive or from another machinevia a read-only NFS mount.

    2.1.1. FHS Organizat ionThe directories and files noted here are a small subset of those specified by the FHS document. Referto the latest FHS documentation for the most complete information at http://www.pathname.com/fhs/.

    2.1 .1 .1 . Gat hering File Syst em Info rmat io nThe df command reports the system's disk space usage. Its output looks similar to the following:

    Example 2.1. df command output

    Filesystem 1K-blocks Used Available Use% Mounted on/dev/mapper/VolGroup00-LogVol00

    Chapt er 2 . File Syst em St ruct ure and Maint enance

    15

  • 11675568 6272120 4810348 57% / /dev/sda1 100691 9281 86211 10% /bootnone 322856 0 322856 0% /dev/shm

    By default, df shows the partition size in 1 kilobyte blocks and the amount of used and availabledisk space in kilobytes. To view the information in megabytes and gigabytes, use the command df -h. The -h argument stands for "human-readable" format. The output for df -h looks similar to thefollowing:

    Example 2.2. df -h command output

    Filesystem Size Used Avail Use% Mounted on/dev/mapper/VolGroup00-LogVol00 12G 6.0G 4.6G 57% / /dev/sda1 99M 9.1M 85M 10% /boot none 316M 0 316M 0% /dev/shm

    NoteIn the above examples, the mounted partition /dev/shm represents the system's virtualmemory file system.

    The du command displays the estimated amount of space being used by files in a directory,displaying the disk usage of each subdirectory. The last line in the output of du shows the total diskusage of the directory; to see only the total disk usage of a directory in human-readable format, use du -hs. For more options, refer to man du.

    To view the system's partitions and disk space usage in a graphical format, use the Gnome System Monitor by clicking on Applicat ions System Tools System Monitor or using thecommand gnome-system-monitor. Select the File Systems tab to view the system's partitions.The figure below illustrates the File Systems tab.

    St orage Administ rat ion Guide

    16

  • Figure 2.1. GNOME System Monitor File Systems tab

    2.1 .1 .2 . T he /boot/ Direct o ryThe /boot/ directory contains static files required to boot the system, for example, the Linux kernel.These files are essential for the system to boot properly.

    WarningDo not remove the /boot/ directory. Doing so renders the system unbootable.

    2.1 .1 .3. T he /dev/ Direct o ryThe /dev/ directory contains device nodes that represent the following device types:

    devices attached to the system;

    virtual devices provided by the kernel.

    These device nodes are essential for the system to function properly. The udevd daemon createsand removes device nodes in /dev/ as needed.

    Devices in the /dev/ directory and subdirectories are defined as either character (providing only aserial stream of input and output, for example, mouse or keyboard) or block (accessible randomly, forexample, a hard drive or a floppy drive). If GNOME or KDE is installed, some storage devices areautomatically detected when connected (such as with a USB) or inserted (such as a CD or DVD

    Chapt er 2 . File Syst em St ruct ure and Maint enance

    17

  • drive), and a pop-up window displaying the contents appears.

    Table 2.1. Examples of common f iles in the /dev d irectory

    File Descript ion/dev/hda The master device on the primary IDE channel./dev/hdb The slave device on the primary IDE channel./dev/tty0 The first virtual console./dev/tty1 The second virtual console./dev/sda The first device on the primary SCSI or SATA

    channel./dev/lp0 The first parallel port./dev/ttyS0 Serial port.

    2.1 .1 .4 . T he /etc/ Direct o ryThe /etc/ directory is reserved for configuration files that are local to the machine. It should containno binaries; any binaries should be moved to /bin/ or /sbin/.

    For example, the /etc/skel/ directory stores "skeleton" user files, which are used to populate ahome directory when a user is first created. Applications also store their configuration files in thisdirectory and may reference them when executed. The /etc/exports file controls which file systemsexport to remote hosts.

    2.1 .1 .5 . T he /lib/ Direct o ryThe /lib/ directory should only contain libraries needed to execute the binaries in /bin/ and /sbin/. These shared library images are used to boot the system or execute commands within theroot file system.

    2.1 .1 .6 . T he /media/ Direct o ryThe /media/ directory contains subdirectories used as mount points for removable media, such asUSB storage media, DVDs, and CD-ROMs.

    2.1 .1 .7 . T he /mnt/ Direct o ryThe /mnt/ directory is reserved for temporarily mounted file systems, such as NFS file systemmounts. For all removable storage media, use the /media/ directory. Automatically detectedremovable media will be mounted in the /media directory.

    ImportantThe /mnt directory must not be used by installation programs.

    2.1 .1 .8 . T he /opt/ Direct o ryThe /opt/ directory is normally reserved for software and add-on packages that are not part of thedefault installation. A package that installs to /opt/ creates a directory bearing its name, forexample /opt/packagename/. In most cases, such packages follow a predictable subdirectorystructure; most store their binaries in /opt/packagename/bin/ and their man pages in

    St orage Administ rat ion Guide

    18

  • /opt/packagename/man/.

    2.1 .1 .9 . T he /proc/ Direct o ryThe /proc/ directory contains special files that either extract information from the kernel or sendinformation to it. Examples of such information include system memory, CPU information, andhardware configuration. For more information about /proc/, refer to Section 2.3, The /proc VirtualFile System .

    2.1 .1 .10. T he /sbin/ Direct o ryThe /sbin/ directory stores binaries essential for booting, restoring, recovering, or repairing thesystem. The binaries in /sbin/ require root privileges to use. In addition, /sbin/ contains binariesused by the system before the /usr/ directory is mounted; any system utilities used after /usr/ ismounted are typically placed in /usr/sbin/.

    At a minimum, the following programs should be stored in /sbin/:

    arp

    clock

    halt

    init

    fsck.*

    grub

    ifconfig

    mingetty

    mkfs.*

    mkswap

    reboot

    route

    shutdown

    swapoff

    swapon

    2.1 .1 .11. T he /srv/ Direct o ryThe /srv/ directory contains site-specific data served by a Red Hat Enterprise Linux system. Thisdirectory gives users the location of data files for a particular service, such as FTP, WWW, or CVS.Data that only pertains to a specific user should go in the /home/ directory.

    Chapt er 2 . File Syst em St ruct ure and Maint enance

    19

  • NoteThe default httpd install uses /var/www/html for served content.

    2.1 .1 .12. T he /sys/ Direct o ryThe /sys/ directory utilizes the new sysfs virtual file system specific to the 2.6 kernel. With theincreased support for hot plug hardware devices in the 2.6 kernel, the /sys/ directory containsinformation similar to that held by /proc/, but displays a hierarchical view of device informationspecific to hot plug devices.

    2.1 .1 .13. T he /usr/ Direct o ryThe /usr/ directory is for files that can be shared across multiple machines. The /usr/ directory isoften on its own partition and is mounted read-only. The /usr/ directory usually contains thefollowing subdirectories:

    /usr/bin

    This directory is used for binaries.

    /usr/etc

    This directory is used for system-wide configuration files.

    /usr/games

    This directory stores games.

    /usr/include

    This directory is used for C header files.

    /usr/kerberos

    This directory is used for Kerberos-related binaries and files.

    /usr/lib

    This directory is used for object files and libraries that are not designed to be directlyutilized by shell scripts or users. This directory is for 32-bit systems.

    /usr/lib64

    This directory is used for object files and libraries that are not designed to be directlyutilized by shell scripts or users. This directory is for 64-bit systems.

    /usr/libexec

    This directory contains small helper programs called by other programs.

    /usr/sbin

    This directory stores system administration binaries that do not belong to /sbin/.

    /usr/share

    This directory stores files that are not architecture-specific.

    St orage Administ rat ion Guide

    20

  • /usr/src

    This directory stores source code.

    /usr/tmp l inked to /var/tmp

    This directory stores temporary files.

    The /usr/ directory should also contain a /local/ subdirectory. As per the FHS, this subdirectoryis used by the system administrator when installing software locally, and should be safe from beingoverwritten during system updates. The /usr/local directory has a structure similar to /usr/, andcontains the following subdirectories:

    /usr/local/bin

    /usr/local/etc

    /usr/local/games

    /usr/local/include

    /usr/local/lib

    /usr/local/libexec

    /usr/local/sbin

    /usr/local/share

    /usr/local/src

    Red Hat Enterprise Linux's usage of /usr/local/ differs slightly from the FHS. The FHS states that /usr/local/ should be used to store software that should remain safe from system softwareupgrades. Since the RPM Package Manager can perform software upgrades safely, it is notnecessary to protect files by storing them in /usr/local/.

    Instead, Red Hat Enterprise Linux uses /usr/local/ for software local to the machine. Forinstance, if the /usr/ directory is mounted as a read-only NFS share from a remote host, it is stillpossible to install a package or program under the /usr/local/ directory.

    2.1 .1 .14. T he /var/ Direct o rySince the FHS requires Linux to mount /usr/ as read-only, any programs that write log files or need spool/ or lock/ directories should write them to the /var/ directory. The FHS states /var/ is forvariable data, which includes spool directories and files, logging data, transient and temporary files.

    Below are some of the directories found within the /var/ directory depending on what is installed onthe system:

    /var/account/

    /var/arpwatch/

    /var/cache/

    /var/crash/

    /var/db/

    /var/empty/

    Chapt er 2 . File Syst em St ruct ure and Maint enance

    21

  • /var/ftp/

    /var/gdm/

    /var/kerberos/

    /var/lib/

    /var/local/

    /var/lock/

    /var/log/

    /var/mail linked to /var/spool/mail/

    /var/mailman/

    /var/named/

    /var/nis/

    /var/opt/

    /var/preserve/

    /var/run/

    /var/spool/

    /var/tmp/

    /var/tux/

    /var/www/

    /var/yp/

    System log files, such as messages and lastlog , go in the /var/log/ directory. The /var/lib/rpm/ directory contains RPM system databases. Lock files go in the /var/lock/directory, usually in directories for the program using the file. The /var/spool/ directory hassubdirectories that store data files for some programs. These subdirectories may include:

    /var/spool/at/

    /var/spool/clientmqueue/

    /var/spool/cron/

    /var/spool/cups/

    /var/spool/exim/

    /var/spool/lpd/

    /var/spool/mail/

    /var/spool/mailman/

    /var/spool/mqueue/

    /var/spool/news/

    St orage Administ rat ion Guide

    22

  • /var/spool/postfix/

    /var/spool/repackage/

    /var/spool/rwho/

    /var/spool/samba/

    /var/spool/squid/

    /var/spool/squirrelmail/

    /var/spool/up2date/

    /var/spool/uucp/

    /var/spool/uucppublic/

    /var/spool/vbox/

    2.2. Special Red Hat Enterprise Linux File Locat ionsRed Hat Enterprise Linux extends the FHS structure slightly to accommodate special files.

    Most files pertaining to RPM are kept in the /var/lib/rpm/ directory. For more information on RPM,refer to man rpm.

    The /var/cache/yum/ directory contains files used by the Package Updater, including RPMheader information for the system. This location may also be used to temporarily store RPMsdownloaded while updating the system. For more information about the Red Hat Network, refer to thedocumentation online at https://rhn.redhat.com/.

    Another location specific to Red Hat Enterprise Linux is the /etc/sysconfig/ directory. Thisdirectory stores a variety of configuration information. Many scripts that run at boot time use the filesin this directory.

    2.3. The /proc Virtual File SystemUnlike most file systems, /proc contains neither text nor binary files. Instead, it houses virtual files; assuch, /proc is normally referred to as a virtual file system. These virtual files are typically zero bytesin size, even if they contain a large amount of information.

    The /proc file system is not used for storage. Its main purpose is to provide a file-based interface tohardware, memory, running processes, and other system components. Real-time information can beretrieved on many system components by viewing the corresponding /proc file. Some of the fileswithin /proc can also be manipulated (by both users and applications) to configure the kernel.

    The following /proc files are relevant in managing and monitoring system storage:

    /proc/devices

    Displays various character and block devices that are currently configured.

    /proc/f ilesystems

    Lists all file system types currently supported by the kernel.

    /proc/mdstat

    Chapt er 2 . File Syst em St ruct ure and Maint enance

    23

  • Contains current information on multiple-disk or RAID configurations on the system, if theyexist.

    /proc/mounts

    Lists all mounts currently used by the system.

    /proc/part it ions

    Contains partition block allocation information.

    For more information about the /proc file system, refer to the Red Hat Enterprise Linux 6 DeploymentGuide.

    2.4 . Discard unused blocksBatch discard and online discard operations are features of mounted file systems that discard blocksnot in use by the file system. They are useful for both solid-state drives and thinly-provisionedstorage.

    Batch discard operations are run explicitly by the user with the fstrim command. This commanddiscards all unused blocks in a file system that match the user's criteria. Both operation types aresupported for use with ext4 file systems as of Red Hat Enterprise Linux 6.2 and later, so long as theblock device underlying the file system supports physical discard operations. This is also the casewith XFS file systems as of Red Hat Enterprise Linux 6.4 and later. Physical discard operations aresupported if the value of /sys/block/device/queue/discard_max_bytes is not zero.

    Online discard operations are specified at mount time with the -o discard option (either in /etc/fstab or as part of the mount command), and run in realtime without user intervention. Onlinediscard operations only discard blocks that are transitioning from used to free. Online discardoperations are supported on ext4 file systems as of Red Hat Enterprise Linux 6.2 and later, and onXFS file systems as of Red Hat Enterprise Linux 6.4 and later.

    Red Hat recommends batch discard operations unless the system's workload is such that batchdiscard is not feasible, or online discard operations are necessary to maintain performance.

    St orage Administ rat ion Guide

    24

  • Chapter 3. Encrypted File SystemRed Hat Enterprise Linux 6 provides a technology preview of eCryptfs, a "pseudo-file system" whichprovides data and filename encryption on a per-file basis. The term "pseudo-file system" refers to thefact that eCryptfs does not have an on-disk format; rather, it is a file system layer that resides on topof an actual file system. The eCryptfs layer provides encryption capabilities.

    eCryptfs works like a bind mount by intercepting file operations that write to the underlying (that is,encrypted) file system. The eCryptfs layer adds a header to the metadata of files in the underlying filesystem. This metadata describes the encryption for that file, and eCryptfs encrypts file data before it ispassed to the encrypted file system. Optionally, eCryptfs can also encrypt filenames.

    eCryptfs is not an on-disk file system; as such, there is no need to create it via tools such as mkfs.Instead, eCryptfs is initiated by issuing a special mount command. To manage file systems protectedby eCryptfs, the ecryptfs-utils package must be installed first.

    3.1. Mount ing a File System as EncryptedTo encrypt a file system with eCryptfs, execute the following command:

    # mount -t ecryptfs /source /destination

    Encrypting a directory hierarchy (/source in the above example) with eCryptfs means mounting it toa mount point encrypted by eCryptfs (/destination in the example above). All file operations to /destination will be passed encrypted to the underlying /source file system. In some cases,however, it may be possible for a file operation to modify /source directly without passing throughthe eCryptfs layer; this could lead to inconsistencies.

    This is why for most environments, Red Hat recommends that the names of both /source and /destination be identical. For example:

    # mount -t ecryptfs /home /home

    This effectively means encrypting a file system and mounting it on itself. Doing so helps ensure that allfile operations to /home pass through the eCryptfs layer.

    During the mount and encryption process, mount will allow the following settings to be configured:

    Encrypt ion key type

    openssl , tspi , or passphrase. When choosing passphrase, mount will ask for one.

    Cipher

    aes, blowfish, des3_ede, cast6 , or cast5.

    Key bytesiz e

    16 , 32, or 24 .

    plaintext passthrough

    Enabled or disabled.

    filename encryption

    Enabled or disabled.

    Chapt er 3. Encrypt ed File Syst em

    25

  • After the last step of an interactive mount, mount will display all the selections made and perform themount. This output consists of the command-line option equivalents of each chosen setting. Forexample, mounting /home with a key type of passphrase, aes cipher, key bytesize of 16 with both plaintext passthrough and filename encryption disabled, the output would be:

    Attempting to mount with the following options: ecryptfs_unlink_sigs ecryptfs_key_bytes=16 ecryptfs_cipher=aes ecryptfs_sig=c7fed37c0a341e19Mounted eCryptfs

    The options in this display can then be passed directly to the command line to encrypt and mount afile system using the same configuration. To do so, use each option as an argument to the -o optionof mount. For example:

    # mount -t ecryptfs /home /home -o ecryptfs_unlink_sigs \ ecryptfs_key_bytes=16 ecryptfs_cipher=aes ecryptfs_sig=c7fed37c0a341e19

    3.2. Addit ional Informat ionFor more information on eCryptfs and its mount options, refer to man ecryptfs (provided by the ecryptfs-utils package). The following Kernel document (provided by the kernel-docpackage) also provides additional information on eCryptfs:

    /usr/share/doc/kernel-doc-version/Documentation/filesystems/ecryptfs.txt

    [2]

    [2] This is a s ing le co mmand sp lit into multip le l ines, to acco mmo d ate p rinted and PDF vers io ns o f thisd o cument. All co ncatenated l ines p reced ed b y the b ackslash (\) sho uld b e treated as o neco mmand , sans b ackslashes.

    St orage Administ rat ion Guide

    26

  • Chapter 4. BtrfsBtrfs is a new local file system under active development. It aims to provide better performance andscalability which will in turn benefit users.

    NoteBtrfs is not a production quality file system at this point. With Red Hat Enterprise Linux 6 it is ata technology preview stage and as such is only being built for Intel 64 and AMD64.

    4.1. Bt rfs FeaturesSeveral utilities are built in to Btrfs to provide ease of administration for system administrators. Theseinclude:

    Built - in System Rollback

    File system snapshots make it possible to roll a system back to a prior, known-good state ifsomething goes wrong.

    Built - in Compression

    This makes saving space easier.

    Checksum Funct ionality

    This improves error detection.

    Specific features include integrated LVM operations, such as:

    dynamic, online addition or removal of new storage devices

    internal support for RAID across the component devices

    the ability to use different RAID levels for meta or user data

    full checksum functionality for all meta and user data.

    Chapt er 4 . Bt rfs

    27

  • Chapter 5. The Ext3 File SystemThe ext3 file system is essentially an enhanced version of the ext2 file system. These improvementsprovide the following advantages:

    Availab ility

    After an unexpected power failure or system crash (also called an unclean system shutdown),each mounted ext2 file system on the machine must be checked for consistency by the e2fsck program. This is a time-consuming process that can delay system boot timesignificantly, especially with large volumes containing a large number of files. During thistime, any data on the volumes is unreachable.

    It is possible to run fsck -n on a live filesystem. However, it will not make any changesand may give misleading results if partially written metadata is encountered.

    If LVM is used in the stack, another option is to take an LVM snapshot of the filesystem andrun fsck on it instead.

    Finally, there is the option to remount the filesystem as read only. All pending metadataupdates (and writes) are then forced to the disk prior to the remount. This ensures thefilesystem is in a consistent state, provided there is no previous corruption. It is nowpossible to run fsck -n.

    The journaling provided by the ext3 file system means that this sort of file system check isno longer necessary after an unclean system shutdown. The only time a consistency checkoccurs using ext3 is in certain rare hardware failure cases, such as hard drive failures. Thetime to recover an ext3 file system after an unclean system shutdown does not depend onthe size of the file system or the number of files; rather, it depends on the size of the journalused to maintain consistency. The default journal size takes about a second to recover,depending on the speed of the hardware.

    NoteThe only journaling mode in ext3 supported by Red Hat is data=ordered (default).

    Data In tegrity

    The ext3 file system prevents loss of data integrity in the event that an unclean systemshutdown occurs. The ext3 file system allows you to choose the type and level of protectionthat your data receives. With regard to the state of the file system, ext3 volumes areconfigured to keep a high level of data consistency by default.

    Speed

    Despite writing some data more than once, ext3 has a higher throughput in most casesthan ext2 because ext3's journaling optimizes hard drive head motion. You can choosefrom three journaling modes to optimize speed, but doing so means trade-offs in regards todata integrity if the system was to fail.

    Easy Transit ion

    It is easy to migrate from ext2 to ext3 and gain the benefits of a robust journaling file systemwithout reformatting. Refer to Section 5.2, Converting to an Ext3 File System for moreinformation on how to perform this task.

    St orage Administ rat ion Guide

    28

  • The Red Hat Enterprise Linux 6 version of ext3 features the following updates:

    Default Inode Siz es Changed

    The default size of the on-disk inode has increased for more efficient storage of extended attributes,for example, ACLs or SELinux attributes. Along with this change, the default number of inodes createdon a file system of a given size has been decreased. The inode size may be selected with the mke2fs -I option or specified in /etc/mke2fs.conf to set system wide defaults for mke2fs.

    NoteIf you upgrade to Red Hat Enterprise Linux 6 with the intention of keeping any ext3 file systemsintact, there is no need to remake the file system.

    New Mount Opt ion: data_err

    A new mount option has been added: data_err=abort. This option instructs ext3 to abort thejournal if an error occurs in a file data (as opposed to metadata) buffer in data=ordered mode.This option is disabled by default (set as data_err=ignore).

    More Ef f icient Storage Use

    When creating a file system (that is, mkfs), mke2fs will attempt to "discard" or " trim" blocks not usedby the file system metadata. This helps to optimize SSDs or thinly-provisioned storage. To suppressthis behavior, use the mke2fs -K option.

    The following sections cover creating and tuning ext3 partitions. For ext2 partitions, skip thepartitioning and formatting sections below and go directly to Section 5.2, Converting to an Ext3 FileSystem .

    5.1. Creat ing an Ext3 File SystemAfter installation, it is sometimes necessary to create a new ext3 file system. For example, if a new diskdrive is added to the system, you may want to partition the drive and use the ext3 file system.

    The steps for creating an ext3 file system are as follows:

    Procedure 5.1. Create an ext3 f ile system

    1. Format the partition with the ext3 file system using mkfs.

    2. Label the file system using e2label .

    5.2. Convert ing to an Ext3 File SystemThe tune2fs command converts an ext2 file system to ext3.

    Chapt er 5. T he Ext 3 File Syst em

    29

  • NoteA default installation of Red Hat Enterprise Linux uses ext4 for all file systems. However, toconvert ext2 to ext3, always use the e2fsck utility to check your file system before and afterusing tune2fs. Before trying to convert ext2 to ext3, back up all file systems in case anyerrors occur.

    In addition, Red Hat recommends creating a new ext3 file system and migrating data to it,instead of converting from ext2 to ext3 whenever possible.

    To convert an ext2 file system to ext3, log in as root and type the following command in a terminal:

    # tune2fs -j block_device

    block_device contains the ext2 file system to be converted.

    A valid block device can be one of two types of entries:

    A mapped device

    A logical volume in a volume group, for example, /dev/mapper/VolGroup00-LogVol02.

    A stat ic device

    A traditional storage volume, for example, /dev/sdbX, where sdb is a storage device nameand X is the partition number.

    Issue the df command to display mounted file systems.

    5.3. Revert ing to an Ext2 File SystemIn order to revert to an ext2 file system, use the following procedure.

    For simplicity, the sample commands in this section use the following value for the block device:

    /dev/mapper/VolGroup00-LogVol02

    Procedure 5.2. Revert f rom ext3 to ext2

    1. Unmount the partition by logging in as root and typing:

    # umount /dev/mapper/VolGroup00-LogVol02

    2. Change the file system type to ext2 by typing the following command:

    # tune2fs -O ^has_journal /dev/mapper/VolGroup00-LogVol02

    3. Check the partition for errors by typing the following command:

    # e2fsck -y /dev/mapper/VolGroup00-LogVol02

    4. Then mount the partition again as ext2 file system by typing:

    St orage Administ rat ion Guide

    30

  • # mount -t ext2 /dev/mapper/VolGroup00-LogVol02 /mount/point

    In the above command, replace /mount/point with the mount point of the partition.

    NoteIf a .journal file exists at the root level of the partition, delete it.

    To permanently change the partition to ext2, remember to update the /etc/fstab file, otherwise itwill revert back after booting.

    Chapt er 5. T he Ext 3 File Syst em

    31

  • Chapter 6. The Ext4 File SystemThe ext4 file system is a scalable extension of the ext3 file system, which was the default file system ofRed Hat Enterprise Linux 5. Ext4 is the default file system of Red Hat Enterprise Linux 6, and cansupport files and file systems up to 16 terabytes in size. It also supports an unlimited number of sub-directories (the ext3 file system only supports up to 32,000), though once the link count exceeds65,000 it resets to 1 and is no longer increased.

    NoteAs with ext3, an ext4 volume must be umounted in order to perform an fsck. For moreinformation, see Chapter 5, The Ext3 File System.

    Main Features

    Ext4 uses extents (as opposed to the traditional block mapping scheme used by ext2 andext3), which improves performance when using large files and reduces metadata overheadfor large files. In addition, ext4 also labels unallocated block groups and inode tablesections accordingly, which allows them to be skipped during a file system check. Thismakes for quicker file system checks, which becomes more beneficial as the file systemgrows in size.

    Allocat ion Features

    The ext4 file system features the following allocation schemes:

    Persistent pre-allocation

    Delayed allocation

    Multi-block allocation

    Stripe-aware allocation

    Because of delayed allocation and other performance optimizations, ext4's behavior ofwriting files to disk is different from ext3. In ext4, when a program writes to the file system, itis not guaranteed to be on-disk unless the program issues an fsync() call afterwards.

    By default, ext3 automatically forces newly created files to disk almost immediately evenwithout fsync(). This behavior hid bugs in programs that did not use fsync() to ensurethat written data was on-disk. The ext4 file system, on the other hand, often waits severalseconds to write out changes to disk, allowing it to combine and reorder writes for betterdisk performance than ext3.

    WarningUnlike ext3, the ext4 file system does not force data to disk on transaction commit. Assuch, it takes longer for buffered writes to be flushed to disk. As with any file system,use data integrity calls such as fsync() to ensure that data is written to permanentstorage.

    Other Ext4 Features

    The ext4 file system also supports the following:

    St orage Administ rat ion Guide

    32

  • The ext4 file system also supports the following:

    Extended attributes (xattr) This allows the system to associate several additionalname and value pairs per file.

    Quota journaling This avoids the need for lengthy quota consistency checks after acrash.

    NoteThe only supported journaling mode in ext4 is data=ordered (default).

    Subsecond timestamps This gives timestamps to the subsecond.

    6.1. Creat ing an Ext4 File SystemTo create an ext4 file system, use the mkfs.ext4 command. In general, the default options areoptimal for most usage scenarios:

    # mkfs.ext4 /dev/device

    Below is a sample output of this command, which displays the resulting file system geometry andfeatures:

    Example 6 .1. mkfs.ext4 command output

    ~]# mkfs.ext4 /dev/sdb1 mke2fs 1.41.12 (17-May-2010)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks245280 inodes, 979456 blocks48972 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=100663296030 block groups32768 blocks per group, 32768 fragments per group8176 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736

    Writing inode tables: done Creating journal (16384 blocks): doneWriting superblocks and filesystem accounting information: done

    This filesystem will be automatically checked every 20 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.

    Chapt er 6 . T he Ext 4 File Syst em

    33

  • For st