Red Hat Enterprise Linux 6StorageAdministration GuideDeploying and configuring single-nodestorage in Red Hat Enterprise Linux 6Josef BacikKamil DudkaH
PrefacexClose to switch the primary mouse button from the left to the right (making the mousesuitable for use in the left hand).To insert a special ch
Chapter 13. Redundant Array of Independent Disks (RAID)88you have a sufficiently large number of member devices in a software RAID5 array such that th
dmraid89mdraid also supports other metadata formats, known as external metadata. Red Hat Enterprise Linux6 uses mdraid with external metadata to acces
Chapter 13. Redundant Array of Independent Disks (RAID)90As mentioned earlier in Section 13.5, “ Linux RAID Subsystems”, the dmraid tool cannot config
Chapter 14.91Swap Space14.1. What is Swap Space?Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needsmore
Chapter 14. Swap Space9214.2.1. Extending Swap on an LVM2 Logical VolumeBy default, Red Hat Enterprise Linux 6 uses all available space during install
Removing Swap Space931. Determine the size of the new swap file in megabytes and multiply by 1024 to determine thenumber of blocks. For example, the b
Chapter 14. Swap Space9414.3.2. Removing an LVM2 Logical Volume for SwapTo remove a swap volume group (assuming /dev/VolGroup00/LogVol02 is the swap v
Chapter 15.95Disk QuotasDisk space can be restricted by implementing disk quotas which alert a system administrator before auser consumes too much dis
Chapter 15. Disk Quotas96• Issue the umount command followed by the mount command to remount the file system. Referto the man page for both umount and
Assigning Quotas per User9715.1.4. Assigning Quotas per UserThe last step is assigning the disk quotas with the edquota command.To configure the quota
Notes and Warningsxipublic class ExClient{ public static void main(String args[]) throws Exception { InitialContext iniCtx = new Initi
Chapter 15. Disk Quotas98This command displays the existing quota for the group in the text editor:Disk quotas for group devel (gid 505): Filesystem
Reporting on Disk Quotas9915.2.2. Reporting on Disk QuotasCreating a disk usage report entails running the repquota utility. For example, the commandr
Chapter 15. Disk Quotas100quotaon -vaug /file_systemRunning quotacheck on a running systemIf necessary, it is possible to run quotacheck on a machine
Chapter 16.101Access Control ListsFiles and directories have permission sets for the owner of the file, the group associated with the file,and all oth
Chapter 16. Access Control Lists1023. Via the effective rights mask4. For users not in the user group for the fileThe setfacl utility sets ACLs for fi
Archiving File Systems With ACLs103getfacl home/john/picture.pngThe above command returns the following output:# file: home/john/picture.png # owner:
Chapter 16. Access Control Lists104Option Descriptionfiles are newer than the files of the same name in thearchive. This option only works if the arch
Chapter 17.105Write BarriersA write barrier is a kernel mechanism used to ensure that file system metadata is correctly writtenand ordered on persiste
Chapter 17. Write Barriers106cached. However, because the cache's volatility is not visible to the kernel, Red Hat Enterprise Linux 6enables writ
High-End Arrays107MegaCli64 -LDSetProp -DisDskCache -Lall -aALLNoteHardware RAID cards recharge their batteries while the system is operational. If a
Prefacexii2.2. We Need Feedback!If you find a typographical error in this manual, or if you have thought of a way to make this manualbetter, we would
Chapter 18.109Storage I/O Alignment and SizeRecent enhancements to the SCSI and ATA standards allow storage devices to incidate theirpreferred (and in
Chapter 18. Storage I/O Alignment and Size11018.2. Userspace AccessAlways take care to use properly aligned and sized I/O. This is especially importa
ATA111ATAATA devices must report appropriate information via the IDENTIFY DEVICE command. ATAdevices only report I/O parameters for physical_block_siz
Chapter 18. Storage I/O Alignment and Size112For instance, a 512-byte device and a 4K device may be combined into a single logical DM device,which wo
File System tools113This is the catch-all for "legacy" devices which don't appear to provide I/O hints. As such, by defaultall partitio
114
Chapter 19.115Setting Up A Remote Diskless SystemThe Network Booting Service (provided by system-config-netboot) is no longer available in RedHat Ente
Chapter 19. Setting Up A Remote Diskless System116allow booting;allow bootp;class "pxeclients" { match if substring(option vendor-class-id
Configuring an Exported File System for Diskless Clients117exported/root/directory) as read-write. To do this, configure /var/lib/tftpboot/pxelinux.cf
Chapter 1.1OverviewThe Storage Administration Guide contains extensive information on supported file systems anddata storage features in Red Hat Enter
118
Chapter 20.119Solid-State Disk DeploymentGuidelinesSolid-state disks (SSD) are storage devices that use NAND flash chips to persistently store data. T
Chapter 20. Solid-State Disk Deployment Guidelines120In addition, keep in mind that logical volumes, device-mapper targets, and md targets do not sup
Chapter 21.121Online Storage ManagementIt is often desirable to add, remove or re-size storage devices while the operating system is running,and witho
Chapter 21. Online Storage Management122• node_name• port_name•dev_loss_tmo — number of seconds to wait before marking a link as "bad". Onc
iSCSI123lpfc qla2xxx zfcp mptfcHost issue_lip X X1 Supported as of Red Hat Enterprise Linux 5.42 Supported as of Red Hat Enterprise Linux 6.021.2. iSC
Chapter 21. Online Storage Management124• the Logical Unit Number (LUN)This path-based address is not persistent. It may change any time the system i
UUID and Other Persistent Identifiers125If there are multiple paths from a system to a device, device-mapper-multipath uses the WWID todetect this. De
Chapter 21. Online Storage Management126• File system labelThese identifiers are persistent, and based on metadata written on the device by certain a
Removing a Path to a Storage Device127Another variation of this operation is echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete, where h is the
Chapter 21. Online Storage Management12821.6. Adding a Storage Device or PathWhen adding a device, be aware that the path-based device name (/dev/sd
Configuring a Fibre-Channel Over Ethernet Interface129commands, such as lsscsi, scsi_id, multipath -l, and ls -l /dev/disk/by-*. Thisinformation, plu
Chapter 21. Online Storage Management130ifconfig ethX up6. Start FCoE using:/etc/init.d/fcoe startThe FCoE device should appear shortly, assuming all
Scanning Storage Interconnects131 local fcoe_disks=($(egrep 'by-path\/fc-.*_netdev' /etc/fstab | cut -d ' ' -f1)) test -z
Chapter 21. Online Storage Management132interconnect scanning is not recommended if free memory is less than 5% of the total memory inmore than 10 sa
Configuring iSCSI Offload and Interface Binding133iscsiadm -m discovery -t discovery_type -p target_IP:port -o delete3Here, discovery_type can be eit
Chapter 21. Online Storage Management134•Offload iSCSI — like the Chelsio cxgb3i, Broadcom bnx2i and ServerEngines be2iscsimodules, this stack alloca
Configuring an iface for Software iSCSI135Using the previous example, the iface settings of the same Chelsio video card (i.e. iscsiadm -miface -I cxg
Chapter 21. Online Storage Management136iscsiadm -m iface -I iface_name -o update -n iface.ipaddress -v target_IPFor example, to set the iface IP add
Scanning iSCSI Interconnects137However, if the targets do not send an iSCSI async event, you need to manually scan them using theiscsiadm utility. Be
Chapter 2.3Storage Considerations DuringInstallationMany storage device and file system settings can only be configured at install time. Other setting
Chapter 21. Online Storage Management138If your device supports multiple targets, you will need to issue a sendtargets command to the hoststo find ne
Logging In to an iSCSI Target139Using our previous example (where proper_target_name is equallogic-iscsi1), the fullcommand would be:iscsiadm --mode
Chapter 21. Online Storage Management140NoteIn order to resize an online file system, the file system must not reside on a partitioned device.21.14.1
Updating the Size of Your Multipath Device141is running using service multipathd status. Once you've verified that multipathd isoperational, run
Chapter 21. Online Storage Management142For more information about multipathing, refer to the Using Device-Mapper Multipath8 guide (in http://www.red
iSCSI Settings With dm-multipath1432. This command will return Blocked when the remote port (along with devices accessed throughit) are blocked. If th
Chapter 21. Online Storage Management14421.16.2.1. NOP-Out Interval/TimeoutTo help monitor problems the SAN, the iSCSI layer sends a NOP-Out request
iSCSI Root145By configuring a lower replacement_timeout, I/O is quickly sent to a new path and executed (inthe event of a NOP-Out timeout) while the i
Chapter 21. Online Storage Management14621.17. Controlling the SCSI Command Timer and DeviceStatusThe Linux SCSI layer sets a timer on each command.
Troubleshooting147Procedure 21.7. Working Around Stale Logical Units1. Determine which mpath link entries in /etc/lvm/cache/.cache are specific to the
Chapter 2. Storage Considerations During Installation4FileSystemMaxSupportedSizeMax FileSizeMaxSubdirectories(perdirectory)MaxDepth ofSymbolicLinksAC
Chapter 22.149Device Mapper Multipathing and VirtualStorageRed Hat Enterprise Linux 6 also supports DM-Multipath and virtual storage. Both features ar
Chapter 22. Device Mapper Multipathing and Virtual Storage150RedundancyDM-Multipath can provide failover in an active/passive configuration. In an act
151Appendix A. Revision HistoryRevision 1.0 Thu Jul 09 2009 Don Domingo [email protected] build
152
153GlossaryThis glossary defines common terms relating to file systems and storage used throughout the StorageAdministration Guide.Defragmentation The
Glossary154available at mkfs time as well. Doing well-aligned allocation I/O canavoid inefficient read-modify-write cycles on the underlying storage.W
155IndexSymbols'software iSCSIoffload and interface bindingiSCSI, 135/boot/ directory, 31/dev/diskpersistent naming, 124/dev/shm , 30/etc/fstab ,
Index156FS-Cache, 80cache setupFS-Cache, 78cache sharingFS-Cache, 79cachefilesFS-Cache, 78cachefilesdFS-Cache, 78caching, file systemoverview, 1CCW, c
157quotacheck command, using to check, 99reporting, 99soft limit, 97disk storage (see disk quotas)parted (see parted )diskless systemsDHCP, configuri
iSCSI Detection and Configuration5WarningRemoving/deleting RAID metadata from disk could potentially destroy any stored data. Red Hatrecommends that y
Index158fibre channelonline storage, 121fibre channel API, 121fibre channel drivers (native), 122fibre channel over ethernetFCoE, 129fibre-channel ove
159solid state disks, 120iface (configuring for iSCSI offload)offload and interface bindingiSCSI, 135iface binding/unbindingoffload and interface bind
Index160LUKS/dm-crypt, encrypting block devices usingstorage considerations during installation, 4LUN (logical unit number)adding/removing, 142known i
161overriding/augmenting site configuration files(autofs), 62proper nsswitch configuration (autofs version5), use of, 61reloading, 67required services
Index162proc directory, 33processing, I/O limitoverview, 1project limits (setting)XFS, 52proper nsswitch configuration (autofs version 5),use ofNFS, 6
163rpcinfo, 74status, 67rpcinfo, 74running sessions, retrieving information aboutiSCSI API, 123running statusLinux SCSI layer, 146Ssbin directory, 33s
Index164LVM2creating, 92extending, 92reducing, 93removing, 94moving, 94recommended size, 91removing, 93symbolic links in /dev/diskpersistent naming, 1
165storage considerations during installation, 3World Wide Identifier (WWID)persistent naming, 124write barriersbattery-backed write caches, 106defini
Chapter 3.7LVM (Logical Volume Manager)LVM is a tool for logical volume management which includes allocating disks, striping, mirroring andresizing lo
Storage Administration GuideNathan StrazDavid WysochanskiMichael ChristieSachin PrabhuRob EversDavid HowellsDavid LehmanJeff MoyerEric SandeenMike Sni
Chapter 3. LVM (Logical Volume Manager)8Figure 3.2. Logical VolumesOn the other hand, if a system is partitioned with the ext3 file system, the hard d
Using system-config-lvm9LogVol03 - (LVM) swap (28 extents).The logical volumes above were created in disk entity /dev/hda2 while /boot was created in
Chapter 3. LVM (Logical Volume Manager)10Figure 3.5. Logical View WindowOn the left side column, you can select the individual logical volumes in the
Utilizing Uninitialized Entities113.2.1. Utilizing Uninitialized Entities'Uninitialized Entities' consist of unpartitioned space and non LVM
Chapter 3. LVM (Logical Volume Manager)12Figure 3.8. Unallocated VolumesClicking on the Add to Existing Volume Group button will display a pop up wind
Migrating Extents13The figure below illustrates the logical view of 'VolGroup00' after adding the new volume group.Figure 3.10. Logical view
Chapter 3. LVM (Logical Volume Manager)14the volume group, a pop up window will be displayed from which you can select the destination forthe extents
Adding a New Hard Disk Using LVM15which were initially in hda2 are now in hda3. Migrating extents allows you to move logical volumes incase of hard di
Chapter 3. LVM (Logical Volume Manager)163.2.5. Adding a New Volume GroupOnce initialized, LVM will add the new volume to the list of unallocated volu
Extending a Volume Group17Figure 3.17. Create new logical volumeThe figure below illustrates the physical view of the new volume group. The new logica
Red Hat Enterprise Linux 6 Storage Administration GuideDeploying and configuring single-node storage in Red HatEnterprise Linux 6Edition 0Author Josef
Chapter 3. LVM (Logical Volume Manager)18volume group, click on the Extend Volume Group button. This will display the 'Extend Volume Group'w
Editing a Logical Volume19Clicking on the Edit Properties button will display the 'Edit Logical Volume' popup window from whichyou can edit
Chapter 3. LVM (Logical Volume Manager)20Figure 3.22. Edit logical volume - specifying mount optionsThe figure below illustrates the logical and physi
References21Figure 3.23. Edit logical volume3.3. ReferencesUse these sources to learn more about LVM.Installed Documentation• rpm -qd lvm2 — This comm
Chapter 4.23PartitionsThe utility parted allows users to:• View the existing partition table• Change the size of existing partitions• Add partitions f
Chapter 4. Partitions24Command Descriptionprint Display the partition tablequit Quit partedrescue start-mb end-mb Rescue a lost partition from start-m
Creating a Partition25• ntfs• reiserfs• hp-ufs• sun-ufs• xfsIf a Filesystem of a device shows no value, this means that its file system type is unknow
Chapter 4. Partitions26TipIf you use the mkpartfs command instead, the file system is created after the partition iscreated. However, parted does not
Removing a Partition27mount /work4.3. Removing a PartitionWarningDo not attempt to remove a partition on a device that is in use.Before removing a par
Storage Administration Guide This guide provides instructions on how to effectively manage storage devices and file systems onRed Hat Enterprise Linu
Chapter 4. Partitions28printTo resize the partition, use the resize command followed by the minor number for the partition, thestarting place in megab
Chapter 5.29File System Structure5.1. Why Share a Common Structure?The file system structure is the most basic level of organization in an operating s
Chapter 5. File System Structure30Filesystem 1K-blocks Used Available Use% Mounted on/dev/mapper/VolGroup00-LogVol00
FHS Organization31Figure 5.1. GNOME System Monitor File Systems tab5.2.1.2. The /boot/ DirectoryThe /boot/ directory contains static files required to
Chapter 5. File System Structure32Table 5.1. Examples of common files in the /devFile Description/dev/hda The master device on primary IDE channel./de
FHS Organization335.2.1.9. The /proc/ DirectoryThe /proc/ directory contains special files that either extract information from the kernel or sendinfo
Chapter 5. File System Structure345.2.1.13. The /usr/ DirectoryThe /usr/ directory is for files that can be shared across multiple machines. The /usr/
FHS Organization355.2.1.14. The /var/ DirectorySince the FHS requires Linux to mount /usr/ as read-only, any programs that write log files or needspoo
Chapter 5. File System Structure36in directories for the program using the file. The /var/spool/ directory has subdirectories that storedata files for
The /proc Virtual File System375.4. The /proc Virtual File SystemUnlike most file systems, /proc contains neither text not binary files. Instead, it h
vPreface ix1.
Chapter 6.39The Ext3 File SystemThe ext3 file system is essentially an enhanced version of the ext2 file system. These improvementsprovide the followi
Chapter 6. The Ext3 File System40NoteIf you upgrade to Red Hat Enterprise Linux 6 with the intention of keeping any ext3 file systemsintact, you do no
Reverting to an Ext2 File System41• A mapped device — A logical volume in a volume group, for example, /dev/mapper/VolGroup00-LogVol02.• A static devi
42
Chapter 7.43The Ext4 File SystemThe ext4 file system is a scalable extension of the ext3 file system, which was the default file systemof Red Hat Ente
Chapter 7. The Ext4 File System44• Subsecond timestamps7.1. Creating an Ext4 File SystemTo create an ext4 file system, use the mkfs.ext4 command. In
Mounting an Ext4 File System45NoteIt is possible to use tune2fs to enable some ext4 features on ext3 file systems, and to usethe ext4 driver to mount
Chapter 7. The Ext4 File System46• G — gigabytesFor more information about resizing an ext4 file system, refer to man resize2fs.7.4. Other Ext4 File
Chapter 8.47Global File System 2The Red Hat GFS2 file system is a native file system that interfaces directly with the Linux kernel filesystem interfa
Storage Administration Guidevi9. The XFS File System
Chapter 9.49The XFS File SystemXFS is a highly scalable, high-performance file system which was originally designed at SiliconGraphics, Inc. It was cr
Chapter 9. The XFS File System50log =internal log bsize=4096 blocks=6400, version=2 = sectsz=512 sun
XFS Quota Management51mount -o nobarrier /dev/device /mount/pointFor more information about write barriers, refer to Chapter 17, Write Barriers.9.3. X
Chapter 9. The XFS File System52---------- --------------------------------- root 0 0 0 00 [------]testuser 103.4G 0
Repairing an XFS File System53NoteWhile XFS file systems can be grown while mounted, their size cannot be reduced at all.For more information about g
Chapter 9. The XFS File System54NoteYou can also use the xfs_freeze utility to freeze/unfreeze an ext3, ext4, GFS2, XFS, andBTRFS, file system. The s
xfsrestore Simple Mode55 resumed: NO subtree: NO streams: 1 stream 0: pathname: /mnt/test2/backup start: ino 0 offset 0 end: ino 1 offset
Chapter 9. The XFS File System56xfs_fsrUsed to defragment mounted XFS file systems. When invoked with no arguments, xfs_fsrdefragments all regular fi
Chapter 10.57Network File System (NFS)A Network File System (NFS) allows remote hosts to mount file systems over a network and interactwith those file
vii13.6. RAID Support in the Installer ... 8913.7. Configuring RAID
Chapter 10. Network File System (NFS)58ImportantIn order for NFS to work with a default installation of Red Hat Enterprise Linux with a firewallenabl
NFS Client Configuration59rpc.nfsdrpc.nfsd allows explicit NFS versions and protocols the server advertises to be defined. It workswith the Linux kern
Chapter 10. Network File System (NFS)60If an NFS share was mounted manually, the share will not be automatically mounted upon reboot. RedHat Enterpri
Improvements in autofs Version 5 over Version 461autofs uses /etc/auto.master (master map) as its default primary configuration file. This canbe chang
Chapter 10. Network File System (NFS)62An example is seen in the connectathon test maps for the direct mounts below:/- /tmp/auto_dcthon/- /tmp/auto_t
Overriding or Augmenting Site Configuration Files63locationThis refers to the file system location such as a local file system path (preceded with the
Chapter 10. Network File System (NFS)64* fileserver.example.com:/export/home/&• The file map /etc/auto.home does not exist.Given these cond
Using LDAP to Store Automounter Maps65# LDAPv3# base <> with scope subtree# filter: (&(objectclass=automountMap)(automountMapName=auto.maste
Chapter 10. Network File System (NFS)6610.4. Common NFS Mount OptionsBeyond mounting a file system via NFS on a remote host, you can also specify oth
Starting and Stopping NFS67sec=krb5i uses Kerberos V5 for user authentication and performs integrity checking of NFSoperations using secure checksums
Storage Administration Guideviii20. Solid-State Disk Deployment Guidelines
Chapter 10. Network File System (NFS)68service nfs restartThe condrestart (conditional restart) option only starts nfs if it is currently running. Th
The /etc/exports Configuration File69export host1(options1) host2(options2) host3(options3)For information on different methods for specifying hostna
Chapter 10. Network File System (NFS)70In this example 192.168.0.3 can mount /another/exported/directory/ read/write and allwrites to disk are asynch
Running NFS Behind a Firewall71same way they are specified in /etc/exports. Refer to Section 10.6.1, “ The /etc/exportsConfiguration File” for more in
Chapter 10. Network File System (NFS)72To configure a firewall to allow NFS, perform the following steps:1. Allow TCP and UDP port 2049 for NFS.2. Al
Host Access in NFSv473pointed to an unauthorized machine. At this point, the unauthorized machine is the system permittedto mount the NFS share, since
Chapter 10. Network File System (NFS)74When exporting an NFS share as read-only, consider using the all_squash option. This optionmakes every user ac
Using NFS over TCP75100005 2 tcp 839 mountd100005 3 udp 836 mountd100005 3 tcp 839 mountdIf one of the NFS services does no
Chapter 10. Network File System (NFS)76becomes available. since UDP is connectionless, the client continues to pound the network withdata until the s
Chapter 11.77FS-CacheFS-Cache is a persistent local cache that can be used by file systems to take data retrieved from overthe network and cache it on
ixPreface1. Document ConventionsThis manual uses several conventions to highlight certain words and phrases and draw attention tospecific pieces of in
Chapter 11. FS-Cache78FS-Cache cannot arbitrarily cache any file system, whether through the network or otherwise: theshared file system's driver
Using the Cache With NFS79tune2fs -o user_xattr /dev/deviceAlternatively, extended attributes for a file system can be enabled at mount time, as in:mo
Chapter 11. FS-Cache80Here, /home/fred and /home/jim will likely share the superblock as they have the same options,especially if they come from the s
Statistical Information81When dealing with file system size, the CacheFiles culling behavior is controlled by three settings in /etc/cachefilesd.conf:
Chapter 11. FS-Cache82FS-Cache statistics includes information on decision points and object counters. For more details onthe statistics provided by F
Chapter 12.83Encrypted File SystemRed Hat Enterprise Linux 6 now supports eCryptfs, a "pseudo-file system" which provides data andfilename e
Chapter 12. Encrypted File System84 ecryptfs_unlink_sigs ecryptfs_key_bytes=16 ecryptfs_cipher=aes ecryptfs_sig=c7fed37c0a341e19Mounted eCryptfsT
Chapter 13.85Redundant Array of Independent Disks(RAID)The basic idea behind RAID is to combine multiple small, inexpensive disk drives into an array
Chapter 13. Redundant Array of Independent Disks (RAID)86RAID controller cards function like a SCSI controller to the operating system, and handle all
RAID Levels and Linear Support87member disks of the array, allowing high I/O performance at low inherent cost but provides noredundancy.Many RAID leve
Comentários a estes Manuais