Red Hat Enterprise Linux 9 Managing storage devices
Red Hat Enterprise Linux 9 Managing storage devices
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons
Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is
available at
http://creativecommons.org/licenses/by-sa/3.0/
. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must
provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert,
Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift,
Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States
and other countries.
Linux ® is the registered trademark of Linus Torvalds in the United States and other countries.
XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States
and/or other countries.
MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and
other countries.
Node.js ® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the
official Joyent Node.js open source or commercial project.
The OpenStack ® Word Mark and OpenStack logo are either registered trademarks/service marks
or trademarks/service marks of the OpenStack Foundation, in the United States and other
countries 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.
Abstract
Red Hat Enterprise Linux (RHEL) provides several local and remote storage options. With the
available storage options, you can perform the following tasks: Create disk partitions according to
your requirements. Use disk encryption to protect the data on a block device. Create a Redundant
Array of Independent Disks (RAID) to store data across multiple drives and avoid data loss. Use
iSCSI and NVMe over Fabrics to access storage over a network. Set up Stratis to manage pools of
physical storage devices.
Table of Contents
Table of Contents
. . . . . . . . . .OPEN
MAKING . . . . . . SOURCE
. . . . . . . . . .MORE
. . . . . . .INCLUSIVE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. . . . . . . . . . . . .
. . . . . . . . . . . . . FEEDBACK
PROVIDING . . . . . . . . . . . . ON
. . . .RED
. . . . .HAT
. . . . .DOCUMENTATION
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8. . . . . . . . . . . . .
.CHAPTER
. . . . . . . . . . 1.. .OVERVIEW
. . . . . . . . . . . .OF
. . . AVAILABLE
. . . . . . . . . . . . .STORAGE
. . . . . . . . . . .OPTIONS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9. . . . . . . . . . . . .
1.1. LOCAL STORAGE OVERVIEW 9
1.2. REMOTE STORAGE OVERVIEW 11
1.3. GFS2 FILE SYSTEM OVERVIEW 11
.CHAPTER
. . . . . . . . . . 2.
. . PERSISTENT
. . . . . . . . . . . . . . NAMING
. . . . . . . . . .ATTRIBUTES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
..............
2.1. PERSISTENT ATTRIBUTES FOR IDENTIFYING FILE SYSTEMS AND BLOCK DEVICES 13
2.2. UDEV DEVICE NAMING RULES 14
. . . . . . . . . . . 3.
CHAPTER . . MANAGING
. . . . . . . . . . . . . LOCAL
. . . . . . . .STORAGE
. . . . . . . . . . .USING
. . . . . . . RHEL
. . . . . . SYSTEM
. . . . . . . . . .ROLES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
..............
3.1. INTRODUCTION TO THE STORAGE RHEL SYSTEM ROLE 16
3.2. PARAMETERS THAT IDENTIFY A STORAGE DEVICE IN THE STORAGE RHEL SYSTEM ROLE 16
3.3. EXAMPLE ANSIBLE PLAYBOOK TO CREATE AN XFS FILE SYSTEM ON A BLOCK DEVICE 17
3.4. EXAMPLE ANSIBLE PLAYBOOK TO PERSISTENTLY MOUNT A FILE SYSTEM 18
3.5. EXAMPLE ANSIBLE PLAYBOOK TO MANAGE LOGICAL VOLUMES 18
3.6. EXAMPLE ANSIBLE PLAYBOOK TO ENABLE ONLINE BLOCK DISCARD 19
3.7. EXAMPLE ANSIBLE PLAYBOOK TO CREATE AND MOUNT AN EXT4 FILE SYSTEM 20
3.8. EXAMPLE ANSIBLE PLAYBOOK TO CREATE AND MOUNT AN EXT3 FILE SYSTEM 20
3.9. EXAMPLE ANSIBLE PLAYBOOK TO RESIZE AN EXISTING FILE SYSTEM ON LVM USING THE STORAGE
RHEL SYSTEM ROLE 21
3.10. EXAMPLE ANSIBLE PLAYBOOK TO CREATE A SWAP VOLUME USING THE STORAGE
RHEL SYSTEM ROLE 22
3.11. CONFIGURING A RAID VOLUME USING THE STORAGE SYSTEM ROLE 23
3.12. CONFIGURING AN LVM POOL WITH RAID USING THE STORAGE RHEL SYSTEM ROLE 24
3.13. CONFIGURING A STRIPE SIZE FOR RAID LVM VOLUMES USING THE STORAGE RHEL SYSTEM ROLE
25
3.14. EXAMPLE ANSIBLE PLAYBOOK TO COMPRESS AND DEDUPLICATE A VDO VOLUME ON LVM USING
THE STORAGE RHEL SYSTEM ROLE 26
3.15. CREATING A LUKS2 ENCRYPTED VOLUME USING THE STORAGE RHEL SYSTEM ROLE 27
3.16. EXAMPLE ANSIBLE PLAYBOOK TO EXPRESS POOL VOLUME SIZES AS PERCENTAGE USING THE
STORAGE RHEL SYSTEM ROLE 29
3.17. ADDITIONAL RESOURCES 30
.CHAPTER
. . . . . . . . . . 4.
. . .DISK
. . . . .PARTITIONS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
..............
4.1. OVERVIEW OF PARTITIONS 31
4.2. CONSIDERATIONS BEFORE MODIFYING PARTITIONS ON A DISK 31
4.3. COMPARISON OF PARTITION TABLE TYPES 32
4.4. MBR DISK PARTITIONS 32
4.5. EXTENDED MBR PARTITIONS 34
4.6. MBR PARTITION TYPES 34
4.7. GUID PARTITION TABLE 36
4.8. PARTITION TYPES 37
4.9. PARTITION NAMING SCHEME 38
4.10. MOUNT POINTS AND DISK PARTITIONS 39
.CHAPTER
. . . . . . . . . . 5.
. . GETTING
. . . . . . . . . . .STARTED
. . . . . . . . . . WITH
. . . . . . PARTITIONS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
..............
5.1. CREATING A PARTITION TABLE ON A DISK WITH PARTED 40
5.2. VIEWING THE PARTITION TABLE WITH PARTED 41
5.3. CREATING A PARTITION WITH PARTED 42
1
Red Hat Enterprise Linux 9 Managing storage devices
.CHAPTER
. . . . . . . . . . 6.
. . .STRATEGIES
. . . . . . . . . . . . . FOR
. . . . . REPARTITIONING
. . . . . . . . . . . . . . . . . . .A
. . DISK
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48
..............
6.1. USING UNPARTITIONED FREE SPACE 48
6.2. USING SPACE FROM AN UNUSED PARTITION 48
6.3. USING FREE SPACE FROM AN ACTIVE PARTITION 49
6.3.1. Destructive repartitioning 49
6.3.2. Non-destructive repartitioning 50
. . . . . . . . . . . 7.
CHAPTER . . CONFIGURING
. . . . . . . . . . . . . . . . AN
. . . .ISCSI
. . . . . .TARGET
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53
..............
7.1. INSTALLING TARGETCLI 53
7.2. CREATING AN ISCSI TARGET 54
7.3. ISCSI BACKSTORE 55
7.4. CREATING A FILEIO STORAGE OBJECT 55
7.5. CREATING A BLOCK STORAGE OBJECT 56
7.6. CREATING A PSCSI STORAGE OBJECT 57
7.7. CREATING A MEMORY COPY RAM DISK STORAGE OBJECT 57
7.8. CREATING AN ISCSI PORTAL 58
7.9. CREATING AN ISCSI LUN 59
7.10. CREATING A READ-ONLY ISCSI LUN 60
7.11. CREATING AN ISCSI ACL 61
7.12. SETTING UP THE CHALLENGE-HANDSHAKE AUTHENTICATION PROTOCOL FOR THE TARGET 63
7.13. REMOVING AN ISCSI OBJECT USING TARGETCLI TOOL 63
. . . . . . . . . . . 8.
CHAPTER . . .CONFIGURING
. . . . . . . . . . . . . . . AN
. . . .ISCSI
. . . . . .INITIATOR
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
..............
8.1. CREATING AN ISCSI INITIATOR 65
8.2. SETTING UP THE CHALLENGE-HANDSHAKE AUTHENTICATION PROTOCOL FOR THE INITIATOR 66
8.3. MONITORING AN ISCSI SESSION USING THE ISCSIADM UTILITY 67
8.4. DM MULTIPATH OVERRIDES OF THE DEVICE TIMEOUT 68
.CHAPTER
. . . . . . . . . . 9.
. . .USING
. . . . . . .FIBRE
. . . . . . .CHANNEL
. . . . . . . . . . .DEVICES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
..............
9.1. RESIZING FIBRE CHANNEL LOGICAL UNITS 69
9.2. DETERMINING THE LINK LOSS BEHAVIOR OF DEVICE USING FIBRE CHANNEL 69
9.3. FIBRE CHANNEL CONFIGURATION FILES 70
9.4. DM MULTIPATH OVERRIDES OF THE DEVICE TIMEOUT 71
. . . . . . . . . . . 10.
CHAPTER . . . MANAGING
. . . . . . . . . . . . .SYSTEM
. . . . . . . . . UPGRADES
. . . . . . . . . . . . .WITH
. . . . . .SNAPSHOTS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72
..............
10.1. OVERVIEW OF THE BOOM PROCESS 72
10.2. UPGRADING TO ANOTHER VERSION USING BOOM BOOT MANAGER 72
10.3. SWITCHING BETWEEN RED HAT ENTERPRISE LINUX VERSIONS 75
10.4. DELETING THE LOGICAL VOLUME SNAPSHOT 75
10.5. CREATING A ROLLBACK BOOT ENTRY 76
. . . . . . . . . . . 11.
CHAPTER . . .CONFIGURING
. . . . . . . . . . . . . . . .NVME
. . . . . . OVER
. . . . . . .FABRICS
. . . . . . . . . .USING
. . . . . . .NVME/RDMA
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79
..............
11.1. OVERVIEW OF NVME OVER FABRIC DEVICES 79
11.2. SETTING UP AN NVME/RDMA CONTROLLER USING CONFIGFS 79
11.3. SETTING UP THE NVME/RDMA CONTROLLER USING NVMETCLI 81
11.4. CONFIGURING AN NVME/RDMA HOST 82
11.5. NEXT STEPS 83
. . . . . . . . . . . 12.
CHAPTER . . . CONFIGURING
. . . . . . . . . . . . . . . .NVME
. . . . . . .OVER
. . . . . . FABRICS
. . . . . . . . . . USING
. . . . . . . NVME/FC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
..............
12.1. OVERVIEW OF NVME OVER FABRIC DEVICES 84
12.2. CONFIGURING THE NVME HOST FOR BROADCOM ADAPTERS 84
2
Table of Contents
. . . . . . . . . . . 13.
CHAPTER . . . CONFIGURING
. . . . . . . . . . . . . . . . NVME
. . . . . . .OVER
. . . . . . .FABRICS
. . . . . . . . . USING
. . . . . . . .NVME/TCP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
..............
13.1. OVERVIEW OF NVME OVER FABRIC DEVICES 89
13.2. CONFIGURING AN NVME/TCP HOST 89
13.3. CONNECTING THE NVME/TCP HOST TO THE NVME/TCP CONTROLLER 91
. . . . . . . . . . . 14.
CHAPTER . . . ENABLING
. . . . . . . . . . . .MULTIPATHING
. . . . . . . . . . . . . . . . .ON
. . . .NVME
. . . . . . .DEVICES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93
..............
14.1. NATIVE NVME MULTIPATHING AND DM MULTIPATH 93
14.2. ENABLING DM MULTIPATH ON NVME DEVICES 93
14.3. ENABLING NATIVE NVME MULTIPATHING 95
.CHAPTER
. . . . . . . . . . 15.
. . . SETTING
. . . . . . . . . .UP
. . . .A. REMOTE
. . . . . . . . . . DISKLESS
. . . . . . . . . . .SYSTEM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98
..............
15.1. PREPARING ENVIRONMENTS FOR THE REMOTE DISKLESS SYSTEM 98
15.2. CONFIGURING A TFTP SERVICE FOR DISKLESS CLIENTS 99
15.3. CONFIGURING A DHCP SERVER FOR DISKLESS CLIENTS 100
15.4. CONFIGURING AN EXPORTED FILE SYSTEM FOR DISKLESS CLIENTS 101
15.5. RE-CONFIGURING A REMOTE DISKLESS SYSTEM 103
15.6. TROUBLESHOOTING COMMON ISSUES WITH LOADING A REMOTE DISKLESS SYSTEM 104
.CHAPTER
. . . . . . . . . . 16.
. . . GETTING
. . . . . . . . . . STARTED
. . . . . . . . . . .WITH
. . . . . .SWAP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
...............
16.1. OVERVIEW OF SWAP SPACE 106
16.2. RECOMMENDED SYSTEM SWAP SPACE 106
16.3. CREATING AN LVM2 LOGICAL VOLUME FOR SWAP 107
16.4. CREATING A SWAP FILE 108
16.5. EXTENDING SWAP ON AN LVM2 LOGICAL VOLUME 109
16.6. REDUCING SWAP ON AN LVM2 LOGICAL VOLUME 110
16.7. REMOVING AN LVM2 LOGICAL VOLUME FOR SWAP 111
16.8. REMOVING A SWAP FILE 111
. . . . . . . . . . . 17.
CHAPTER . . . CONFIGURING
. . . . . . . . . . . . . . . . FIBRE
. . . . . . .CHANNEL
. . . . . . . . . . .OVER
. . . . . . ETHERNET
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113
..............
17.1. USING HARDWARE FCOE HBAS IN RHEL 113
17.2. SETTING UP A SOFTWARE FCOE DEVICE 113
.CHAPTER
. . . . . . . . . . 18.
. . . MANAGING
. . . . . . . . . . . . .TAPE
. . . . . .DEVICES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
..............
18.1. TYPES OF TAPE DEVICES 116
18.2. INSTALLING TAPE DRIVE MANAGEMENT TOOL 116
18.3. WRITING TO REWINDING TAPE DEVICES 116
18.4. WRITING TO NON-REWINDING TAPE DEVICES 118
18.5. SWITCHING TAPE HEAD IN TAPE DEVICES 119
18.6. RESTORING DATA FROM TAPE DEVICES 120
18.7. ERASING DATA FROM TAPE DEVICES 120
18.8. TAPE COMMANDS 121
. . . . . . . . . . . 19.
CHAPTER . . . MANAGING
. . . . . . . . . . . . .RAID
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
...............
19.1. OVERVIEW OF RAID 122
19.2. RAID TYPES 122
19.3. RAID LEVELS AND LINEAR SUPPORT 124
19.4. LINUX RAID SUBSYSTEMS 125
19.5. CREATING A SOFTWARE RAID DURING THE INSTALLATION 126
19.6. CREATING A SOFTWARE RAID ON AN INSTALLED SYSTEM 126
19.7. CONFIGURING A RAID VOLUME USING THE STORAGE SYSTEM ROLE 128
19.8. EXTENDING RAID 129
19.9. SHRINKING RAID 130
3
Red Hat Enterprise Linux 9 Managing storage devices
. . . . . . . . . . . 20.
CHAPTER . . . .ENCRYPTING
. . . . . . . . . . . . . . BLOCK
. . . . . . . . DEVICES
. . . . . . . . . . USING
. . . . . . . .LUKS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
...............
20.1. LUKS DISK ENCRYPTION 137
20.2. LUKS VERSIONS IN RHEL 138
20.3. OPTIONS FOR DATA PROTECTION DURING LUKS2 RE-ENCRYPTION 139
20.4. ENCRYPTING EXISTING DATA ON A BLOCK DEVICE USING LUKS2 139
20.5. ENCRYPTING EXISTING DATA ON A BLOCK DEVICE USING LUKS2 WITH A DETACHED HEADER 142
20.6. ENCRYPTING A BLANK BLOCK DEVICE USING LUKS2 144
20.7. CREATING A LUKS2 ENCRYPTED VOLUME USING THE STORAGE RHEL SYSTEM ROLE 145
. . . . . . . . . . . 21.
CHAPTER . . . USING
. . . . . . . NVDIMM
. . . . . . . . . .PERSISTENT
. . . . . . . . . . . . . .MEMORY
. . . . . . . . . .STORAGE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149
...............
21.1. THE NVDIMM PERSISTENT MEMORY TECHNOLOGY 149
21.2. NVDIMM INTERLEAVING AND REGIONS 149
21.3. NVDIMM NAMESPACES 150
21.4. NVDIMM ACCESS MODES 150
21.5. INSTALLING NDCTL 151
21.6. CREATING A SECTOR NAMESPACE ON AN NVDIMM TO ACT AS A BLOCK DEVICE 151
21.6.1. Reconfiguring an existing NVDIMM namespace to sector mode 152
21.6.2. Creating a new NVDIMM namespace in sector mode 153
21.7. CREATING A DEVICE DAX NAMESPACE ON AN NVDIMM 155
21.7.1. NVDIMM in device direct access mode 155
21.7.2. Reconfiguring an existing NVDIMM namespace to device DAX mode 156
21.7.3. Creating a new NVDIMM namespace in device DAX mode 157
21.8. CREATING A FILE SYSTEM DAX NAMESPACE ON AN NVDIMM 160
21.8.1. NVDIMM in file system direct access mode 160
21.8.2. Reconfiguring an existing NVDIMM namespace to file system DAX mode 161
21.8.3. Creating a new NVDIMM namespace in file system DAX mode 163
21.8.4. Creating a file system on a file system DAX device 165
21.9. MONITORING NVDIMM HEALTH USING S.M.A.R.T. 166
21.10. DETECTING AND REPLACING A BROKEN NVDIMM DEVICE 167
. . . . . . . . . . . 22.
CHAPTER . . . .DISCARDING
. . . . . . . . . . . . . .UNUSED
. . . . . . . . . BLOCKS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .170
...............
Requirements 170
22.1. TYPES OF BLOCK DISCARD OPERATIONS 170
Recommendations 170
22.2. PERFORMING BATCH BLOCK DISCARD 170
22.3. ENABLING ONLINE BLOCK DISCARD 171
22.4. ENABLING PERIODIC BLOCK DISCARD 171
. . . . . . . . . . . 23.
CHAPTER . . . .REMOVING
. . . . . . . . . . . .STORAGE
. . . . . . . . . . .DEVICES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
...............
23.1. SAFE REMOVAL OF STORAGE DEVICES 173
23.2. REMOVING BLOCK DEVICES AND ASSOCIATED METADATA 173
. . . . . . . . . . . 24.
CHAPTER . . . .SETTING
. . . . . . . . . .UP
. . . STRATIS
. . . . . . . . . .FILE
. . . . .SYSTEMS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
...............
24.1. WHAT IS STRATIS 177
24.2. COMPONENTS OF A STRATIS VOLUME 177
24.3. BLOCK DEVICES USABLE WITH STRATIS 178
4
Table of Contents
.CHAPTER
. . . . . . . . . . 25.
. . . .EXTENDING
. . . . . . . . . . . . .A. .STRATIS
. . . . . . . . . VOLUME
. . . . . . . . . . WITH
. . . . . . ADDITIONAL
. . . . . . . . . . . . . .BLOCK
. . . . . . . .DEVICES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .189
...............
25.1. COMPONENTS OF A STRATIS VOLUME 189
25.2. ADDING BLOCK DEVICES TO A STRATIS POOL 189
25.3. ADDITIONAL RESOURCES 190
. . . . . . . . . . . 26.
CHAPTER . . . .MONITORING
. . . . . . . . . . . . . . .STRATIS
. . . . . . . . .FILE
. . . . .SYSTEMS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191
..............
26.1. STRATIS SIZES REPORTED BY DIFFERENT UTILITIES 191
26.2. DISPLAYING INFORMATION ABOUT STRATIS VOLUMES 191
26.3. ADDITIONAL RESOURCES 192
.CHAPTER
. . . . . . . . . . 27.
. . . .USING
. . . . . . .SNAPSHOTS
. . . . . . . . . . . . . .ON
. . . .STRATIS
. . . . . . . . .FILE
. . . . . SYSTEMS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193
...............
27.1. CHARACTERISTICS OF STRATIS SNAPSHOTS 193
27.2. CREATING A STRATIS SNAPSHOT 193
27.3. ACCESSING THE CONTENT OF A STRATIS SNAPSHOT 193
27.4. REVERTING A STRATIS FILE SYSTEM TO A PREVIOUS SNAPSHOT 194
27.5. REMOVING A STRATIS SNAPSHOT 195
27.6. ADDITIONAL RESOURCES 195
. . . . . . . . . . . 28.
CHAPTER . . . .REMOVING
. . . . . . . . . . . .STRATIS
. . . . . . . . . FILE
. . . . . .SYSTEMS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .196
...............
28.1. COMPONENTS OF A STRATIS VOLUME 196
28.2. REMOVING A STRATIS FILE SYSTEM 196
28.3. REMOVING A STRATIS POOL 197
28.4. ADDITIONAL RESOURCES 198
5
Red Hat Enterprise Linux 9 Managing storage devices
6
MAKING OPEN SOURCE MORE INCLUSIVE
7
Red Hat Enterprise Linux 9 Managing storage devices
4. Enter your suggestion for improvement in the Description field. Include links to the relevant
parts of the documentation.
8
CHAPTER 1. OVERVIEW OF AVAILABLE STORAGE OPTIONS
Local storage implies that the storage devices are either installed on the system or directly attached to
the system.
With remote storage, devices are accessed over LAN, the internet, or using a Fibre channel network.
The following high level Red Hat Enterprise Linux storage diagram describes the different storage
options.
Figure 1.1. High level Red Hat Enterprise Linux storage diagram
9
Red Hat Enterprise Linux 9 Managing storage devices
To encrypt the partition, you can use Linux Unified Key Setup-on-disk-format (LUKS). To encrypt
the partition, select the option during the installation and the prompt displays to enter the
passphrase. This passphrase unlocks the encryption key.
Logical volumes
Logical Volume Manager (LVM)
It creates logical devices from physical devices. Logical volume (LV) is a combination of the
physical volumes (PV) and volume groups (VG). Configuring LVM include:
Stratis is a hybrid user-and-kernel local storage management system that supports advanced
10
CHAPTER 1. OVERVIEW OF AVAILABLE STORAGE OPTIONS
Stratis is a hybrid user-and-kernel local storage management system that supports advanced
storage features.
lpfc
qla2xxx
Zfcp
NFS
SMB
In a few cases, the Linux file system API does not allow the clustered nature of GFS2 to be totally
transparent; for example, programs using POSIX locks in GFS2 should avoid using the GETLK function
since, in a clustered environment, the process ID may be for a different node in the cluster. In most cases
however, the functionality of a GFS2 file system is identical to that of a local file system.
11
Red Hat Enterprise Linux 9 Managing storage devices
The Red Hat Enterprise Linux Resilient Storage Add-On provides GFS2, and it depends on the Red Hat
Enterprise Linux High Availability Add-On to provide the cluster management required by GFS2.
The gfs2.ko kernel module implements the GFS2 file system and is loaded on GFS2 cluster nodes.
To get the best performance from GFS2, it is important to take into account the performance
considerations which stem from the underlying design. Just like a local file system, GFS2 relies on the
page cache in order to improve performance by local caching of frequently used data. In order to
maintain coherency across the nodes in the cluster, cache control is provided by the glock state
machine.
Additional resources
12
CHAPTER 2. PERSISTENT NAMING ATTRIBUTES
PNAs are used to identify both file systems and block devices, but they serve different purposes:
Label
Labels are user-assigned names for file systems. While they can be used to identify and
reference file systems, they are not as standardized as UUIDs. Labels are often used as
alternatives to UUIDs to specify file systems in configuration files.
When you assign a label to a file system, it becomes part of the file system metadata. This
label persists with the file system even if you mount the file system on different mount
points or different systems.
13
Red Hat Enterprise Linux 9 Managing storage devices
when a file system is created on it, a UUID is often assigned to the device itself. This UUID is
embedded within the file system metadata or partition table and is used as a reference for
persistent device naming. It allows you to uniquely identify the block device, even if you
change the file system or reformat it.
Serial number
The serial number is a unique identifier assigned to each storage block device by the
manufacturer. It can be used to differentiate between storage devices and may be used in
combination with other attributes like UUIDs or WWIDs for device management.
udev rules are written in a human-readable format using key-value pairs. When a device is detected or
initialized, udev evaluates these rules sequentially, based on the order they are defined. The first
matching rule is applied to the device, determining its name and how it will be identified within the
system.
In the case of storage devices, udev rules create symbolic links in the /dev/disk/ directory. These
symbolic links provide user-friendly aliases for storage devices, making it more convenient to refer to
and manage these devices.
You can create custom udev rules to specify how devices should be named based on various attributes
such as serial numbers, WWN (World Wide Name) identifiers, or other device-specific characteristics. By
defining specific naming rules, you have precise control over how devices are identified within the
system.
/lib/udev/rules.d/ directory contains default rules that come with the udev package.
While udev rules are very flexible, it is important to be aware of udev limitations:
Accessibility Timing: Some storage devices might not be accessible at the time of a udev query.
Event-Based Processing: The kernel can send udev events at any time, potentially triggering
rule processing and link removal if a device is inaccessible.
Processing Delay: There might be a delay between event generation and processing, especially
with numerous devices, causing a lag between kernel detection and link availability.
Device Accessibility: External programs invoked by udev rules, like blkid, might briefly open the
14
CHAPTER 2. PERSISTENT NAMING ATTRIBUTES
Device Accessibility: External programs invoked by udev rules, like blkid, might briefly open the
device, making it temporarily inaccessible for other tasks.
Link Updates: Device names managed by udev in /dev/disk/ can change between major
releases, requiring link updates.
Additional resources
15
Red Hat Enterprise Linux 9 Managing storage devices
Using the storage role enables you to automate administration of file systems on disks and logical
volumes on multiple machines and across all versions of RHEL starting with RHEL 7.7.
For more information about RHEL System Roles and how to apply them, see Introduction to
RHEL System Roles.
Complete LVM volume groups including their logical volumes and file systems
With the storage role, you can perform the following tasks:
16
CHAPTER 3. MANAGING LOCAL STORAGE USING RHEL SYSTEM ROLES
Your storage role configuration affects only the file systems, volumes, and pools that you list in the
following variables.
storage_volumes
List of file systems on all unpartitioned disks to be managed.
storage_volumes can also include raid volumes.
storage_pools
List of pools to be managed.
Currently the only supported pool type is LVM. With LVM, pools represent volume groups (VGs).
Under each pool there is a list of volumes to be managed by the role. With LVM, each volume
corresponds to a logical volume (LV) with a file system.
WARNING
The storage role can create a file system only on an unpartitioned, whole disk or a
logical volume (LV). It cannot create the file system on a partition.
---
- hosts: all
vars:
storage_volumes:
- name: barefs
type: disk
disks:
- sdb
fs_type: xfs
roles:
- rhel-system-roles.storage
The volume name (barefs in the example) is currently arbitrary. The storage role identifies
the volume by the disk device listed under the disks: attribute.
You can omit the fs_type: xfs line because XFS is the default file system in RHEL 9.
To create the file system on an LV, provide the LVM setup under the disks: attribute,
17
Red Hat Enterprise Linux 9 Managing storage devices
To create the file system on an LV, provide the LVM setup under the disks: attribute,
including the enclosing volume group. For details, see Example Ansible playbook to manage
logical volumes.
Do not provide the path to the LV device.
Additional resources
---
- hosts: all
vars:
storage_volumes:
- name: barefs
type: disk
disks:
- sdb
fs_type: xfs
mount_point: /mnt/data
mount_user: somebody
mount_group: somegroup
mount_mode: 0755
roles:
- rhel-system-roles.storage
This playbook adds the file system to the /etc/fstab file, and mounts the file system
immediately.
If the file system on the /dev/sdb device or the mount point directory do not exist, the
playbook creates them.
Additional resources
Example 3.3. A playbook that creates a mylv logical volume in the myvg volume group
- hosts: all
vars:
18
CHAPTER 3. MANAGING LOCAL STORAGE USING RHEL SYSTEM ROLES
storage_pools:
- name: myvg
disks:
- sda
- sdb
- sdc
volumes:
- name: mylv
size: 2G
fs_type: ext4
mount_point: /mnt/data
roles:
- rhel-system-roles.storage
/dev/sda
/dev/sdb
/dev/sdc
If the myvg volume group already exists, the playbook adds the logical volume to the volume
group.
If the myvg volume group does not exist, the playbook creates it.
The playbook creates an Ext4 file system on the mylv logical volume, and persistently
mounts the file system at /mnt.
Additional resources
---
- hosts: all
vars:
storage_volumes:
- name: barefs
type: disk
disks:
- sdb
fs_type: xfs
mount_point: /mnt/data
19
Red Hat Enterprise Linux 9 Managing storage devices
mount_options: discard
roles:
- rhel-system-roles.storage
Additional resources
Example 3.5. A playbook that creates Ext4 on /dev/sdb and mounts it at /mnt/data
---
- hosts: all
vars:
storage_volumes:
- name: barefs
type: disk
disks:
- sdb
fs_type: ext4
fs_label: label-name
mount_point: /mnt/data
roles:
- rhel-system-roles.storage
The playbook persistently mounts the file system at the /mnt/data directory.
Additional resources
Example 3.6. A playbook that creates Ext3 on /dev/sdb and mounts it at/mnt/data
---
- hosts: all
20
CHAPTER 3. MANAGING LOCAL STORAGE USING RHEL SYSTEM ROLES
vars:
storage_volumes:
- name: barefs
type: disk
disks:
- sdb
fs_type: ext3
fs_label: label-name
mount_point: /mnt/data
mount_user: somebody
mount_group: somegroup
mount_mode: 0755
roles:
- rhel-system-roles.storage
The playbook persistently mounts the file system at the /mnt/data directory.
Additional resources
WARNING
Using the Resizing action in other file systems can destroy the data on the device
you are working on.
Example 3.7. A playbook that resizes existing mylv1 and myvl2 logical volumes in the myvg
volume group
---
- hosts: all
vars:
storage_pools:
- name: myvg
disks:
- /dev/sda
- /dev/sdb
21
Red Hat Enterprise Linux 9 Managing storage devices
- /dev/sdc
volumes:
- name: mylv1
size: 10 GiB
fs_type: ext4
mount_point: /opt/mount1
- name: mylv2
size: 50 GiB
fs_type: ext4
mount_point: /opt/mount2
The Ext4 file system on the mylv1 volume, which is mounted at /opt/mount1, resizes to
10 GiB.
The Ext4 file system on the mylv2 volume, which is mounted at /opt/mount2, resizes to
50 GiB.
Additional resources
---
- name: Create a disk device with swap
- hosts: all
vars:
storage_volumes:
- name: swap_fs
type: disk
disks:
- /dev/sdb
size: 15 GiB
fs_type: swap
roles:
- rhel-system-roles.storage
The volume name (swap_fs in the example) is currently arbitrary. The storage role identifies
the volume by the disk device listed under the disks: attribute.
22
CHAPTER 3. MANAGING LOCAL STORAGE USING RHEL SYSTEM ROLES
Additional resources
Prerequisites
You have the rhel-system-roles package installed on the system from which you want to run
the playbook.
You have an inventory file detailing the systems on which you want to deploy a RAID volume
using the storage System Role.
Procedure
---
- name: Configure the storage
hosts: managed-node-01.example.com
tasks:
- name: Create a RAID on sdd, sde, sdf, and sdg
include_role:
name: rhel-system-roles.storage
vars:
storage_safe_mode: false
storage_volumes:
- name: data
type: raid
disks: [sdd, sde, sdf, sdg]
raid_level: raid0
raid_chunk_size: 32 KiB
mount_point: /mnt/data
state: present
WARNING
23
Red Hat Enterprise Linux 9 Managing storage devices
Additional resources
Preparing a control node and managed nodes to use RHEL System Roles
Prerequisites
You have the rhel-system-roles package installed on the system from which you want to run
the playbook.
You have an inventory file detailing the systems on which you want to configure an LVM pool
with RAID using the storage System Role.
Procedure
- hosts: all
vars:
storage_safe_mode: false
storage_pools:
- name: my_pool
type: lvm
disks: [sdh, sdi]
raid_level: raid1
volumes:
- name: my_volume
size: "1 GiB"
mount_point: "/mnt/app/shared"
fs_type: xfs
state: present
roles:
- name: rhel-system-roles.storage
NOTE
24
CHAPTER 3. MANAGING LOCAL STORAGE USING RHEL SYSTEM ROLES
NOTE
To create an LVM pool with RAID, you must specify the RAID type using the
raid_level parameter.
Additional resources
Prerequisites
You have the rhel-system-roles package installed on the system from which you want to run the
playbook.
You have an inventory file detailing the systems on which you want to configure an LVM pool
with RAID using the storage System Role.
Procedure
hosts: all
vars:
storage_safe_mode: false
storage_pools:
- name: my_pool
type: lvm
disks: [sdh, sdi]
volumes:
- name: my_volume
size: "1 GiB"
mount_point: "/mnt/app/shared"
fs_type: xfs
raid_level: raid1
raid_stripe_size: "256 KiB"
25
Red Hat Enterprise Linux 9 Managing storage devices
state: present
roles:
- name: rhel-system-roles.storage
Additional resources
Managing RAID
Example 3.9. A playbook that creates a mylv1 LVM VDO volume in themyvg volume group
---
- name: Create LVM VDO volume under volume group 'myvg'
hosts: all
roles:
-rhel-system-roles.storage
vars:
storage_pools:
- name: myvg
disks:
- /dev/sdb
volumes:
- name: mylv1
compression: true
deduplication: true
vdo_pool_size: 10 GiB
size: 30 GiB
mount_point: /mnt/app/shared
In this example, the compression and deduplication pools are set to true, which specifies that the VDO
is used. The following describes the usage of these parameters:
The deduplication is used to deduplicate the duplicated data stored on the storage volume.
The compression is used to compress the data stored on the storage volume, which results in
more storage capacity.
26
CHAPTER 3. MANAGING LOCAL STORAGE USING RHEL SYSTEM ROLES
The vdo_pool_size specifies the actual size the volume takes on the device. The virtual size of
VDO volume is set by the size parameter. NOTE: Because of the Storage role use of LVM VDO,
only one volume per pool can use the compression and deduplication.
Prerequisites
Access and permissions to one or more managed nodes, which are systems you want to
configure with the crypto_policies System Role.
Access and permissions to a control node, which is a system from which Red Hat Ansible Core
configures other systems. On the control node, the ansible-core and rhel-system-roles
packages are installed.
IMPORTANT
RHEL 8.0-8.5 provided access to a separate Ansible repository that contains Ansible
Engine 2.9 for automation based on Ansible. Ansible Engine contains command-line
utilities such as ansible, ansible-playbook, connectors such as docker and podman, and
many plugins and modules. For information about how to obtain and install Ansible
Engine, see the How to download and install Red Hat Ansible Engine Knowledgebase
article.
RHEL 8.6 and 9.0 have introduced Ansible Core (provided as the ansible-core package),
which contains the Ansible command-line utilities, commands, and a small set of built-in
Ansible plugins. RHEL provides this package through the AppStream repository, and it
has a limited scope of support. For more information, see the Scope of support for the
Ansible Core package included in the RHEL 9 and RHEL 8.6 and later AppStream
repositories Knowledgebase article.
Procedure
- hosts: all
vars:
storage_volumes:
- name: barefs
type: disk
disks:
- sdb
fs_type: xfs
fs_label: label-name
mount_point: /mnt/data
encryption: true
27
Red Hat Enterprise Linux 9 Managing storage devices
encryption_password: your-password
roles:
- rhel-system-roles.storage
You can also add the other encryption parameters such as encryption_key, encryption_cipher,
encryption_key_size, and encryption_luks version in the playbook.yml file.
Verification
Version: 2
Epoch: 6
Metadata area: 16384 [bytes]
Keyslots area: 33521664 [bytes]
UUID: a4c6be82-7347-4a91-a8ad-9479b72c9426
Label: (no label)
Subsystem: (no subsystem)
Flags: allow-discards
Data segments:
0: crypt
offset: 33554432 [bytes]
length: (whole device)
cipher: aes-xts-plain64
sector: 4096 [bytes]
[...]
3. View the cryptsetup parameters in the playbook.yml file, which the storage role supports:
# cat ~/playbook.yml
28
CHAPTER 3. MANAGING LOCAL STORAGE USING RHEL SYSTEM ROLES
- hosts: all
vars:
storage_volumes:
- name: foo
type: disk
disks:
- nvme0n1
fs_type: xfs
fs_label: label-name
mount_point: /mnt/data
encryption: true
#encryption_password: passwdpasswd
encryption_key: /home/passwd_key
encryption_cipher: aes-xts-plain64
encryption_key_size: 512
encryption_luks_version: luks2
roles:
- rhel-system-roles.storage
Additional resources
/usr/share/ansible/roles/rhel-system-roles.storage/README.md file
Example 3.10. A playbook that express volume sizes as a percentage of the pool’s total size
---
- name: Express volume sizes as a percentage of the pool's total size
hosts: all
roles
- rhel-system-roles.storage
vars:
storage_pools:
- name: myvg
disks:
- /dev/sdb
volumes:
- name: data
size: 60%
mount_point: /opt/mount/data
- name: web
size: 30%
mount_point: /opt/mount/web
- name: cache
size: 10%
mount_point: /opt/cache/mount
29
Red Hat Enterprise Linux 9 Managing storage devices
This example specifies the size of LVM volumes as a percentage of the pool size, for example: "60%".
Additionally, you can also specify the size of LVM volumes as a percentage of the pool size in a human-
readable size of the file system, for example, "10g" or "50 GiB".
/usr/share/ansible/roles/rhel-system-roles.storage/
30
CHAPTER 4. DISK PARTITIONS
Additional resources
What are the advantages and disadvantages to using partitioning on LUNs, either directly or
with LVM in between?.
On a device, the type of the partition table determines the maximum number and size of individual
partitions.
On a device formatted with the Master Boot Record (MBR) partition table, you can have:
On a device formatted with the GUID Partition Table (GPT), you can have:
Though the GPT specification allows more partitions by increasing the reserved size of
the partition table, the parted utility limits the area required for 128 partitions.
On a device formatted with the Master Boot Record (MBR) partition table:
31
Red Hat Enterprise Linux 9 Managing storage devices
By using the parted utility, you can specify the partition size using multiple different suffixes:
The starting point of the partition is aligned to the exact sector specified by size.
The starting and ending points are aligned within one half of the specified unit. For example,
±500KB when using the MB suffix.
NOTE
This section does not cover the DASD partition table, which is specific to the IBM Z
architecture.
Additional resources
As the previous diagram shows, the partition table is divided into four sections of four unused primary
partitions. A primary partition is a partition on a hard disk drive that contains only one logical drive (or
section). Each logical drive holds the information necessary to define a single partition, meaning that
the partition table can define no more than four primary partitions.
The points on the disk where the partition starts and ends
The state of the partition, as only one partition can be flagged as active
The starting and ending points define the size and location of the partition on the disk. Some of the
operating systems boot loaders use the active flag. That means that the operating system in the
partition that is marked "active" is booted.
The type is a number that identifies the anticipated usage of a partition. Some operating systems use
the partition type to:
The following diagram shows an example of a drive with a single partition. In this example, the first
partition is labeled as DOS partition type:
Additional resources
An extended partition is similar to a disk drive. It has its own partition table, which points to one or more
logical partitions, contained entirely within the extended partition. The following diagram shows a disk
drive with two primary partitions, and one extended partition containing two logical partitions, along with
some unpartitioned free space.
Figure 4.3. Disk with both two primary and an extended MBR partitions
You can have only up to four primary and extended partitions, but there is no fixed limit to the number
of logical partitions. As a limit in Linux to access partitions, a single disk drive allows maximum 15 logical
partitions.
The table below shows a list of some of the most commonly used MBR partition types and hexadecimal
34
CHAPTER 4. DISK PARTITIONS
The table below shows a list of some of the most commonly used MBR partition types and hexadecimal
numbers to represent them.
35
Red Hat Enterprise Linux 9 Managing storage devices
GPT deals with the limitations of the Mater Boot Record (MBR) partition table. The MBR partition table
cannot address storage larger than 2 TiB, equal to approximately 2.2 TB. Instead, GPT supports hard
disks with larger capacity. The maximum addressable disk size is 8 ZiB, when using 512b sector drives,
and 64 ZiB, when using 4096b sector drives. In addition, by default, GPT supports creation of up to 128
primary partitions. Extend the maximum amount of primary partitions by allocating more space to the
partition table.
NOTE
A GPT has partition types based on GUIDs. Certain partitions require a specific GUID. For
example, the system partition for Extensible Firmware Interface (EFI) boot loaders
require GUID C12A7328-F81F-11D2-BA4B-00A0C93EC93B.
GPT disks use logical block addressing (LBA) and a partition layout as follows:
For backward compatibility with MBR disks, the system reserves the first sector (LBA 0) of GPT
for MBR data, and applies the name "protective MBR".
Primary GPT
The header begins on the second logical block (LBA 1) of the device. The header contains
the disk GUID, the location of the primary partition table, the location of the secondary GPT
header, and CRC32 checksums of itself, and the primary partition table. It also specifies the
number of partition entries on the table.
By default, the primary GPT includes 128 partition entries. Each partition has an entry size of
128 bytes, a partition type GUID and a unique partition GUID.
Secondary GPT
For recovery, it is useful as a backup table in case the primary partition table is corrupted.
The last logical sector of the disk contains the secondary GPT header and recovers GPT
information, in case the primary header is corrupted.
It contains:
The location of the secondary partition table and the primary GPT header
IMPORTANT
For a successful installation of the boot loader onto a GPT disk a BIOS boot partition
must be present. Reuse is possible only if the disk already contains a BIOS boot partition.
This includes disks initialized by the Anaconda installation program.
The fdisk utility supports the full range of partition types by specifying hexadecimal codes.
The parted utility maps out the partition type with flags. The parted utility handles only certain
partition types, for example LVM, swap or RAID.
The parted utility supports setting the following flags:
boot
root
swap
hidden
raid
lvm
lba
legacy_boot
irst
esp
palo
37
Red Hat Enterprise Linux 9 Managing storage devices
On Red Hat Enterprise Linux 9 with parted 3.5, you can use the additional flags chromeos_kernel and
bls_boot.
The parted utility optionally accepts a file system type argument while creating a partition. See
Creating a partition with parted
Set the partition UUID type on GPT. For example, the swap, fat, or hfs file system types set
different GUIDs. The default value is the Linux Data GUID.
The argument does not modify the file system on the partition. It only differentiates between the
supported flags and GUIDs.
xfs
ext2
ext3
ext4
fat16
fat32
hfs
hfs+
linux-swap
ntfs
reiserfs
/dev/
Name of the directory that contains all device files. Hard disks contain partitions, thus the files
representing all possible partitions are located in /dev.
xx
The first two letters of the partition name indicate the type of device that contains the partition.
y
This letter indicates the specific device containing the partition. For example, /dev/sda for the first
hard disk and /dev/sdb for the second. You can use more letters in systems with more than 26 drives,
for example, /dev/sdaa1.
38
CHAPTER 4. DISK PARTITIONS
N
The final letter indicates the number to represent the partition. The first four (primary or extended)
partitions are numbered 1 through 4. Logical partitions start at 5. For example, /dev/sda3 is the third
primary or extended partition on the first hard disk, and /dev/sdb6 is the second logical partition on
the second hard disk. Drive partition numbering applies only to MBR partition tables. Note that N
does not always mean partition.
NOTE
Even if Red Hat Enterprise Linux can identify and refer to all types of disk partitions, it
might not be able to read the file system and therefore access stored data on every
partition type. However, in many cases, it is possible to successfully access data on a
partition dedicated to another operating system.
For example, if partition /dev/sda5 is mounted on /usr/, it means that all files and directories under /usr/
physically reside on /dev/sda5. The file /usr/share/doc/FAQ/txt/Linux-FAQ resides on /dev/sda5, while
the file /etc/gdm/custom.conf does not.
Continuing the example, it is also possible that one or more directories below /usr/ would be mount
points for other partitions. For example, /usr/local/man/whatis resides on /dev/sda7, rather than on
/dev/sda5, if /usr/local includes a mounted /dev/sda7 partition.
39
Red Hat Enterprise Linux 9 Managing storage devices
For an overview of the advantages and disadvantages to using partitions on block devices, see What are
the advantages and disadvantages to using partitioning on LUNs, either directly or with LVM in
between?.
WARNING
Formatting a block device with a partition table deletes all data stored on the
device.
Procedure
# parted block-device
# (parted) print
If the device already contains partitions, they will be deleted in the following steps.
40
CHAPTER 5. GETTING STARTED WITH PARTITIONS
# (parted) print
# (parted) quit
Additional resources
Procedure
1. Start the parted utility. For example, the following output lists the device /dev/sda:
# parted /dev/sda
# (parted) print
For a detailed description of the print command output, see the following:
41
Red Hat Enterprise Linux 9 Managing storage devices
Additional resources
NOTE
Prerequisites
If the partition you want to create is larger than 2TiB, format the disk with the GUID Partition
Table (GPT).
Procedure
# parted block-device
2. View the current partition table to determine if there is enough free space:
# (parted) print
42
CHAPTER 5. GETTING STARTED WITH PARTITIONS
Replace part-type with with primary, logical, or extended. This applies only to the MBR
partition table.
Replace name with an arbitrary partition name. This is required for GPT partition tables.
Replace fs-type with xfs, ext2, ext3, ext4, fat16, fat32, hfs, hfs+, linux-swap, ntfs, or
reiserfs. The fs-type parameter is optional. Note that the parted utility does not create the
file system on the partition.
Replace start and end with the sizes that determine the starting and ending points of the
partition, counting from the beginning of the disk. You can use size suffixes, such as 512MiB,
20GiB, or 1.5TiB. The default size is in megabytes.
To create a primary partition from 1024MiB until 2048MiB on an MBR table, use:
4. View the partition table to confirm that the created partition is in the partition table with the
correct partition type, file system type, and size:
# (parted) print
# (parted) quit
# udevadm settle
# cat /proc/partitions
Additional resources
43
Red Hat Enterprise Linux 9 Managing storage devices
You can set a partition type or flag, using the fdisk utility.
Prerequisites
Procedure
# fdisk block-device
2. View the current partition table to determine the minor partition number:
You can see the current partition type in the Type column and its corresponding type ID in the
Id column.
3. Enter the partition type command and select a partition using its minor number:
Prerequisites
If the partition you want to create is larger than 2TiB, format the disk with the GUID Partition
44
CHAPTER 5. GETTING STARTED WITH PARTITIONS
If the partition you want to create is larger than 2TiB, format the disk with the GUID Partition
Table (GPT).
If you want to shrink the partition, first shrink the file system so that it is not larger than the
resized partition.
NOTE
Procedure
# parted block-device
# (parted) print
The location of the existing partition and its new ending point after resizing.
Replace 1 with the minor number of the partition that you are resizing.
Replace 2 with the size that determines the new ending point of the resized partition,
counting from the beginning of the disk. You can use size suffixes, such as 512MiB, 20GiB,
or 1.5TiB. The default size is in megabytes.
4. View the partition table to confirm that the resized partition is in the partition table with the
correct size:
# (parted) print
# (parted) quit
# cat /proc/partitions
7. Optional: If you extended the partition, extend the file system on it as well.
Additional resources
45
Red Hat Enterprise Linux 9 Managing storage devices
WARNING
Procedure
# parted block-device
Replace block-device with the path to the device where you want to remove a partition: for
example, /dev/sda.
2. View the current partition table to determine the minor number of the partition to remove:
(parted) print
(parted) rm minor-number
Replace minor-number with the minor number of the partition you want to remove.
4. Verify that you have removed the partition from the partition table:
(parted) print
(parted) quit
# cat /proc/partitions
7. Remove the partition from the /etc/fstab file, if it is present. Find the line that declares the
removed partition, and remove it from the file.
46
CHAPTER 5. GETTING STARTED WITH PARTITIONS
8. Regenerate mount units so that your system registers the new /etc/fstab configuration:
# systemctl daemon-reload
9. If you have deleted a swap partition or removed pieces of LVM, remove all references to the
partition from the kernel command line:
a. List active kernel options and see if any option references the removed partition:
# grubby --info=ALL
10. To register the changes in the early boot system, rebuild the initramfs file system:
Additional resources
47
Red Hat Enterprise Linux 9 Managing storage devices
NOTE
The following examples are simplified for clarity and do not reflect the exact partition
layout when actually installing Red Hat Enterprise Linux.
The first diagram represents a disk with one primary partition and an undefined partition with
unallocated space. The second diagram represents a disk with two defined partitions with allocated
space.
An unused hard disk also falls into this category. The only difference is that all the space is not part of
any defined partition.
On a new disk, you can create the necessary partitions from the unused space. Most preinstalled
operating systems are configured to take up all available space on a disk drive.
To use the space allocated to the unused partition, delete the partition and then create the appropriate
Linux partition instead. Alternatively, during the installation process, delete the unused partition and
manually create new partitions.
WARNING
If you want to use an operating system (OS) on an active partition, you must
reinstall the OS. Be aware that some computers, which include pre-installed
software, do not include installation media to reinstall the original OS. Check
whether this applies to your OS before you destroy an original partition and the OS
installation.
To optimise the use of available free space, you can use the methods of destructive or non-destructive
repartitioning.
After creating a smaller partition for your existing operating system, you can:
Reinstall software.
49
Red Hat Enterprise Linux 9 Managing storage devices
The following diagram is a simplified representation of using the destructive repartitioning method.
WARNING
This method deletes all data previously stored in the original partition.
The following is a list of methods, which can help initiate non-destructive repartitioning.
The storage location of some data cannot be changed. This can prevent the resizing of a partition to the
required size, and ultimately lead to a destructive repartition process. Compressing data in an already
existing partition can help you resize your partitions as needed. It can also help to maximize the free
space available.
To avoid any possible data loss, create a backup before continuing with the compression process.
By resizing an already existing partition, you can free up more space. Depending on your resizing
software, the results may vary. In the majority of cases, you can create a new unformatted partition of
the same type, as the original partition.
The steps you take after resizing can depend on the software you use. In the following example, the best
practice is to delete the new DOS (Disk Operating System) partition, and create a Linux partition
instead. Verify what is most suitable for your disk before initiating the resizing process.
Some pieces of resizing software support Linux based systems. In such cases, there is no need to delete
the newly created partition after resizing. Creating a new partition afterwards depends on the software
you use.
The following diagram represents the disk state, before and after creating a new partition.
52
CHAPTER 7. CONFIGURING AN ISCSI TARGET
Add, remove, view, and monitor iSCSI storage interconnects to utilize iSCSI hardware.
Export local storage resources that are backed by either files, volumes, local SCSI devices, or by
RAM disks to remote systems.
The targetcli tool has a tree-based layout including built-in tab completion, auto-complete support, and
inline documentation.
Procedure
4. Open port 3260 in the firewall and reload the firewall configuration:
# firewall-cmd --reload
Success
Verification
# targetcli
/> ls
o- /........................................[...]
o- backstores.............................[...]
| o- block.................[Storage Objects: 0]
| o- fileio................[Storage Objects: 0]
| o- pscsi.................[Storage Objects: 0]
| o- ramdisk...............[Storage Objects: 0]
o- iscsi...........................[Targets: 0]
o- loopback........................[Targets: 0]
53
Red Hat Enterprise Linux 9 Managing storage devices
Additional resources
Prerequisites
Installed and running targetcli. For more information, see Installing targetcli.
Procedure
/> iscsi/
NOTE
The cd command is used to change directories as well as to list the path to move
into.
/iscsi> create
Created target
iqn.2003-01.org.linux-iscsi.hostname.x8664:sn.78b473f296ff
Created TPG1
/iscsi> ls
o- iscsi.......................................[1 Target]
o- iqn.2006-04.com.example:444................[1 TPG]
o- tpg1...........................[enabled, auth]
54
CHAPTER 7. CONFIGURING AN ISCSI TARGET
o- acls...............................[0 ACL]
o- luns...............................[0 LUN]
o- portals.........................[0 Portal]
Additional resources
An administrator can choose any of the following backstore devices that Linux-IO (LIO) supports:
fileio backstore
Create a fileio storage object if you are using regular files on the local file system as disk images. For
creating a fileio backstore, see Creating a fileio storage object .
block backstore
Create a block storage object if you are using any local block device and logical device. For creating
a block backstore, see Creating a block storage object .
pscsi backstore
Create a pscsi storage object if your storage object supports direct pass-through of SCSI
commands. For creating a pscsi backstore, see Creating a pscsi storage object .
ramdisk backstore
Create a ramdisk storage object if you want to create a temporary RAM backed device. For creating
a ramdisk backstore, see Creating a Memory Copy RAM disk storage object .
Additional resources
Prerequisites
Installed and running targetcli. For more information, see Installing targetcli.
Procedure
/> backstores/fileio
55
Red Hat Enterprise Linux 9 Managing storage devices
Verification
/backstores/fileio> ls
Additional resources
Prerequisites
Installed and running targetcli. For more information, see Installing targetcli.
Procedure
/> backstores/block/
Verification
/backstores/block> ls
NOTE
Additional resources
56
CHAPTER 7. CONFIGURING AN ISCSI TARGET
WARNING
pscsi should only be used by advanced users. Advanced SCSI commands such as
for Asymmetric Logical Unit Assignment (ALUAs) or Persistent Reservations (for
example, those used by VMware ESX, and vSphere) are usually not implemented in
the device firmware and can cause malfunctions or crashes. When in doubt, use
block backstore for production setups instead.
Prerequisites
Installed and running targetcli. For more information, see Installing targetcli.
Procedure
/> backstores/pscsi/
2. Create a pscsi backstore for a physical SCSI device, a TYPE_ROM device using /dev/sr0 in this
example:
Verification
/backstores/pscsi> ls
Additional resources
Memory Copy RAM disks (ramdisk) provide RAM disks with full SCSI emulation and separate memory
57
Red Hat Enterprise Linux 9 Managing storage devices
Memory Copy RAM disks (ramdisk) provide RAM disks with full SCSI emulation and separate memory
mappings using memory copy for initiators. This provides capability for multi-sessions and is particularly
useful for fast and volatile mass storage for production purposes.
Prerequisites
Installed and running targetcli. For more information, see Installing targetcli.
Procedure
/> backstores/ramdisk/
Verification
/backstores/ramdisk> ls
Additional resources
Prerequisites
Installed and running targetcli. For more information, see Installing targetcli.
An iSCSI target associated with a Target Portal Groups (TPG). For more information, see
Creating an iSCSI target .
Procedure
/iscsi> iqn.2006-04.example:444/tpg1/
a. Creating a default portal uses the default iSCSI port 3260 and allows the target to listen to
all IP addresses on that port:
58
CHAPTER 7. CONFIGURING AN ISCSI TARGET
NOTE
When an iSCSI target is created, a default portal is also created. This portal is
set to listen to all IP addresses with the default port number that is:
0.0.0.0:3260.
Verification
/iscsi/iqn.20...mple:444/tpg1> ls
Additional resources
Prerequisites
Installed and running targetcli. For more information, see Installing targetcli.
An iSCSI target associated with a Target Portal Groups (TPG). For more information, see
Creating an iSCSI target .
59
Red Hat Enterprise Linux 9 Managing storage devices
Procedure
/iscsi/iqn.20...mple:444/tpg1> ls
IMPORTANT
By default, LUNs are created with read-write permissions. If a new LUN is added
after ACLs are created, LUN automatically maps to all available ACLs and can
cause a security risk. To create a LUN with read-only permissions, see Creating a
read-only iSCSI LUN.
Additional resources
Prerequisites
Installed and running targetcli. For more information, see Installing targetcli.
An iSCSI target associated with a Target Portal Groups (TPG). For more information, see
Creating an iSCSI target .
60
CHAPTER 7. CONFIGURING AN ISCSI TARGET
Procedure
This prevents the auto mapping of LUNs to existing ACLs allowing the manual mapping of
LUNs.
/> iscsi/target_iqn_name/tpg1/acls/initiator_iqn_name/
/iscsi/target_iqn_name/tpg1/acls/initiator_iqn_name> create
mapped_lun=next_sequential_LUN_number tpg_lun_or_backstore=backstore
write_protect=1
Example:
Created LUN 1.
Created Mapped LUN 1.
/iscsi/target_iqn_name/tpg1/acls/2006-04.com.example:888> ls
o- 2006-04.com.example:888 .. [Mapped LUNs: 2]
| o- mapped_lun0 .............. [lun0 block/disk1 (rw)]
| o- mapped_lun1 .............. [lun1 block/disk2 (ro)]
The mapped_lun1 line now has (ro) at the end (unlike mapped_lun0’s ( rw)) stating that it is
read-only.
Additional resources
Both targets and initiators have unique identifying names. You must know the unique name of the
initiator to configure ACLs. The /etc/iscsi/initiatorname.iscsi file, provided by the iscsi-initiator-utils
package, contains the iSCSI initiator names.
61
Red Hat Enterprise Linux 9 Managing storage devices
Prerequisites
Procedure
1. Optional: To disable auto mapping of LUNs to ACLs see Creating a read-only iSCSI LUN .
/> iscsi/target_iqn_name/tpg_name/acls/
For information about updating the initiator name, see Creating an iSCSI intiator .
Verification
iscsi/target_iqn_name/tpg_name/acls> ls
Additional resources
Prerequisites
Created iSCSI ACL. For more information, see Creating an iSCSI ACL .
Procedure
Additional resources
Procedure
For more information about how to log in to the target, see Creating an iSCSI initiator .
2. Remove the entire target, including all ACLs, LUNs, and portals:
63
Red Hat Enterprise Linux 9 Managing storage devices
Verification
/> iscsi/ ls
Additional resources
64
CHAPTER 8. CONFIGURING AN ISCSI INITIATOR
Execute the systemctl start iscsid.service command as root to force the iscsid daemon to run and
iSCSI kernel modules to load.
Prerequisites
If you are connecting to a storage target that the external software created, find the
target’s hostname and IP address from the storage administrator.
Procedure
# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2006-04.com.example:888
3. If the ACL was given a custom name in Creating an iSCI ACL , update the initiator name to match
the ACL:
# vi /etc/iscsi/initiatorname.iscsi
InitiatorName=custom-name
4. Discover the target and log in to the target with the displayed target IQN:
65
Red Hat Enterprise Linux 9 Managing storage devices
You can use this procedure for any number of initiators connected to the same target if their
respective initiator names are added to the ACL as described in the Creating an iSCSI ACL .
5. Find the iSCSI disk name and create a file system on this iSCSI disk:
# mkfs.ext4 /dev/disk_name
Replace disk_name with the iSCSI disk name displayed in the /var/log/messages file.
# mkdir /mount/point
7. Edit the /etc/fstab file to mount the file system automatically when the system boots:
# vi /etc/fstab
Replace disk_name with the iSCSI disk name and /mount/point with the mount point of the
partition.
Additional resources
Prerequisites
Created iSCSI initiator. For more information, see Creating an iSCSI initiator .
Set the CHAP for the target. For more information, see Setting up the Challenge-Handshake
Authentication Protocol for the target.
Procedure
66
CHAPTER 8. CONFIGURING AN ISCSI INITIATOR
# vi /etc/iscsi/iscsid.conf
node.session.auth.authmethod = CHAP
node.session.auth.username = redhat
node.session.auth.password = redhat_passwd
Additional resources
By default, an iSCSI service is lazily started and the service starts after running the iscsiadm command.
If root is not on an iSCSI device or there are no nodes marked with node.startup = automatic then the
iSCSI service will not start until an iscsiadm command is executed that requires iscsid or the iscsi
kernel modules to be started.
Execute the systemctl start iscsid.service command as root to force the iscsid daemon to run and
iSCSI kernel modules to load.
Procedure
# iscsiadm -m session -P 3
This command displays the session or device state, session ID (sid), some negotiated
parameters, and the SCSI devices accessible through the session.
For shorter output, for example, to display only the sid-to-node mapping, run:
# iscsiadm -m session -P 0
or
# iscsiadm -m session
67
Red Hat Enterprise Linux 9 Managing storage devices
These commands print the list of running sessions in the following format: driver [sid]
target_ip:port,target_portal_group_tag proper_target_name.
Additional resources
/usr/share/doc/iscsi-initiator-utils-version/README file
The replacement_timeout configuration option globally overrides the recovery_tmo value for
all iSCSI devices.
For all iSCSI devices that are managed by DM Multipath, the fast_io_fail_tmo option in DM
Multipath globally overrides the recovery_tmo value.
The fast_io_fail_tmo option in DM Multipath also overrides the fast_io_fail_tmo option in
Fibre Channel devices.
The DM Multipath fast_io_fail_tmo option takes precedence over replacement_timeout. Red Hat does
not recommend using replacement_timeout to override recovery_tmo in devices managed by DM
Multipath because DM Multipath always resets recovery_tmo, when the multipathd service reloads.
68
CHAPTER 9. USING FIBRE CHANNEL DEVICES
lpfc
qla2xxx
zfcp
Procedure
multipath -ll
Additional resources
Procedure
$ cat /sys/class/fc_remote_port/rport-host:bus:remote-port/port_state
Blocked when the remote port along with devices accessed through it are blocked.
When a link loss exceeds dev_loss_tmo, the scsi_device and sd_N_ devices are removed. Typically,
the Fibre Channel class will leave the device as is, that is /dev/sdx will remain /dev/sdx. This is because
the target binding is saved by the Fibre Channel driver and when the target port returns, the SCSI
addresses are recreated faithfully. However, this cannot be guaranteed, the sdx device will be restored
only if no additional change on in-storage box configuration of LUNs is made.
69
Red Hat Enterprise Linux 9 Managing storage devices
Additional resources
Recommended tuning at scsi,multipath and at application layer while configuring Oracle RAC
cluster Knowledgebase article
H
Host number
B
Bus number
T
Target
L
Logical unit (LUNs)
R
Remote port number
IMPORTANT
Consult your hardware vendor before changing any of the values described in this
section, if your system is using multipath software.
port_id
24-bit port ID/address
node_name
64-bit node name
port_name
64-bit port name
port_id
node_name
port_name
dev_loss_tmo
Controls when the scsi device gets removed from the system. After dev_loss_tmo triggers, the
scsi device is removed. In the multipath.conf file , you can set dev_loss_tmo to infinity.
70
CHAPTER 9. USING FIBRE CHANNEL DEVICES
In Red Hat Enterprise Linux 9, if you do not set the fast_io_fail_tmo option, dev_loss_tmo is
capped to 600 seconds. By default, fast_io_fail_tmo is set to 5 seconds in Red Hat
Enterprise Linux 9 if the multipathd service is running; otherwise, it is set to off.
fast_io_fail_tmo
Specifies the number of seconds to wait before it marks a link as "bad". Once a link is marked
bad, existing running I/O or any new I/O on its corresponding path fails.
If I/O is in a blocked queue, it will not be failed until dev_loss_tmo expires and the queue is
unblocked.
port_id
node_name
port_name
issue_lip
Instructs the driver to rediscover remote ports.
The replacement_timeout configuration option globally overrides the recovery_tmo value for
all iSCSI devices.
For all iSCSI devices that are managed by DM Multipath, the fast_io_fail_tmo option in DM
Multipath globally overrides the recovery_tmo value.
The fast_io_fail_tmo option in DM Multipath also overrides the fast_io_fail_tmo option in
Fibre Channel devices.
The DM Multipath fast_io_fail_tmo option takes precedence over replacement_timeout. Red Hat does
not recommend using replacement_timeout to override recovery_tmo in devices managed by DM
Multipath because DM Multipath always resets recovery_tmo, when the multipathd service reloads.
71
Red Hat Enterprise Linux 9 Managing storage devices
Before performing the operating system upgrades, consider the following aspects:
System upgrades with snapshots do not work on multiple file systems in your system tree, for
example, a separate /var or /usr partition.
System upgrades with snapshots do not work for the Red Hat Update Infrastructure (RHUI)
systems. Instead of using the Boom utility, consider creating snapshots of your virtual machines
(VMs).
The following boot entries are part of the upgrade and rollback processes:
Additional resources
Prerequisites
72
CHAPTER 10. MANAGING SYSTEM UPGRADES WITH SNAPSHOTS
You have installed the current version of the boom-boot package (version boom-1.3-3.el9,
ideally boom-1.4-4.el9 or later).
You have sufficient space available for the snapshot. Make a size estimate based on the size of
the original installation. List all the mounted logical volumes.
You have activated the snapshot volume. If it is not active, the boom command fails.
NOTE
Procedure
If your root file system uses thin provisioning, create a thin snapshot:
Here:
If your root file system uses thick provisioning, create a thick snapshot:
Here:
-L 25g is the snapshot size. Make a size estimate based on the size of the original
installation.
While creating a thick snapshot, define the snapshot size that can hold all the changes
during the upgrade.
IMPORTANT
The created snapshot does not include any additional system changes.
73
Red Hat Enterprise Linux 9 Managing storage devices
3. Create a snapshot boot entry of the original system using backup copies of the original boot
images:
Here:
--title Root LV snapshot before changes is the name of the boot entry, that shows in the
boot entry list during system startup.
--rootlv is the root logical volume that corresponds to the new boot entry.
After you complete the previous step, you have a boot entry that enables access to the
original system, before the upgrade.
# leapp upgrade
Review and resolve any indicated blockers from the leapp upgrade command report.
Select the Red Hat Enterprise Linux Upgrade Initramfs entry from the GRUB boot screen.
The leapp utility creates the upgrade boot entry. Run the above mentioned command to
reboot into the upgrade boot entry, and proceed to execute the in-place upgrade to
Red Hat Enterprise Linux 9. After the upgrade process, the reboot argument initiates an
automatic system restart. The GRUB screen shows during reboot.
NOTE
The Snapshots submenu from the GRUB boot screen is not available in
Red Hat Enterprise Linux 9.
Verification steps
Continue the upgrade and install the new Red Hat Enterprise Linux 9 RPM packages. After
completing the upgrade, the system automatically reboots. The GRUB screen shows the
upgraded and the older version of the available operating system. The upgraded system version
is the default selection.
Check if the Root LV snapshot before changes boot entry is in the GRUB menu. If present, it
provides instant access to the operating system state, prior to the upgrade.
Additional resources
74
CHAPTER 10. MANAGING SYSTEM UPGRADES WITH SNAPSHOTS
continue accessing the old system, while the upgraded host is running.
halt and revert the update process at any time, even while the update itself is running.
Prerequisites
Procedure
# reboot
2. Select the required boot entry from the GRUB boot loader screen.
Verification steps
# cat /proc/cmdline
root=/dev/rhel/root_snapshot_before_changes ro
rd.lvm.lv=rhel/root_snapshot_before_changes rd.lvm.lv=vg_root/swap rhgb quiet
Additional resources
IMPORTANT
75
Red Hat Enterprise Linux 9 Managing storage devices
IMPORTANT
You cannot perform any further operations with the Logical Volume (LV) snapshot after
you delete it.
Prerequisites
Procedure
1. Boot into Red Hat Enterprise Linux 9 from the GRUB entry. The following output confirms that
the new snapshot is selected:
# boom list
BootID Version Name RootDevice
6d2ec72 3.10.0-957.21.3.el8.x86_64 Red Hat Enterprise Linux Server
/dev/rhel/root_snapshot_before_changes
# lvremove rhel/root_snapshot_before_changes
Do you really want to remove active logical volume rhel/root_snapshot_before_changes?
[y/n]: y
Logical volume "root_snapshot_before_changes" successfully removed
Additional resources
Prepare the rollback boot entry either from the upgraded system, or from the snapshot environment.
Prerequisites
Procedure
76
CHAPTER 10. MANAGING SYSTEM UPGRADES WITH SNAPSHOTS
WARNING
After you merge the snapshot, you must continue with all the remaining
steps in this procedure to prevent data loss.
For boom-0.9:
# reboot
Once the system is rebooted, select the Red Hat Enterprise Linux Rollback boot entry from
the GRUB screen.
Once the root logical volume is active, the system automatically starts the snapshot merge
operation.
IMPORTANT
Once the merge operation starts, the snapshot volume is no longer available.
After successfully booting the Red Hat Enterprise Linux Rollback boot entry,
the Root LV snapshot boot entryno longer works. Merging the snapshot
logical volume destroys the Root LV snapshot and restores the prior state of
the original volume.
4. Optional: After you complete the merge operation, remove the unused entries and restore the
original boot entry:
a. Remove the unused Red Hat Enterprise Linux 9 boot entries from the /boot file system and
rebuild the grub.cfg file for the changes to take effect:
# grub2-mkconfig -o /boot/grub2/grub.cfg
5. After a successful rollback to the system, delete the boom boot entry:
77
Red Hat Enterprise Linux 9 Managing storage devices
# boom list
# boom delete boot-id
Additional resources
78
CHAPTER 11. CONFIGURING NVME OVER FABRICS USING NVME/RDMA
As a system administrator, complete the following tasks to deploy the NVMe/RDMA setup:
Use the following types of fabric transport to configure NVMe over fabric devices:
When using NVMe over fabrics, the solid-state drive does not have to be local to your system; it can be
configured remotely through a NVMe over fabrics devices.
Prerequisites
Verify that you have a block device to assign to the nvmet subsystem.
Procedure
# modprobe nvmet-rdma
# mkdir /sys/kernel/config/nvmet/subsystems/testnqn
# cd /sys/kernel/config/nvmet/subsystems/testnqn
79
Red Hat Enterprise Linux 9 Managing storage devices
3. Configure a namespace:
# mkdir namespaces/10
# cd namespaces/10
# mkdir /sys/kernel/config/nvmet/ports/1
# cd /sys/kernel/config/nvmet/ports/1
80
CHAPTER 11. CONFIGURING NVME OVER FABRICS USING NVME/RDMA
# ln -s /sys/kernel/config/nvmet/subsystems/testnqn
/sys/kernel/config/nvmet/ports/1/subsystems/testnqn
Verification
Verify that the NVMe controller is listening on the given port and ready for connection requests:
Additional resources
Prerequisites
Verify that you have a block device to assign to the nvmet subsystem.
Procedure
# wget
http://git.infradead.org/users/hch/nvmetcli.git/blob_plain/0a6b088db2dc2e5de11e6f23f1e890e4
b54fee64:/rdma.json
3. Edit the rdma.json file and change the traddr value to 172.31.0.202.
NOTE
If the NVMe controller configuration file name is not specified, the nvmetcli uses the
/etc/nvmet/config.json file.
81
Red Hat Enterprise Linux 9 Managing storage devices
Verification
Verify that the NVMe controller is listening on the given port and ready for connection requests:
# dmesg | tail -1
[ 4797.132647] nvmet_rdma: enabling port 2 (172.31.0.202:4420)
# nvmetcli clear
Additional resources
Procedure
# modprobe nvme-rdma
82
CHAPTER 11. CONFIGURING NVME OVER FABRICS USING NVME/RDMA
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 464.8G 0 part
├─rhel_rdma--virt--03-root 253:0 0 50G 0 lvm /
├─rhel_rdma--virt--03-swap 253:1 0 4G 0 lvm [SWAP]
└─rhel_rdma--virt--03-home 253:2 0 410.8G 0 lvm /home
nvme0n1
# cat /sys/class/nvme/nvme0/transport
rdma
Verification
# nvme list
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 464.8G 0 part
├─rhel_rdma--virt--03-root 253:0 0 50G 0 lvm /
├─rhel_rdma--virt--03-swap 253:1 0 4G 0 lvm [SWAP]
└─rhel_rdma--virt--03-home 253:2 0 410.8G 0 lvm /home
Additional resources
83
Red Hat Enterprise Linux 9 Managing storage devices
Use the following types of fabric transport to configure NVMe over fabric devices:
When using NVMe over fabrics, the solid-state drive does not have to be local to your system; it can be
configured remotely through a NVMe over fabrics devices.
Procedure
This creates the hostnqn file in the /etc/nvme/ directory. The hostnqn file identifies the NVMe
host.
2. Find the World Wide Node Name (WWNN) and World Wide Port Name (WWPN) identifiers of
the local and remote ports:
# cat /sys/class/scsi_host/host*/nvme_info
84
CHAPTER 12. CONFIGURING NVME OVER FABRICS USING NVME/FC
NVME Statistics
LS: Xmt 000000000e Cmpl 000000000e Abort 00000000
LS XMIT: Err 00000000 CMPL: xb 00000000 Err 00000000
Total FCP Cmpl 00000000000008ea Issue 00000000000008ec OutIO 0000000000000002
abort 00000000 noxri 00000000 nondlp 00000000 qdepth 00000000 wqerr 00000000 err
00000000
FCP CMPL: xb 00000000 Err 00000000
Using these host-traddr and traddr values, find the subsystem NVMe Qualified Name (NQN):
NOTE
If you see the keep-alive timer (5 seconds) expired! error when a connection
time exceeds the default keep-alive timeout value, increase it using the -k
option. For example, you can use, -k 7.
Here,
85
Red Hat Enterprise Linux 9 Managing storage devices
Replace nqn.1992-
08.com.netapp:sn.e18bfca87d5e11e98c0800a098cbcac6:subsystem.st14_nvme_ss_1_1 with the
subnqn.
Verification
# nvme list
Node SN Model Namespace Usage
Format FW Rev
---------------- -------------------- ---------------------------------------- --------- -------------------------
- ---------------- --------
/dev/nvme0n1 80BgLFM7xMJbAAAAAAAC NetApp ONTAP Controller 1
107.37 GB / 107.37 GB 4 KiB + 0 B FFFFFFFF
Additional resources
Procedure
This creates the hostnqn file in the /etc/nvme/ directory. The hostnqn file identifies the NVMe
host.
# modprobe -r qla2xxx
# modprobe qla2xxx
3. Find the World Wide Node Name (WWNN) and World Wide Port Name (WWPN) identifiers of
the local and remote ports:
86
CHAPTER 12. CONFIGURING NVME OVER FABRICS USING NVME/FC
0x20000024ff19bb62:pn-0x21000024ff19bb62 on portID:10700
[ 6.241762] qla2xxx [0000:04:00.0]-2102:0: qla_nvme_register_remote: traddr=nn-
0x203b00a098cbcac6:pn-0x203d00a098cbcac6 PortID:01050d
Using these host-traddr and traddr values, find the subsystem NVMe Qualified Name (NQN):
NOTE
If you see the keep-alive timer (5 seconds) expired! error when a connection
time exceeds the default keep-alive timeout value, increase it using the -k
option. For example, you can use, -k 7.
Here,
Replace nqn.1992-
08.com.netapp:sn.c9ecc9187b1111e98c0800a098cbcac6:subsystem.vs_nvme_multipath_1_subsystem_468
with the subnqn.
Verification
87
Red Hat Enterprise Linux 9 Managing storage devices
# nvme list
Node SN Model Namespace Usage
Format FW Rev
---------------- -------------------- ---------------------------------------- --------- -------------------------
- ---------------- --------
/dev/nvme0n1 80BgLFM7xMJbAAAAAAAC NetApp ONTAP Controller 1
107.37 GB / 107.37 GB 4 KiB + 0 B FFFFFFFF
Additional resources
88
CHAPTER 13. CONFIGURING NVME OVER FABRICS USING NVME/TCP
As a system administrator, complete the tasks in the following sections to deploy the NVMe/TCP setup:
NOTE
In Red Hat Enterprise Linux 9, the native NVMe multipathing is enabled by default.
Enabling DM multipathing is not supported with NVMe/TCP.
Use the following types of fabric transport to configure NVMe over fabric devices:
When using NVMe over fabrics, the solid-state drive does not have to be local to your system; it can be
configured remotely through a NVMe over fabrics devices.
Procedure
This tool creates the hostnqn file in the /etc/nvme/ directory, which identifies the NVMe host.
89
Red Hat Enterprise Linux 9 Managing storage devices
# cat /etc/nvme/hostnqn
nqn.2014-08.org.nvmexpress:uuid:8ae2b12c-3d28-4458-83e3-658e571ed4b8
# cat /etc/nvme/hostid
09e2ce17-ccc9-412d-8dcf-2b0a1d581ee3
Use the hostid and hostnqn values to configure the NVMe/TCP controller.
4. Configure the host network for a newly installed Ethernet controller with a static IP address:
# nmcli connection add con-name ens6 ifname ens6 type ethernet ip4 192.168.101.154/24
gw4 192.168.101.1
Since a new network is created to connect the NVMe/TCP host to the NVMe/TCP controller,
execute this step on the controller too.
Verification
90
CHAPTER 13. CONFIGURING NVME OVER FABRICS USING NVME/TCP
Additional resources
NOTE
Prerequisites
You have configured an NVMe/TCP host. For more information, see Configuring an
NVMe/TCP host.
You have configured an NVMe/TCP controller using external storage software and the network
is configured on the controller. In this procedure, 192.168.101.55 is the IP address of NVMe/TCP
controller.
Procedure
# modprobe nvme_tcp
91
Red Hat Enterprise Linux 9 Managing storage devices
traddr: 192.168.101.55
eflags: not specified
sectype: none
3. Configure the /etc/nvme/discovery.conf file to add the parameters used in the nvme discover
command :
# nvme connect-all
Verification
# nvme list-subsys
nvme-subsys3 - NQN=nqn.2014-08.org.nvmexpress:uuid:0c468c4d-a385-47e0-8299-
6e95051277db
\
+- nvme3 tcp traddr=192.168.101.55,trsvcid=8009,host_traddr=192.168.101.154 live
optimized
# nvme list
Node Generic SN Model Namespace Usage
Format FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- --------
- -------------------------- ---------------- --------
/dev/nvme3n1 /dev/ng3n1 d93a63d394d043ab4b74 Linux 1
21.47 GB / 21.47 GB 512 B + 0 B 5.18.5-2
Additional resources
92
CHAPTER 14. ENABLING MULTIPATHING ON NVME DEVICES
Both DM Multipath and native NVMe multipathing support the Asymmetric Namespace Access (ANA)
multipathing scheme of NVMe devices. ANA identifies optimized paths between the controller and the
host, and improves performance.
When native NVMe multipathing is enabled, it applies globally to all NVMe devices. It can provide higher
performance, but does not contain all of the functionality that DM Multipath provides. For example,
native NVMe multipathing supports only the numa and round-robin path selection methods.
By default, NVMe multipathing is enabled in Red Hat Enterprise Linux 9 and is the recommended
multipathing solution.
Prerequisites
The NVMe devices are connected to your system. For more information, see Overview of NVMe
over fabric devices.
Procedure
# cat /sys/module/nvme_core/parameters/multipath
N
Native NVMe multipathing is disabled.
Y
Native NVMe multipathing is enabled.
2. If the native NVMe multipathing is enabled, disable it by using one of the following methods:
93
Red Hat Enterprise Linux 9 Managing storage devices
# zipl
3. Enable DM Multipath:
4. Distribute I/O on all available paths. Add the following content in the /etc/multipath.conf file:
devices {
device {
vendor "NVME"
product ".*"
path_grouping_policy group_by_prio
}
}
NOTE
# multipath -r
Verification
94
CHAPTER 14. ENABLING MULTIPATHING ON NVME DEVICES
# cat /sys/module/nvme_core/parameters/multipath
N
# multipath -l
Additional resources
Configuring DM Multipath
Prerequisites
The NVMe devices are connected to your system. For more information, see Overview of NVMe
over fabric devices.
Procedure
# cat /sys/module/nvme_core/parameters/multipath
N
Native NVMe multipathing is disabled.
Y
Native NVMe multipathing is enabled.
2. If native NVMe multipathing is disabled, enable it by using one of the following methods:
95
Red Hat Enterprise Linux 9 Managing storage devices
# zipl
# rm /etc/modprobe.d/nvme_core.conf
3. Optional: On the running system, change the I/O policy on NVMe devices to distribute the I/O
on all available paths:
4. Optional: Set the I/O policy persistently using udev rules. Create the /etc/udev/rules.d/71-
nvme-io-policy.rules file with the following content:
Verification
1. Verify if your system recognizes the NVMe devices. The following example assumes you have a
connected NVMe over fabrics storage subsystem with two NVMe namespaces:
# nvme list
96
CHAPTER 14. ENABLING MULTIPATHING ON NVME DEVICES
# nvme list-subsys
nvme-subsys0 - NQN=testnqn
\
+- nvme0 fc traddr=nn-0x20000090fadd597a:pn-0x10000090fadd597a host_traddr=nn-
0x20000090fac7e1dd:pn-0x10000090fac7e1dd live
+- nvme1 fc traddr=nn-0x20000090fadd5979:pn-0x10000090fadd5979 host_traddr=nn-
0x20000090fac7e1dd:pn-0x10000090fac7e1dd live
+- nvme2 fc traddr=nn-0x20000090fadd5979:pn-0x10000090fadd5979 host_traddr=nn-
0x20000090fac7e1de:pn-0x10000090fac7e1de live
+- nvme3 fc traddr=nn-0x20000090fadd597a:pn-0x10000090fadd597a host_traddr=nn-
0x20000090fac7e1de:pn-0x10000090fac7e1de live
Check the active transport type. For example, nvme0 fc indicates that the device is connected
over the Fibre Channel transport, and nvme tcp indicates that the device is connected over
TCP.
3. If you edited the kernel options, verify if native NVMe multipathing is enabled on the kernel
command line:
# cat /proc/cmdline
BOOT_IMAGE=[...] nvme_core.multipath=Y
4. If you changed the I/O policy, verify if round-robin is the active I/O policy on NVMe devices:
# cat /sys/class/nvme-subsystem/nvme-subsys0/iopolicy
round-robin
Additional resources
97
Red Hat Enterprise Linux 9 Managing storage devices
The following diagram describes the connection of a diskless client with the server through Dynamic
Host Configuration Protocol (DHCP) and Trivial File Transfer Protocol (TFTP) services.
IMPORTANT
Prerequisites
Procedure
98
CHAPTER 15. SETTING UP A REMOTE DISKLESS SYSTEM
NOTE
This configuration does not boot over the Unified Extensible Firmware Interface (UEFI).
For UEFI based installation. see Configuring a TFTP server for UEFI-based clients .
Prerequisites
tftp-server
syslinux
Procedure
# mkdir -p /var/lib/tftpboot/pxelinux/
# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/pxelinux/
You can find the tftp root directory (chroot) in the /var/lib/tftpboot directory.
# cp /usr/share/syslinux/ldlinux.c32 /var/lib/tftpboot/pxelinux/
# mkdir -p /var/lib/tftpboot/pxelinux/pxelinux.cfg/
This configuration does not boot over the Unified Extensible Firmware Interface (UEFI). To
perform the installation for UEFI, follow the procedure in Configuring a TFTP server for UEFI-
based clients.
Verification
99
Red Hat Enterprise Linux 9 Managing storage devices
Prerequisites
dhcp-server
You have configured the tftp service for diskless clients. See section Configuring a TFTP service
for diskless clients.
Procedure
1. Add the configuration to the /etc/dhcp/dhcpd.conf file to setup a DHCP server and enable
Preboot Execution Environment (PXE) for booting:
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 192.168.205.1;
Your DHCP configuration might be different depending on your environment, like setting
lease time or fixed address. For details, see Providing DHCP services .
NOTE
100
CHAPTER 15. SETTING UP A REMOTE DISKLESS SYSTEM
NOTE
While using libvirt virtual machine as a diskless client, the libvirt daemon
provides the DHCP service, and the standalone DHCP server is not used. In
this situation, network booting must be enabled with the bootp file=
<filename> option in the libvirt network configuration, virsh net-edit.
2. Enable dhcpd.service:
Verification
Prerequisites
You have configured the tftp service for diskless clients. See section Configuring a TFTP service
for diskless clients.
You have configured the Dynamic Host Configuration Protocol (DHCP) server. See section
Configuring a DHCP server for diskless clients .
Procedure
1. Configure the Network File System (NFS) server to export the root directory by adding it to the
/etc/exports directory. For the complete set of instructions see Deploying an NFS server .
2. Install a complete version of Red Hat Enterprise Linux to the root directory to accommodate
completely diskless clients. To do that you can either install a new base system or clone an
existing installation.
Install Red Hat Enterprise Linux to the exported location by replacing exported-root-
directory with the path to the exported file system:
By setting the releasever option to /, releasever is detected from the host ( /) system.
101
Red Hat Enterprise Linux 9 Managing storage devices
Replace example.com with the hostname of the running system with which to
synchronize via the rsync utility.
You need to fully configure the file system, that is ready for export, before you can use it with diskless
clients. Follow the procedure below to complete the configuration.
# cp /exported-root-directory/boot/vmlinuz-kernel-version /var/lib/tftpboot/pxelinux/
2. Create the initramfs-kernel-version.img file locally and move it to the exported root directory
with NFS support:
For example:
Example for creating initrd, using current running kernel version, and overwriting existing image:
WARNING
If you do not change the initrd file permissions, the pxelinux.0 boot loader
fails with a "file not found" error.
4. Copy the resulting initramfs-kernel-version.img file into the tftp boot directory:
# cp /exported-root-directory/boot/initramfs-kernel-version.img
/var/lib/tftpboot/pxelinux/
102
CHAPTER 15. SETTING UP A REMOTE DISKLESS SYSTEM
default rhel9
label rhel9
kernel vmlinuz-kernel-version
append initrd=initramfs-kernel-version.img root=nfs:_server-ip_:/exported-root-directory rw
This configuration instructs the diskless client root to mount the exported file system
(/exported-root-directory) in a read/write format.
default rhel9
label rhel9
kernel vmlinuz-kernel-version
append initrd=initramfs-kernel-version.img root=nfs:server-ip:/exported-root-directory ro
You can now export the NFS share to diskless clients. These clients can boot over the network via
Preboot Execution Environment (PXE).
Prerequisites
You have enabled the no_root_squash option in the exported file system.
Procedure
# passwd <username>
Replace the <username> with a real user to whom you want to change the password.
103
Red Hat Enterprise Linux 9 Managing storage devices
3. Configure two separate exports to split a remote diskless system into a /usr and a /var. See
Deploying an NFS server .
Check if the Dynamic Host Configuration Protocol (DHCP) service is enabled on the server.
Check the DHCP configuration file /etc/dhcp/dhcpd.conf. For details, see Configuring a
DHCP server for diskless clients.
# firewall-cmd --get-active-zones
# firewall-cmd --info-zone=public
# firewall-cmd --get-active-zones
# firewall-cmd --info-zone=public
104
CHAPTER 15. SETTING UP A REMOTE DISKLESS SYSTEM
Example 15.2. The file is not available during the booting a remote diskless system
105
Red Hat Enterprise Linux 9 Managing storage devices
Swap space is located on hard drives, which have a slower access time than physical memory. Swap
space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions
and swap files.
In years past, the recommended amount of swap space increased linearly with the amount of RAM in the
system. However, modern systems often include hundreds of gigabytes of RAM. As a consequence,
recommended swap space is considered a function of system memory workload, not system memory.
106
CHAPTER 16. GETTING STARTED WITH SWAP
The following recommendations are especially important on systems with low memory, such as 1 GB or
less. Failure to allocate sufficient swap space on these systems can cause issues, such as instability or
even render the installed system unbootable.
Amount of RAM in the system Recommended swap space Recommended swap space if
allowing for hibernation
For border values such as 2 GB, 8 GB, or 64 GB of system RAM, choose swap size based on your needs
or preference. If your system resources allow for it, increasing the swap space can lead to better
performance.
Note that distributing swap space over multiple storage devices also improves swap space performance,
particularly on systems with fast drives, controllers, and interfaces.
IMPORTANT
File systems and LVM2 volumes assigned as swap space should not be in use when being
modified. Any attempts to modify swap fail if a system process or the kernel is using swap
space. Use the free and cat /proc/swaps commands to verify how much and where swap
is in use.
Resizing swap space requires temporarily removing it from the system. This can be
problematic if running applications rely on the additional swap space and might run into
low-memory situations. Preferably, perform swap resizing from rescue mode, see Debug
boot options in the Performing an advanced RHEL 9 installation . When prompted to
mount the file system, select Skip.
Prerequisites
Procedure
107
Red Hat Enterprise Linux 9 Managing storage devices
# mkswap /dev/VolGroup00/LogVol02
4. Regenerate mount units so that your system registers the new configuration:
# systemctl daemon-reload
# swapon -v /dev/VolGroup00/LogVol02
Verification
To test if the swap logical volume was successfully created and activated, inspect active swap
space by using the following command:
# cat /proc/swaps
total used free shared buff/cache available
Mem: 30Gi 1.2Gi 28Gi 12Mi 994Mi 28Gi
Swap: 22Gi 0B 22Gi
# free -h
total used free shared buff/cache available
Mem: 30Gi 1.2Gi 28Gi 12Mi 995Mi 28Gi
Swap: 17Gi 0B 17Gi
Prerequisites
Procedure
1. Determine the size of the new swap file in megabytes and multiply by 1024 to determine the
number of blocks. For example, the block size of a 64 MB swap file is 65536.
108
CHAPTER 16. GETTING STARTED WITH SWAP
Replace 65536 with the value equal to the required block size.
# mkswap /swapfile
5. Edit the /etc/fstab file with the following entries to enable the swap file at boot time:
The next time the system boots, it activates the new swap file.
6. Regenerate mount units so that your system registers the new /etc/fstab configuration:
# systemctl daemon-reload
# swapon /swapfile
Verification
To test if the new swap file was successfully created and activated, inspect active swap space by
using the following command:
$ cat /proc/swaps
$ free -h
Prerequisites
Procedure
# swapoff -v /dev/VolGroup00/LogVol01
109
Red Hat Enterprise Linux 9 Managing storage devices
# mkswap /dev/VolGroup00/LogVol01
# swapon -v /dev/VolGroup00/LogVol01
Verification
To test if the swap logical volume was successfully extended and activated, inspect active swap
space:
# cat /proc/swaps
Filename Type Size Used Priority
/dev/dm-1 partition 16322556 0 -2
/dev/dm-4 partition 7340028 0 -3
# free -h
total used free shared buff/cache available
Mem: 30Gi 1.2Gi 28Gi 12Mi 994Mi 28Gi
Swap: 22Gi 0B 22Gi
Procedure
# swapoff -v /dev/VolGroup00/LogVol01
# wipefs -a /dev/VolGroup00/LogVol01
# mkswap /dev/VolGroup00/LogVol01
# swapon -v /dev/VolGroup00/LogVol01
Verification
To test if the swap logical volume was successfully reduced, inspect active swap space by using
110
CHAPTER 16. GETTING STARTED WITH SWAP
To test if the swap logical volume was successfully reduced, inspect active swap space by using
the following command:
$ cat /proc/swaps
$ free -h
Procedure
# swapoff -v /dev/VolGroup00/LogVol02
# lvremove /dev/VolGroup00/LogVol02
# systemctl daemon-reload
Verification
Test if the logical volume was successfully removed, inspect active swap space by using the
following command:
$ cat /proc/swaps
$ free -h
Procedure
# swapoff -v /swapfile
3. Regenerate mount units so that your system registers the new configuration:
111
Red Hat Enterprise Linux 9 Managing storage devices
# systemctl daemon-reload
# rm /swapfile
112
CHAPTER 17. CONFIGURING FIBRE CHANNEL OVER ETHERNET
qedf
bnx2fc
fnic
If you use such a HBA, you configure the FCoE settings in the setup of the HBA. For more information,
see the documentation of the adapter.
After you configure the HBA, the exported Logical Unit Numbers (LUN) from the Storage Area Network
(SAN) are automatically available to RHEL as /dev/sd* devices. You can use these devices similar to
local storage devices.
IMPORTANT
RHEL does not support software FCoE devices that require the fcoe.ko kernel module.
After you complete this procedure, the exported LUNs from the Storage Area Network (SAN) are
automatically available to RHEL as /dev/sd* devices. You can use these devices in a similar way to local
storage devices.
Prerequisites
The SAN uses a VLAN to separate the storage traffic from normal Ethernet traffic.
The HBA is connected to the network and the link is up. For more information, see the
documentation of your HBA.
Procedure
113
Red Hat Enterprise Linux 9 Managing storage devices
# cp /etc/fcoe/cfg-ethx /etc/fcoe/cfg-enp1s0
4. Discover the FCoE VLAN on interface enp1s0, create a network device for the discovered
VLAN, and start the initiator:
# fipvlan -s -c enp1s0
Created VLAN device enp1s0.200
Starting FCoE on interface enp1s0.200
Fibre Channel Forwarders Discovered
interface | VLAN | FCF MAC
------------------------------------------
enp1s0 | 200 | 00:53:00:a7:e7:1b
5. Optional: Display details about the discovered targets, the LUNs, and the devices associated
with the LUNs:
# fcoeadm -t
Interface: enp1s0.200
Roles: FCP Target
Node Name: 0x500a0980824acd15
Port Name: 0x500a0982824acd15
Target ID: 0
MaxFrameSize: 2048 bytes
OS Device Name: rport-11:0-1
FC-ID (Port ID): 0xba00a0
State: Online
This example shows that LUN 0 from the SAN has been attached to the host as the /dev/sdb
device.
Verification
# fcoeadm -i
Description: BCM57840 NetXtreme II 10 Gigabit Ethernet
Revision: 11
Manufacturer: Broadcom Inc. and subsidiaries
114
CHAPTER 17. CONFIGURING FIBRE CHANNEL OVER ETHERNET
Additional resources
/usr/share/doc/fcoe-utils/README
115
Red Hat Enterprise Linux 9 Managing storage devices
/dev/nst0 is a non-rewinding tape device. Use non-rewinding devices for daily backups.
There are several advantages to using tape devices. They are cost efficient and stable. Tape devices are
also resilient against data corruption and are suitable for data retention.
Procedure
Additional resources
Prerequisites
1. You have installed the mt-st package. For more information, see Installing tape drive
management tool.
# mt -f /dev/st0 load
Procedure
116
CHAPTER 18. MANAGING TAPE DEVICES
# mt -f /dev/st0 status
Here:
the block number defines the tape head. By default, it is set to -1.
the block size 0 indicates that the tape device does not have a fixed block size.
the Soft error count indicates the number of encountered errors after executing the mt
status command.
the General status bits explains the stats of the tape device.
DR_OPEN indicates that the door is open and the tape device is empty. IM_REP_EN is the
immediate report mode.
This command overwrites the data on a tape device with the content of /source/directory.
# mt -f /dev/st0 status
Verification steps
117
Red Hat Enterprise Linux 9 Managing storage devices
/source/directory/DIR_COLORS
/source/directory/rsyslog.conf
[...]
Additional resources
Tape drive media detected as write protected Red Hat Knowlegebase article
How to check if tape drives are detected in the system Red Hat Knowlegebase article
Prerequisites
1. You have installed the mt-st package. For more information, see Installing tape drive
management tool.
# mt -f /dev/nst0 load
Procedure
# mt -f /dev/nst0 status
# mt -f /dev/nst0 rewind
# mt -f /dev/nst0 eod
# tar -czf /dev/nst0 /source/directory/
118
CHAPTER 18. MANAGING TAPE DEVICES
# mt -f /dev/nst0 status
Verification steps
Additional resources
Tape drive media detected as write protected Red Hat Knowlegebase article
How to check if tape drives are detected in the system Red Hat Knowlegebase article
Prerequisites
1. You have installed the mt-st package. For more information, see Installing tape drive
management tool.
2. Data is written to the tape device. Fore more information, see Writing to rewinding tape devices
or Writing to non-rewinding tape devices .
Procedure
# mt -f /dev/nst0 tell
To switch the tape head, while appending the data to the tape devices:
# mt -f /dev/nst0 eod
# mt -f /dev/nst0 bsfm 1
# mt -f /dev/nst0 fsf 1
Additional resources
119
Red Hat Enterprise Linux 9 Managing storage devices
Prerequisites
1. You have installed the mt-st package. For more information, see Installing tape drive
management tool.
2. Data is written to the tape device. For more information, see Writing to rewinding tape devices
or Writing to non-rewinding tape devices .
Procedure
# mt -f /dev/nst0 rewind
Additional resources
Prerequisites
1. You have installed the mt-st package. For more information, see Installing tape drive
management tool.
2. Data is written to the tape device. For more information, see Writing to rewinding tape devices
or Writing to non-rewinding tape devices .
Procedure
# mt -f /dev/st0 erase
120
CHAPTER 18. MANAGING TAPE DEVICES
mt -f /dev/st0 offline
Additional resources
Command Description
mt -f /dev/nst0 fsf n Switches the tape head to the forward record. Here, n
is an optional file count. If a file count is specified,
tape head skips n records.
mt -f /dev/nst0 eod Switches the tape head to the end of the data.
121
Red Hat Enterprise Linux 9 Managing storage devices
RAID supports various configurations, including levels 0, 1, 4, 5, 6, 10, and linear. RAID uses techniques
such as disk striping (RAID Level 0), disk mirroring (RAID Level 1), and disk striping with parity (RAID
Levels 4, 5 and 6) to achieve redundancy, lower latency, increased bandwidth, and maximized ability to
recover from hard disk crashes.
RAID distributes data across each device in the array by breaking it down into consistently-sized chunks,
commonly 256 KB or 512 KB, although other values are acceptable. It writes these chunks to a hard drive
in the RAID array according to the RAID level employed. While reading the data, the process is reversed,
giving the illusion that the multiple devices in the array are actually one large drive.
RAID technology is beneficial for those who manage large amounts of data. The following are the
primary reasons to deploy RAID:
It enhances speed
Firmware RAID
Firmware RAID, also known as ATARAID, is a type of software RAID where the RAID sets can be
configured using a firmware-based menu. The firmware used by this type of RAID also hooks into the
BIOS, allowing you to boot from its RAID sets. Different vendors use different on-disk metadata
formats to mark the RAID set members. The Intel Matrix RAID is an example of a firmware RAID
system.
Hardware RAID
A hardware-based array manages the RAID subsystem independently from the host. It might present
multiple devices per RAID array to the host.
Hardware RAID devices might be internal or external to the system. Internal devices commonly
consists of a specialized controller card that handles the RAID tasks transparently to the operating
system. External devices commonly connect to the system via SCSI, Fibre Channel, iSCSI, InfiniBand,
or other high speed network interconnect and present volumes such as logical units to the system.
RAID controller cards function like a SCSI controller to the operating system and handle all the actual
drive communications. You can plug the drives into the RAID controller similar to a normal SCSI
controller and then add them to the RAID controller’s configuration. The operating system will not be
able to tell the difference.
122
CHAPTER 19. MANAGING RAID
Software RAID
A software RAID implements the various RAID levels in the kernel block device code. It offers the
cheapest possible solution because expensive disk controller cards or hot-swap chassis are not
required. With hot-swap chassis, you can remove a hard drive without powering off your system.
Software RAID also works with any block storage, which are supported by the Linux kernel, such as
SATA, SCSI, and NVMe. With today’s faster CPUs, Software RAID also generally outperforms
hardware RAID, unless you use high-end storage devices.
Since the Linux kernel contains a multiple device (MD) driver, the RAID solution becomes completely
hardware independent. The performance of a software-based array depends on the server CPU
performance and load.
The following are the key features of the Linux software RAID stack:
Multithreaded design
Automatic CPU detection to take advantage of certain CPU features such as streaming
Single Instruction Multiple Data (SIMD) support.
Regular consistency checks of RAID data to ensure the health of the array.
Proactive monitoring of arrays with email alerts sent to a designated email address on
important events.
Write-intent bitmaps, which drastically increase the speed of resync events by allowing the
kernel to know precisely which portions of a disk need to be resynced instead of having to
resync the entire array after a system crash.
NOTE
The resync is a process to synchronize the data over the devices in the
existing RAID to achieve redundancy.
Resync checkpointing so that if you reboot your computer during a resync, at startup the
resync resumes where it left off and not starts all over again.
The ability to change parameters of the array after installation, which is called reshaping. For
example, you can grow a 4-disk RAID5 array to a 5-disk RAID5 array when you have a new
device to add. This grow operation is done live and does not require you to reinstall on the
new array.
Reshaping supports changing the number of devices, the RAID algorithm or size of the RAID
array type, such as RAID4, RAID5, RAID6, or RAID10.
Cluster MD, which is a storage solution for a cluster, provides the redundancy of RAID1
mirroring to the cluster. Currently, only RAID1 is supported.
123
Red Hat Enterprise Linux 9 Managing storage devices
Level 0
RAID level 0, often called striping, is a performance-oriented striped data mapping technique. This
means the data being written to the array is broken down into stripes and written across the member
disks of the array, allowing high I/O performance at low inherent cost but provides no redundancy.
RAID level 0 implementations only stripe the data across the member devices up to the size of the
smallest device in the array. This means that if you have multiple devices with slightly different sizes,
each device gets treated as though it was the same size as the smallest drive. Therefore, the
common storage capacity of a level 0 array is the total capacity of all disks. If the member disks have
a different size, then the RAID0 uses all the space of those disks using the available zones.
Level 1
RAID level 1, or mirroring, provides redundancy by writing identical data to each member disk of the
array, leaving a mirrored copy on each disk. Mirroring remains popular due to its simplicity and high
level of data availability. Level 1 operates with two or more disks, and provides very good data
reliability and improves performance for read-intensive applications but at relatively high costs.
RAID level 1 is costly because you write the same information to all of the disks in the array, which
provides data reliability, but in a much less space-efficient manner than parity based RAID levels such
as level 5. However, this space inefficiency comes with a performance benefit, which is parity-based
RAID levels that consume considerably more CPU power in order to generate the parity while RAID
level 1 simply writes the same data more than once to the multiple RAID members with very little
CPU overhead. As such, RAID level 1 can outperform the parity-based RAID levels on machines
where software RAID is employed and CPU resources on the machine are consistently taxed with
operations other than RAID activities.
The storage capacity of the level 1 array is equal to the capacity of the smallest mirrored hard disk in
a hardware RAID or the smallest mirrored partition in a software RAID. Level 1 redundancy is the
highest possible among all RAID types, with the array being able to operate with only a single disk
present.
Level 4
Level 4 uses parity concentrated on a single disk drive to protect data. Parity information is
calculated based on the content of the rest of the member disks in the array. This information can
then be used to reconstruct data when one disk in the array fails. The reconstructed data can then be
used to satisfy I/O requests to the failed disk before it is replaced and to repopulate the failed disk
after it has been replaced.
Since the dedicated parity disk represents an inherent bottleneck on all write transactions to the
RAID array, level 4 is seldom used without accompanying technologies such as write-back caching.
Or it is used in specific circumstances where the system administrator is intentionally designing the
software RAID device with this bottleneck in mind such as an array that has little to no write
transactions once the array is populated with data. RAID level 4 is so rarely used that it is not
available as an option in Anaconda. However, it could be created manually by the user if needed.
The storage capacity of hardware RAID level 4 is equal to the capacity of the smallest member
partition multiplied by the number of partitions minus one. The performance of a RAID level 4 array is
always asymmetrical, which means reads outperform writes. This is because write operations
consume extra CPU resources and main memory bandwidth when generating parity, and then also
consume extra bus bandwidth when writing the actual data to disks because you are not only writing
the data, but also the parity. Read operations need only read the data and not the parity unless the
array is in a degraded state. As a result, read operations generate less traffic to the drives and across
the buses of the computer for the same amount of data transfer under normal operating conditions.
124
CHAPTER 19. MANAGING RAID
Level 5
This is the most common type of RAID. By distributing parity across all the member disk drives of an
array, RAID level 5 eliminates the write bottleneck inherent in level 4. The only performance
bottleneck is the parity calculation process itself. Modern CPUs can calculate parity very fast.
However, if you have a large number of disks in a RAID 5 array such that the combined aggregate
data transfer speed across all devices is high enough, parity calculation can be a bottleneck.
Level 5 has asymmetrical performance, and reads substantially outperforming writes. The storage
capacity of RAID level 5 is calculated the same way as with level 4.
Level 6
This is a common level of RAID when data redundancy and preservation, and not performance, are
the paramount concerns, but where the space inefficiency of level 1 is not acceptable. Level 6 uses a
complex parity scheme to be able to recover from the loss of any two drives in the array. This
complex parity scheme creates a significantly higher CPU burden on software RAID devices and also
imposes an increased burden during write transactions. As such, level 6 is considerably more
asymmetrical in performance than levels 4 and 5.
The total capacity of a RAID level 6 array is calculated similarly to RAID level 5 and 4, except that you
must subtract two devices instead of one from the device count for the extra parity storage space.
Level 10
This RAID level attempts to combine the performance advantages of level 0 with the redundancy of
level 1. It also reduces some of the space wasted in level 1 arrays with more than two devices. With
level 10, it is possible, for example, to create a 3-drive array configured to store only two copies of
each piece of data, which then allows the overall array size to be 1.5 times the size of the smallest
devices instead of only equal to the smallest device, similar to a 3-device, level 1 array. This avoids
CPU process usage to calculate parity similar to RAID level 6, but it is less space efficient.
The creation of RAID level 10 is not supported during installation. It is possible to create one manually
after installation.
Linear RAID
Linear RAID is a grouping of drives to create a larger virtual drive.
In linear RAID, the chunks are allocated sequentially from one member drive, going to the next drive
only when the first is completely filled. This grouping provides no performance benefit, as it is unlikely
that any I/O operations split between member drives. Linear RAID also offers no redundancy and
decreases reliability. If any one member drive fails, the entire array cannot be used and data can be
lost. The capacity is the total of all member disks.
125
Red Hat Enterprise Linux 9 Managing storage devices
Manager (IMSM) sets and Storage Networking Industry Association (SNIA) Disk Drive Format (DDF).
The mdraid subsystem sets are configured and controlled through the mdadm utility.
A RAID device is created in one step and disks are added or removed as necessary. You can configure
one RAID partition for each physical disk in your system, so that the number of disks available to the
installation program determines the levels of RAID device available. For example, if your system has two
disks, you cannot create a RAID 10 device, as it requires a minimum of three separate disks.
NOTE
On 64-bit IBM Z, the storage subsystem uses RAID transparently. You do not have to
configure software RAID manually.
Prerequisites
You have selected two or more disks for installation before RAID configuration options are
visible. Depending on the RAID type you want to create, at least two disks are required.
You have created a mount point. By configuring a mount point, you can configure the RAID
device.
You have selected the Custom radio button on the Installation Destination window.
Procedure
1. From the left pane of the Manual Partitioning window, select the required partition.
2. Under the Device(s) section, click Modify. The Configure Mount Point dialog box opens.
3. Select the disks that you want to include in the RAID device and click Select.
5. Click the File System drop-down menu and select your preferred file system type.
6. Click the RAID Level drop-down menu and select your preferred level of RAID.
8. Click Done to apply the settings to return to the Installation Summary window.
Additional resources
126
CHAPTER 19. MANAGING RAID
Prerequisites
You have created two or more partitions on your system. For detailed instructions, see Creating
a partition with parted.
Procedure
1. Create a RAID of two block devices, for example /dev/sda1 and /dev/sdc1:
3. Optional: Observe the detailed information about each device in the RAID:
127
Red Hat Enterprise Linux 9 Managing storage devices
Replace xfs with the file system that you chose to format the drive with.
# mkdir /mnt/raid1
# mount /dev/md0 /mnt/raid1
If you want that RHEL mounts the md0 RAID device automatically when the system boots, add
an entry for your device to the /etc/fstab file:
Prerequisites
You have the rhel-system-roles package installed on the system from which you want to run
the playbook.
You have an inventory file detailing the systems on which you want to deploy a RAID volume
using the storage System Role.
Procedure
---
- name: Configure the storage
hosts: managed-node-01.example.com
tasks:
- name: Create a RAID on sdd, sde, sdf, and sdg
include_role:
name: rhel-system-roles.storage
vars:
storage_safe_mode: false
storage_volumes:
- name: data
type: raid
disks: [sdd, sde, sdf, sdg]
raid_level: raid0
raid_chunk_size: 32 KiB
mount_point: /mnt/data
state: present
128
CHAPTER 19. MANAGING RAID
WARNING
Additional resources
Preparing a control node and managed nodes to use RHEL System Roles
Prerequisites
Procedure
1. Extend RAID partitions. For more information, see Resizing a partition with parted .
To set a specific size, write the value of the --size parameter in kB, for example --size=524228.
3. Increase the size of file system. For example, if the volume uses XFS and is mounted to /mnt/,
enter:
# xfs_growfs /mnt/
Additional resources
129
Red Hat Enterprise Linux 9 Managing storage devices
IMPORTANT
Prerequisites
Procedure
1. Shrink the file system. For more information, see Managing file systems.
Additional resources
RAID6 RAID5
RAID10 RAID0
130
CHAPTER 19. MANAGING RAID
NOTE
Additional resources.
Prerequisites
Procedure
Verification
Additional resources
131
Red Hat Enterprise Linux 9 Managing storage devices
Prerequisites
The instructions in the following Red Hat Knowledgebase article are completed: How do I
convert my root disk to RAID1 after installation of Red Hat Enterprise Linux 7?.
Procedure
1. Copy the contents of the PowerPC Reference Platform (PReP) boot partition from /dev/sda1
to /dev/sdb1:
# dd if=/dev/sda1 of=/dev/sdb1
2. Update the prep and boot flag on the first partition on both disks:
NOTE
Executing the grub2-install /dev/sda command does not work on a PowerPC machine
and returns an error, but the system boots as expected.
NOTE
The limited Rescue Mode of the installer does not include man pages. Both the mdadm
and md man pages contain useful information for creating custom RAID arrays, and might
be needed throughout the workaround.
Procedure
2. During the initial boot up, select Rescue Mode instead of Install or Upgrade. When the system
fully boots into Rescue mode, you can see the command line terminal.
a. Create RAID partitions on the target hard drives by using the parted command.
b. Manually create raid arrays by using the mdadm command from those partitions using any
and all settings and options available.
132
CHAPTER 19. MANAGING RAID
4. Optional: After creating arrays, create file systems on the arrays as well.
5. Reboot the computer and select Install or Upgrade to install. As the Anaconda installer
searches the disks in the system, it finds the pre-existing RAID devices.
6. When asked about how to use the disks in the system, select Custom Layout and click Next. In
the device listing, the pre-existing MD RAID devices are listed.
8. Configure its mount point and optionally the type of file system it should use if you did not
create one earlier, and then click Done. Anaconda installs to this pre-existing RAID device,
preserving the custom options you selected when you created it in Rescue Mode.
Prerequisites
Procedure
1. Create the /etc/mdadm.conf configuration file for monitoring array by scanning the RAID
details:
2. Open the /etc/mdadm.conf configuration file with a text editor of your choice and add the
MAILADDR variable with the mail address for the notification. For example, add new line:
MAILADDR example@example.com
Here, example@example.com is an email address to which you want to receive the alerts from
the array monitoring.
Additional resources
In this procedure, the /dev/md0 RAID contains four disks. The /dev/sdd disk has failed and you need to
133
Red Hat Enterprise Linux 9 Managing storage devices
In this procedure, the /dev/md0 RAID contains four disks. The /dev/sdd disk has failed and you need to
replace it with the /dev/sdf disk.
Prerequisites
Procedure
# journalctl -k -f
At the end of the output is a list of disks in the /dev/md0 RAID where the disk /dev/sdd has the
faulty status:
2 8 48 - faulty /dev/sdd
134
CHAPTER 19. MANAGING RAID
WARNING
If your RAID cannot withstand another disk failure, do not remove any disk
until the new disk has the active sync status. You can monitor the progress
using the watch cat /proc/mdstat command.
The /dev/md0 RAID now includes the new disk /dev/sdf and the mdadm service will
automatically starts copying data to it from other disks.
Verification
If this command shows a list of disks in the /dev/md0 RAID where the new disk has spare
rebuilding status at the end of the output, data is still being copied to it from other disks:
After data copying is finished, the new disk has an active sync status.
Additional resources
Prerequisites
Procedure
This checks the array and the /sys/block/md0/md/sync_action file shows the sync action.
135
Red Hat Enterprise Linux 9 Managing storage devices
2. Open the /sys/block/md0/md/sync_action file with the text editor of your choice and see if
there is any message about disk synchronization failures.
This repairs the disks in the array and writes the result into the
/sys/block/md0/md/sync_action file.
# cat /sys/block/md0/md/sync_action
repair
# cat /proc/mdstat
Personalities : [raid0] [raid6] [raid5] [raid4] [raid1]
md0 : active raid1 sdg[1] dm-3[0]
511040 blocks super 1.2 [2/2] [UU]
unused devices: <none>
136
CHAPTER 20. ENCRYPTING BLOCK DEVICES USING LUKS
Red Hat Enterprise Linux uses LUKS to perform block device encryption. By default, the option to
encrypt the block device is unchecked during the installation. If you select the option to encrypt your
disk, the system prompts you for a passphrase every time you boot the computer. This passphrase
unlocks the bulk encryption key that decrypts your partition. If you want to modify the default partition
table, you can select the partitions that you want to encrypt. This is set in the partition table settings.
Ciphers
The default cipher used for LUKS is aes-xts-plain64. The default key size for LUKS is 512 bits. The
default key size for LUKS with Anaconda XTS mode is 512 bits. The following are the available ciphers:
Twofish
Serpent
LUKS encrypts entire block devices and is therefore well-suited for protecting contents of
mobile devices such as removable storage media or laptop disk drives.
The underlying contents of the encrypted block device are arbitrary, which makes it useful for
encrypting swap devices. This can also be useful with certain databases that use specially
formatted block devices for data storage.
LUKS devices contain multiple key slots, which means you can add backup keys or passphrases.
IMPORTANT
137
Red Hat Enterprise Linux 9 Managing storage devices
IMPORTANT
Disk-encryption solutions such as LUKS protect the data only when your system
is off. After the system is on and LUKS has decrypted the disk, the files on that
disk are available to anyone who have access to them.
Scenarios that require multiple users to have distinct access keys to the same
device. The LUKS1 format provides eight key slots and LUKS2 provides up to 32
key slots.
Additional resources
The LUKS2 format enables future updates of various parts without a need to modify binary structures.
Internally it uses JSON text format for metadata, provides redundancy of metadata, detects metadata
corruption, and automatically repairs from a metadata copy.
IMPORTANT
Since Red Hat Enterprise Linux 9.2, you can use the cryptsetup reencrypt command for both the LUKS
versions to encrypt the disk.
Online re-encryption
The LUKS2 format supports re-encrypting encrypted devices while the devices are in use. For example,
you do not have to unmount the file system on the device to perform the following tasks:
Conversion
In certain situations, you can convert LUKS1 to LUKS2. The conversion is not possible specifically in the
138
CHAPTER 20. ENCRYPTING BLOCK DEVICES USING LUKS
In certain situations, you can convert LUKS1 to LUKS2. The conversion is not possible specifically in the
following scenarios:
A LUKS1 device is marked as being used by a Policy-Based Decryption (PBD) Clevis solution.
The cryptsetup tool does not convert the device when some luksmeta metadata are detected.
A device is active. The device must be in an inactive state before any conversion is possible.
checksum
The default mode. It balances data protection and performance.
This mode stores individual checksums of the sectors in the re-encryption area, which the recovery
process can detect for the sectors that were re-encrypted by LUKS2. The mode requires that the
block device sector write is atomic.
journal
The safest mode but also the slowest. Since this mode journals the re-encryption area in the binary
area, the LUKS2 writes the data twice.
none
The none mode prioritizes performance and provides no data protection. It protects the data only
against safe process termination, such as the SIGTERM signal or the user pressing Ctrl+C key. Any
unexpected system failure or application failure might result in data corruption.
If a LUKS2 re-encryption process terminates unexpectedly by force, LUKS2 can perform the recovery in
one of the following ways:
Automatically
By performing any one of the following actions triggers the automatic recovery action during the
next LUKS2 device open action:
Manually
By using the cryptsetup repair /dev/sdx command on the LUKS2 device.
Additional resources
139
Red Hat Enterprise Linux 9 Managing storage devices
Prerequisites
WARNING
You might lose your data during the encryption process due to a hardware,
kernel, or human failure. Ensure that you have a reliable backup before you
start encrypting the data.
Procedure
1. Unmount all file systems on the device that you plan to encrypt, for example:
# umount /dev/mapper/vg00-lv00
2. Make free space for storing a LUKS header. Use one of the following options that suits your
scenario:
In the case of encrypting a logical volume, you can extend the logical volume without
resizing the file system. For example:
Shrink the file system on the device. You can use the resize2fs utility for the ext2, ext3, or
ext4 file systems. Note that you cannot shrink the XFS file system.
a52e2cc9-a5be-47b8-a95d-6bdf4f2d9325
140
CHAPTER 20. ENCRYPTING BLOCK DEVICES USING LUKS
b. Open /etc/crypttab in a text editor of your choice and add a device in this file:
$ vi /etc/crypttab
$ dracut -f --regenerate-all
a. Find the file system’s UUID of the active LUKS block device:
$ blkid -p /dev/mapper/lv00_encrypted
/dev/mapper/lv00-encrypted: UUID="37bc2492-d8fa-4969-9d9b-bb64d3685aa9"
BLOCK_SIZE="4096" TYPE="xfs" USAGE="filesystem"
b. Open /etc/fstab in a text editor of your choice and add a device in this file, for example:
$ vi /etc/fstab
Verification
Data segments:
141
Red Hat Enterprise Linux 9 Managing storage devices
0: crypt
offset: 33554432 [bytes]
length: (whole device)
cipher: aes-xts-plain64
[...]
Additional resources
Prerequisites
WARNING
You might lose your data during the encryption process due to a hardware,
kernel, or human failure. Ensure that you have a reliable backup before you
start encrypting the data.
Procedure
# umount /dev/nvme0n1p1
142
CHAPTER 20. ENCRYPTING BLOCK DEVICES USING LUKS
WARNING!
========
Header file does not exist, do you want to create it?
Replace /home/header with a path to the file with a detached LUKS header. The detached
LUKS header has to be accessible to unlock the encrypted device later.
Verification
1. Verify if the existing data on a block device using LUKS2 with a detached header is encrypted:
Data segments:
0: crypt
offset: 0 [bytes]
length: (whole device)
cipher: aes-xts-plain64
sector: 512 [bytes]
[...]
143
Red Hat Enterprise Linux 9 Managing storage devices
Additional resources
Prerequisites
A blank block device. You can use commands such as lsblk to find if there is no real data on that
device, for example, a file system.
Procedure
WARNING!
========
This will overwrite data on /dev/nvme0n1p1 irrevocably.
Are you sure? (Type 'yes' in capital letters): YES
Enter passphrase for /dev/nvme0n1p1:
Verify passphrase:
This unlocks the partition and maps it to a new device by using the device mapper. To not
overwrite the encrypted data, this command alerts the kernel that the device is an encrypted
device and addressed through LUKS by using the /dev/mapper/device_mapped_name path.
3. Create a file system to write encrypted data to the partition, which must be accessed through
the device mapped name:
144
CHAPTER 20. ENCRYPTING BLOCK DEVICES USING LUKS
Verification
Data segments:
0: crypt
offset: 16777216 [bytes]
length: (whole device)
cipher: aes-xts-plain64
sector: 512 [bytes]
[...]
Additional resources
Prerequisites
Access and permissions to one or more managed nodes, which are systems you want to
configure with the crypto_policies System Role.
145
Red Hat Enterprise Linux 9 Managing storage devices
Access and permissions to a control node, which is a system from which Red Hat Ansible Core
configures other systems. On the control node, the ansible-core and rhel-system-roles
packages are installed.
IMPORTANT
RHEL 8.0-8.5 provided access to a separate Ansible repository that contains Ansible
Engine 2.9 for automation based on Ansible. Ansible Engine contains command-line
utilities such as ansible, ansible-playbook, connectors such as docker and podman, and
many plugins and modules. For information about how to obtain and install Ansible
Engine, see the How to download and install Red Hat Ansible Engine Knowledgebase
article.
RHEL 8.6 and 9.0 have introduced Ansible Core (provided as the ansible-core package),
which contains the Ansible command-line utilities, commands, and a small set of built-in
Ansible plugins. RHEL provides this package through the AppStream repository, and it
has a limited scope of support. For more information, see the Scope of support for the
Ansible Core package included in the RHEL 9 and RHEL 8.6 and later AppStream
repositories Knowledgebase article.
Procedure
- hosts: all
vars:
storage_volumes:
- name: barefs
type: disk
disks:
- sdb
fs_type: xfs
fs_label: label-name
mount_point: /mnt/data
encryption: true
encryption_password: your-password
roles:
- rhel-system-roles.storage
You can also add the other encryption parameters such as encryption_key, encryption_cipher,
encryption_key_size, and encryption_luks version in the playbook.yml file.
Verification
146
CHAPTER 20. ENCRYPTING BLOCK DEVICES USING LUKS
Version: 2
Epoch: 6
Metadata area: 16384 [bytes]
Keyslots area: 33521664 [bytes]
UUID: a4c6be82-7347-4a91-a8ad-9479b72c9426
Label: (no label)
Subsystem: (no subsystem)
Flags: allow-discards
Data segments:
0: crypt
offset: 33554432 [bytes]
length: (whole device)
cipher: aes-xts-plain64
sector: 4096 [bytes]
[...]
3. View the cryptsetup parameters in the playbook.yml file, which the storage role supports:
# cat ~/playbook.yml
- hosts: all
vars:
storage_volumes:
- name: foo
type: disk
disks:
- nvme0n1
fs_type: xfs
fs_label: label-name
mount_point: /mnt/data
encryption: true
#encryption_password: passwdpasswd
encryption_key: /home/passwd_key
encryption_cipher: aes-xts-plain64
encryption_key_size: 512
encryption_luks_version: luks2
147
Red Hat Enterprise Linux 9 Managing storage devices
roles:
- rhel-system-roles.storage
Additional resources
/usr/share/ansible/roles/rhel-system-roles.storage/README.md file
148
CHAPTER 21. USING NVDIMM PERSISTENT MEMORY STORAGE
For installing Red Hat Enterprise Linux 9 on NVDIMM storage, see Installing to an NVDIMM device
instead.
NVDIMM combines the durability of storage with the low access latency and the high bandwidth of
dynamic RAM (DRAM). The following are the other advantages of using NVDIMM:
NVDIMM storage is byte-addressable, which means it can be accessed by using the CPU load
and store instructions. In addition to the read() and write() system calls, which are required for
accessing traditional block-based storage, NVDIMM also supports direct load and a store
programming model.
The performance characteristics of NVDIMM are similar to DRAM with very low access latency,
typically in the tens to hundreds of nanoseconds.
Data stored on NVDIMM is preserved when the power is off, similar to a persistent memory.
With the direct access (DAX) technology, applications to memory map storage directly are
possible without going through the system page cache. This frees up DRAM for other purposes.
Databases
The reduced storage access latency on NVDIMM improves database performance.
Rapid restart
Rapid restart is also called the warm cache effect. For example, a file server has none of the file
contents in memory after starting. As clients connect and read or write data, that data is cached in
the page cache. Eventually, the cache contains mostly hot data. After a reboot, the system must start
the process again on traditional storage.
With NVDIMM, it is possible for an application to keep the warm cache across reboots if the
application is designed properly. In this example, there would be no page cache involved: the
application would cache data directly in the persistent memory.
Fast write-cache
File servers often do not acknowledge a client write request until the data is on durable media. Using
NVDIMM as a fast write-cache, enables a file server to acknowledge the write request quickly, and
results in low latency.
149
Red Hat Enterprise Linux 9 Managing storage devices
NVDIMM devices can be grouped into interleave sets in the same way as regular dynamic RAM (DRAM).
An interleave set is similar to a RAID 0 level (stripe) configuration across multiple DIMMs. An Interleave
set is also called a region.
NVDIMM devices benefit from increased performance when they are configured into interleave
sets.
Interleaving can combine multiple smaller NVDIMM devices into a larger logical device.
NVDIMM interleave sets are configured in the system BIOS or UEFI firmware. Red Hat Enterprise Linux
creates one region device for each interleave set.
If your NVDIMM device supports labels, you can subdivide the region into namespaces.
If your NVDIMM device does not support labels, the region can only contain a single namespace.
In that case, Red Hat Enterprise Linux creates a default namespace that covers the entire
region.
sector
Presents the storage as a fast block device. This mode is useful for legacy applications that are not
modified to use NVDIMM storage, or for applications that use the full I/O stack, including Device
Mapper.
A sector device can be used in the same way as any other block device on the system. You can
create partitions or file systems on it, configure it as part of a software RAID set, or use it as the
cache device for dm-cache.
Devices in this mode are available as /dev/pmemNs. After creating the namespace, see the listed
blockdev value.
150
CHAPTER 21. USING NVDIMM PERSISTENT MEMORY STORAGE
Devices in this mode are available as /dev/daxN.M. After creating the namespace, see the listed
chardev value.
Devices in this mode are available as /dev/pmemN. After creating the namespace, see the listed
blockdev value.
IMPORTANT
The file system DAX technology is provided only as a Technology Preview, and is not
supported by Red Hat.
raw
Presents a memory disk that does not support DAX. In this mode, namespaces have several
limitations and should not be used.
Devices in this mode are available as /dev/pmemN. After creating the namespace, see the listed
blockdev value.
Procedure
Prerequisites
151
Red Hat Enterprise Linux 9 Managing storage devices
WARNING
Prerequisites
The ndctl utility is installed. For more information, see Installing ndctl .
Procedure
152
CHAPTER 21. USING NVDIMM PERSISTENT MEMORY STORAGE
The reconfigured namespace is now available under the /dev directory as the /dev/pmem1s file.
Verification
Additional resources
Prerequisites
The ndctl utility is installed. For more information, see Installing ndctl .
The NVDIMM device supports labels to create multiple namespaces in a region. You can check
this using the following command:
This indicates that it read the label of one NVDIMM device. If the value is 0, it implies that your
device does not support labels.
Procedure
1. List the pmem regions on your system that have available space. In the following example,
space is available in the region1 and region0 regions:
153
Red Hat Enterprise Linux 9 Managing storage devices
"max_available_extent":2117418876928,
"type":"pmem",
"iset_id":-9102197055295954944,
"badblock_count":1,
"persistence_domain":"memory_controller"
},
{
"dev":"region0",
"size":2156073582592,
"align":16777216,
"available_size":2143188680704,
"max_available_extent":2143188680704,
"type":"pmem",
"iset_id":736272362787276936,
"badblock_count":3,
"persistence_domain":"memory_controller"
}
]
Verification
154
CHAPTER 21. USING NVDIMM PERSISTENT MEMORY STORAGE
"persistence_domain":"memory_controller",
"namespaces":[
{
"dev":"namespace0.1",
"mode":"sector",
"size":38615912448,
"uuid":"ff5a0a16-3495-4ce8-b86b-f0e3bd9d1817",
"sector_size":4096,
"blockdev":"pmem0.1s"
}
]
}
]
}
Additional resources
For the Intel 64 and AMD64 architecture, the following fault granularities are supported:
4 KiB
2 MiB
1 GiB
open()
close()
mmap()
You can view the supported alignments of your NVDIMM device using the ndctl list --human --
capabilities command. For example, to view it for the region0 device, use the ndctl list --human --
capabilities -r region0 command.
NOTE
155
Red Hat Enterprise Linux 9 Managing storage devices
NOTE
The read() and write() system calls are not supported because the device DAX use case
is tied to the SNIA Non-Volatile Memory Programming Model.
WARNING
Prerequisites
The ndctl utility is installed. For more information, see Installing ndctl .
Procedure
[
{
"dev":"namespace1.0",
"mode":"raw",
"size":34359738368,
"uuid":"ac951312-b312-4e76-9f15-6e00c8f2e6f4"
"state":"disabled",
"numa_node":1
},
{
"dev":"namespace0.0",
"mode":"raw",
"size":38615912448,
"uuid":"ff5a0a16-3495-4ce8-b86b-f0e3bd9d1817",
"state":"disabled",
"numa_node":0
}
]
The following command reconfigures namespace0.1 for data storage that supports DAX. It
156
CHAPTER 21. USING NVDIMM PERSISTENT MEMORY STORAGE
The following command reconfigures namespace0.1 for data storage that supports DAX. It
is aligned to a 2-MiB fault granularity to ensure that the operating system faults in 2-MiB
pages at a time:
Verification
Additional resources
You can create a new device DAX namespace on an Non-Volatile Dual In-line Memory Modules
157
Red Hat Enterprise Linux 9 Managing storage devices
You can create a new device DAX namespace on an Non-Volatile Dual In-line Memory Modules
(NVDIMM) device if there is available space in the region.
Prerequisites
The ndctl utility is installed. For more information, see Installing ndctl .
The NVDIMM device supports labels to create multiple namespaces in a region. You can check
this using the following command:
This indicates that it read the label of one NVDIMM device. If the value is 0, it implies that your
device does not support labels.
Procedure
1. List the pmem regions on your system that have available space. In the following example,
space is available in the region1 and region0 regions:
The following command creates a 36-GiB device DAX namespace on region0. It is aligned to
a 2-MiB fault granularity to ensure that the operating system faults in 2-MiB pages at a time:
158
CHAPTER 21. USING NVDIMM PERSISTENT MEMORY STORAGE
Verification
159
Red Hat Enterprise Linux 9 Managing storage devices
}
]
}
Additional resources
IMPORTANT
The file system DAX technology is provided only as a Technology Preview, and is not
supported by Red Hat.
The following new -o dax options are now available, and direct access behavior can be controlled
through a file attribute if required:
-o dax=inode
This is the default option when you do not specify any dax option while mounting a file system. Using
this option, you can set an attribute flag on files to control if the dax mode can be activated. If
required, you can set this flag on individual files.
You can also set this flag on a directory and any files in that directory will be created with the same
flag. You can set this attribute flag by using the xfs_io -c 'chattr +x' directory-name command.
-o dax=never
With this option, the dax mode will not be enabled even if the dax flag is set to an inode mode. This
means that the per-inode dax attribute flag is ignored, and files set with this flag will never be direct-
access enabled.
-o dax=always
This option is equivalent to the old -o dax behavior. With this option, you can activate direct access
mode for any file on the file system, regardless of the dax attribute flag.
160
CHAPTER 21. USING NVDIMM PERSISTENT MEMORY STORAGE
WARNING
In further releases, -o dax might not be supported and if required, you can use -
o dax=always instead. In this mode, every file might be in the direct-access
mode.
On small devices, the amount of overhead is small enough to fit in DRAM with no problems.
For example, a 16-GiB namespace only requires 256 MiB for page structures. Since NVDIMM
devices are usually small and expensive, storing the page tracking data structures in DRAM is
preferable.
On NVDIMM devices that are be terabytes in size or larger, the amount of memory required
to store the page tracking data structures might exceed the amount of DRAM in the system.
One TiB of NVDIMM requires 16 GiB for page structures. As a result, storing the data
structures on the NVDIMM itself is preferable in such cases.
You can configure where per-page metadata are stored using the --map option when
configuring a namespace:
WARNING
Prerequisites
The ndctl utility is installed. For more information, see Installing ndctl .
Procedure
161
Red Hat Enterprise Linux 9 Managing storage devices
[
{
"dev":"namespace1.0",
"mode":"raw",
"size":34359738368,
"uuid":"ac951312-b312-4e76-9f15-6e00c8f2e6f4"
"state":"disabled",
"numa_node":1
},
{
"dev":"namespace0.0",
"mode":"raw",
"size":38615912448,
"uuid":"ff5a0a16-3495-4ce8-b86b-f0e3bd9d1817",
"state":"disabled",
"numa_node":0
}
]
To use namespace0.0 for a file system that supports DAX, use the following command:
Verification
162
CHAPTER 21. USING NVDIMM PERSISTENT MEMORY STORAGE
"sector_size":512,
"align":2097152,
"blockdev":"pmem0"
}
]
Additional resources
Prerequisites
The ndctl utility is installed. For more information, see Installing ndctl .
The NVDIMM device supports labels to create multiple namespaces in a region. You can check
this using the following command:
This indicates that it read the label of one NVDIMM device. If the value is 0, it implies that your
device does not support labels.
Procedure
1. List the pmem regions on your system that have available space. In the following example,
space is available in the region1 and region0 regions:
163
Red Hat Enterprise Linux 9 Managing storage devices
"badblock_count":3,
"persistence_domain":"memory_controller"
}
]
The following command creates a 36-GiB file system DAX namespace on region0:
Verification
164
CHAPTER 21. USING NVDIMM PERSISTENT MEMORY STORAGE
"blockdev":"pmem0.3"
}
]
}
]
}
Additional resources
On Red Hat Enterprise Linux 9, both the XFS and ext4 file system can be created on NVDIMM as a
Technology Preview.
Procedure
1. Optional: Create a partition on the file system DAX device. For more information, see Creating
a partition with parted.
NOTE
By default, the parted tool aligns partitions on 1 MiB boundaries. For the first
partition, specify 2 MiB as the start of the partition. If the size of the partition is a
multiple of 2 MiB, all other partitions are also aligned.
2. Create an XFS or ext4 file system on the partition or the NVDIMM device:
NOTE
The dax-capable and reflinked files can now co-exist on the file system.
However, for an individual file, dax and reflink are mutually exclusive.
For XFS, disable shared copy-on-write data extents because they are
incompatible with the dax mount option. Additionally, in order to increase the
likelihood of large page mappings, set the stripe unit and stripe width.
There is no need to mount a file system with the dax option to enable direct access mode. When
165
Red Hat Enterprise Linux 9 Managing storage devices
There is no need to mount a file system with the dax option to enable direct access mode. When
you do not specify any dax option while mounting, the file system is in the dax=inode mode. Set
the dax option on the file before direct access mode is activated.
Additional resources
IMPORTANT
Monitor NVDIMM health regularly to prevent data loss. If S.M.A.R.T. reports problems
with the health status of an NVDIMM device, replace it as described in Detecting and
replacing a broken NVDIMM device.
Prerequisites
Optional: On some systems, upload the acpi_ipmi driver to retrieve health information using
the following command:
# modprobe acpi_ipmi
Procedure
166
CHAPTER 21. USING NVDIMM PERSISTENT MEMORY STORAGE
"shutdown_state":"clean",
"shutdown_count":4
}
},
[...]
]
Additional resources
Procedure
From the previous example, you know that nmem0 is the broken NVDIMM. Therefore, find the
phys_id attribute of nmem0.
167
Red Hat Enterprise Linux 9 Managing storage devices
[
{
"dev":"nmem1",
"id":"XXXX-XX-XXXX-XXXXXXXX",
"handle":"0x120",
"phys_id":"0x1c"
},
{
"dev":"nmem0",
"id":"XXXX-XX-XXXX-XXXXXXXX",
"handle":"0x20",
"phys_id":"0x10",
"flag_failed_flush":true,
"flag_smart_event":true
}
]
# dmidecode
In the output, find the entry where the Handle identifier matches the phys_id attribute of the
broken NVDIMM. The Locator field lists the memory slot used by the broken NVDIMM.
In the following example, the nmem0 device matches the 0x0010 identifier and uses the
DIMM-XXX-YYYY memory slot:
# dmidecode
...
Handle 0x0010, DMI type 17, 40 bytes
Memory Device
Array Handle: 0x0004
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 125 GB
Form Factor: DIMM
Set: 1
Locator: DIMM-XXX-YYYY
Bank Locator: Bank0
Type: Other
Type Detail: Non-Volatile Registered (Buffered)
...
4. Back up all data in the namespaces on the NVDIMM. If you do not back up the data before
replacing the NVDIMM, the data will be lost when you remove the NVDIMM from your system.
168
CHAPTER 21. USING NVDIMM PERSISTENT MEMORY STORAGE
WARNING
In some cases, such as when the NVDIMM is completely broken, the backup
might fail.
In the following example, the nmem0 device contains the namespace0.0 and
namespace0.2 namespaces, which you need to back up:
[
{
"dev":"namespace0.2",
"mode":"sector",
"size":67042312192,
"uuid":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"raw_uuid":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"sector_size":4096,
"blockdev":"pmem0.2s",
"numa_node":0
},
{
"dev":"namespace0.0",
"mode":"sector",
"size":67042312192,
"uuid":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"raw_uuid":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"sector_size":4096,
"blockdev":"pmem0s",
"numa_node":0
}
]
Additional resources
169
Red Hat Enterprise Linux 9 Managing storage devices
Requirements
The block device underlying the file system must support physical discard operations.
Physical discard operations are supported if the value in the
/sys/block/<device>/queue/discard_max_bytes file is not zero.
Batch discard
Is triggered explicitly by the user and discards all unused blocks in the selected file systems.
Online discard
Is specified at mount time and triggers in real time without user intervention. Online discard
operations discard only blocks that are transitioning from the used to the free state.
Periodic discard
Are batch operations that are run regularly by a systemd service.
All types are supported by the XFS and ext4 file systems.
Recommendations
Red Hat recommends that you use batch or periodic discard.
Prerequisites
The block device underlying the file system supports physical discard operations.
Procedure
# fstrim mount-point
170
CHAPTER 22. DISCARDING UNUSED BLOCKS
# fstrim --all
a logical device (LVM or MD) composed of multiple devices, where any one of the device does
not support discard operations,
# fstrim /mnt/non_discard
Additional resources
Procedure
When mounting a file system manually, add the -o discard mount option:
When mounting a file system persistently, add the discard option to the mount entry in the
/etc/fstab file.
Additional resources
Procedure
171
Red Hat Enterprise Linux 9 Managing storage devices
Verification
172
CHAPTER 23. REMOVING STORAGE DEVICES
Prerequisites
Before you remove a storage device, you must ensure that you have enough free system
memory due to the increased system memory load during an I/O flush. Use the following
commands to view the current memory load and free memory of the system:
# vmstat 1 100
# free
Red Hat does not recommend removing a storage device on a system where:
Free memory is less than 5% of the total memory in more than 10 samples per 100.
You can use storage devices in multiple ways, and they can have different virtual configurations on top
of physical devices. For example, you can group multiple instances of a device into a multipath device,
make it part of a RAID, or you can make it part of an LVM group. Additionally, devices can be accessed
via a file system, or they can be accessed directly such as a “raw” device.
Use specific commands that may vary depending on what type of devices you are removing:
For software RAID, run mdadm to remove the array. For more information, see Managing RAID.
For block devices encrypted using LUKS, there are specific additional steps. The following
procedure will not work for the block devices encrypted using LUKS. For more information, see
Encrypting block devices using LUKS .
173
Red Hat Enterprise Linux 9 Managing storage devices
WARNING
Rescanning the SCSI bus or performing any other action that changes the state of
the operating system, without following the procedure documented here can cause
delays due to I/O timeouts, devices to be removed unexpectedly, or data loss.
Prerequisites
You have an existing block device stack containing the file system, the logical volume, and the
volume group.
You ensured that no other applications or services are using the device that you want to remove.
You backed up the data from the device that you want to remove.
Optional: If you want to remove a multipath device, and you are unable to access its path
devices, disable queueing of the multipath device by running the following command:
This enables the I/O of the device to fail, allowing the applications that are using the device to
shut down.
NOTE
Removing devices with their metadata one layer at a time ensures no stale signatures
remain on the disk.
Procedure
# umount /mnt/mount-point
# wipefs -a /dev/vg0/myvol
NOTE
If you have added an entry into /etc/fstab file to make a persistent association
between the file system and a mount point you should also edit /etc/fstab at this
point to remove that entry.
Continue with the following steps, depending on the type of the device you want to remove:
3. Remove the logical volume (LV) that contained the file system:
# lvremove vg0/myvol
174
CHAPTER 23. REMOVING STORAGE DEVICES
4. If there are no other logical volumes remaining in the volume group (VG), you can safely remove
the VG that contained the device:
# vgremove vg0
# pvremove /dev/sdc1
# wipefs -a /dev/sdc1
# parted /dev/sdc rm 1
NOTE
Follow the next steps only if you want to fully wipe the device.
# wipefs -a /dev/sdc
NOTE
Follow the next steps only if you want to physically remove the device.
# multipath -l
# multipath -f multipath-device
If the device is not configured as a multipath device, or if the device is configured as a multipath
device and you have previously passed I/O to the individual paths, flush any outstanding I/O to
all device paths that are used:
This is important for devices accessed directly where the umount or vgreduce commands do
not flush the I/O.
a. Remove any reference to the path-based name of the device, such as /dev/sd,
/dev/disk/by-path, or the major:minor number, in applications, scripts, or utilities on the
175
Red Hat Enterprise Linux 9 Managing storage devices
system. This ensures that different devices added in the future are not mistaken for the
current device.
Here the device-name is retrieved from the output of the multipath -l command, if the
device was previously used as a multipath device.
8. Remove the physical device from a running system. Note that the I/O to other devices does not
stop when you remove this device.
Verification
Verify that the devices you intended to remove are not displaying on the output of lsblk
command. The following is an example output:
# lsblk
Additional resources
176
CHAPTER 24. SETTING UP STRATIS FILE SYSTEMS
Stratis is a local storage management system that supports advanced storage features. The central
concept of Stratis is a storage pool. This pool is created from one or more local disks or partitions, and
file systems are created from the pool.
Thin provisioning
Tiering
Encryption
Additional resources
Stratis website
Externally, Stratis presents the following volume components in the command-line interface and the
API:
blockdev
Block devices, such as a disk or a disk partition.
pool
Composed of one or more block devices.
A pool has a fixed total size, equal to the size of the block devices.
The pool contains most Stratis layers, such as the non-volatile data cache using the dm-cache
target.
Stratis creates a /dev/stratis/my-pool/ directory for each pool. This directory contains links to
devices that represent Stratis file systems in the pool.
177
Red Hat Enterprise Linux 9 Managing storage devices
filesystem
Each pool can contain one or more file systems, which store files.
File systems are thinly provisioned and do not have a fixed total size. The actual size of a file system
grows with the data stored on it. If the size of the data approaches the virtual size of the file system,
Stratis grows the thin volume and the file system automatically.
IMPORTANT
Stratis tracks information about file systems created using Stratis that XFS is not
aware of, and changes made using XFS do not automatically create updates in Stratis.
Users must not reformat or reconfigure XFS file systems that are managed by Stratis.
NOTE
Stratis uses many Device Mapper devices, which show up in dmsetup listings and the
/proc/partitions file. Similarly, the lsblk command output reflects the internal workings
and layers of Stratis.
Supported devices
Stratis pools have been tested to work on these types of block devices:
LUKS
MD RAID
DM Multipath
iSCSI
NVMe devices
Unsupported devices
Because Stratis contains a thin-provisioning layer, Red Hat does not recommend placing a Stratis pool
on block devices that are already thinly-provisioned.
Procedure
178
CHAPTER 24. SETTING UP STRATIS FILE SYSTEMS
1. Install packages that provide the Stratis service and command-line utilities:
Prerequisites
The block devices on which you are creating a Stratis pool are not in use and are not mounted.
Each block device on which you are creating a Stratis pool is at least 1 GB.
On the IBM Z architecture, the /dev/dasd* block devices must be partitioned. Use the partition
device for creating the Stratis pool.
For information about partitioning DASD devices, see Configuring a Linux instance on IBM Z .
NOTE
Procedure
1. Erase any file system, partition table, or RAID signatures that exist on each block device that
you want to use in the Stratis pool:
where block-device is the path to the block device; for example, /dev/sdb.
2. Create the new unencrypted Stratis pool on the selected block device:
NOTE
179
Red Hat Enterprise Linux 9 Managing storage devices
When you create an encrypted Stratis pool, the kernel keyring is used as the primary encryption
mechanism. After subsequent system reboots this kernel keyring is used to unlock the encrypted Stratis
pool.
When creating an encrypted Stratis pool from one or more block devices, note the following:
Each block device is encrypted using the cryptsetup library and implements the LUKS2 format.
Each Stratis pool can either have a unique key or share the same key with other pools. These
keys are stored in the kernel keyring.
The block devices that comprise a Stratis pool must be either all encrypted or all unencrypted. It
is not possible to have both encrypted and unencrypted block devices in the same Stratis pool.
Block devices added to the data tier of an encrypted Stratis pool are automatically encrypted.
Prerequisites
Stratis v2.1.0 or later is installed. For more information, see Installing Stratis.
The block devices on which you are creating a Stratis pool are not in use and are not mounted.
The block devices on which you are creating a Stratis pool are at least 1GB in size each.
On the IBM Z architecture, the /dev/dasd* block devices must be partitioned. Use the partition
in the Stratis pool.
For information about partitioning DASD devices, see Configuring a Linux instance on IBM Z .
Procedure
1. Erase any file system, partition table, or RAID signatures that exist on each block device that
you want to use in the Stratis pool:
where block-device is the path to the block device; for example, /dev/sdb.
2. If you have not created a key set already, run the following command and follow the prompts to
create a key set to use for the encryption.
where key-description is a reference to the key that gets created in the kernel keyring.
3. Create the encrypted Stratis pool and specify the key description to use for the encryption. You
180
CHAPTER 24. SETTING UP STRATIS FILE SYSTEMS
3. Create the encrypted Stratis pool and specify the key description to use for the encryption. You
can also specify the key path using the --keyfile-path option instead of using the key-
description option.
where
key-description
References the key that exists in the kernel keyring, which you created in the previous step.
my-pool
Specifies the name of the new Stratis pool.
block-device
Specifies the path to an empty or wiped block device.
NOTE
If you enable overprovisioning, an API signal notifies you when your storage has been fully allocated. The
notification serves as a warning to the user to inform them that when all the remaining pool space fills up,
Stratis has no space left to extend to.
Prerequisites
Procedure
To set up the pool correctly, you have two possibilities:
By using the --no-overprovision option, the pool cannot allocate more logical space than
actual available physical space.
181
Red Hat Enterprise Linux 9 Managing storage devices
If set to "yes", you enable overprovisioning to the pool. This means that the sum of the
logical sizes of the Stratis filesystems, supported by the pool, can exceed the amount of
available data space.
Verification
2. Check if there is an indication of the pool overprovisioning mode flag in the stratis pool list
output. The " ~ " is a math symbol for "NOT", so ~Op means no-overprovisioning.
Additional resources
NOTE
Binding a Stratis pool to a supplementary Clevis encryption mechanism does not remove
the primary kernel keyring encryption.
Prerequisites
Stratis v2.3.0 or later is installed. For more information, see Installing Stratis.
You have created an encrypted Stratis pool, and you have the key description of the key that
was used for the encryption. For more information, see Creating an encrypted Stratis pool .
182
CHAPTER 24. SETTING UP STRATIS FILE SYSTEMS
You can connect to the Tang server. For more information, see Deploying a Tang server with
SELinux in enforcing mode
Procedure
where
my-pool
Specifies the name of the encrypted Stratis pool.
tang-server
Specifies the IP address or URL of the Tang server.
Additional resources
Prerequisites
Stratis v2.3.0 or later is installed. For more information, see Installing Stratis.
You have created an encrypted Stratis pool. For more information, see Creating an encrypted
Stratis pool.
Procedure
where
my-pool
Specifies the name of the encrypted Stratis pool.
key-description
References the key that exists in the kernel keyring, which was generated when you created
the encrypted Stratis pool.
183
Red Hat Enterprise Linux 9 Managing storage devices
After a system reboot, your encrypted Stratis pool or the block devices that comprise it might not be
visible. You can unlock the pool using the kernel keyring that was used to encrypt the pool.
Prerequisites
You have created an encrypted Stratis pool. For more information, see Creating an encrypted
Stratis pool.
Procedure
1. Re-create the key set using the same key description that was used previously:
where key-description references the key that exists in the kernel keyring, which was generated
when you created the encrypted Stratis pool.
Prerequisites
Stratis v2.3.0 or later is installed on your system. For more information, see Installing Stratis.
You have created an encrypted Stratis pool. For more information, see Creating an encrypted
Stratis pool.
Procedure
where
my-pool specifies the name of the Stratis pool you want to unbind.
Additional resources
184
CHAPTER 24. SETTING UP STRATIS FILE SYSTEMS
The stopped state is recorded in the pool’s metadata. These pools do not start on the following boot,
until the pool receives a start command.
Prerequisites
You have created either an unencrypted or an encrypted Stratis pool. See Creating an
unencrypted Stratis pool
Procedure
Use the following command to start the Stratis pool. The --unlock-method option specifies the
method of unlocking the pool if it is encrypted:
Alternatively, use the following command to stop the Stratis pool. This tears down the storage
stack but leaves all metadata intact:
Verification steps
Use the following command to list all not previously started pools. If the UUID is specified, the
command prints detailed information about the pool corresponding to the UUID:
185
Red Hat Enterprise Linux 9 Managing storage devices
Prerequisites
You have created a Stratis pool. See Creating an unencrypted Stratis pool
Procedure
where
number-and-unit
Specifies the size of a file system. The specification format must follow the standard size
specification format for input, that is B, KiB, MiB, GiB, TiB or PiB.
my-pool
Specifies the name of the Stratis pool.
my-fs
Specifies an arbitrary name for the file system.
For example:
Verification steps
List file systems within the pool to check if the Stratis filesystem is created:
Additional resources
Prerequisites
186
CHAPTER 24. SETTING UP STRATIS FILE SYSTEMS
You have created a Stratis file system. For more information, see Creating a Stratis filesystem .
Procedure
To mount the file system, use the entries that Stratis maintains in the /dev/stratis/ directory:
The file system is now mounted on the mount-point directory and ready to use.
Additional resources
Prerequisites
You have created a Stratis file system. See Creating a Stratis filesystem .
Procedure
For example:
UUID
a1f0b64a-4ebb-4d4e-9543-b1d79f600283
3. As root, edit the /etc/fstab file and add a line for the file system, identified by the UUID. Use xfs
as the file system type and add the x-systemd.requires=stratisd.service option.
For example:
187
Red Hat Enterprise Linux 9 Managing storage devices
4. Regenerate mount units so that your system registers the new configuration:
# systemctl daemon-reload
5. Try mounting the file system to verify that the configuration works:
# mount mount-point
Additional resources
Prerequisites
You have created a Stratis file system. See Creating a Stratis filesystem .
Procedure
Additional resources
188
CHAPTER 25. EXTENDING A STRATIS VOLUME WITH ADDITIONAL BLOCK DEVICES
Externally, Stratis presents the following volume components in the command-line interface and the
API:
blockdev
Block devices, such as a disk or a disk partition.
pool
Composed of one or more block devices.
A pool has a fixed total size, equal to the size of the block devices.
The pool contains most Stratis layers, such as the non-volatile data cache using the dm-cache
target.
Stratis creates a /dev/stratis/my-pool/ directory for each pool. This directory contains links to
devices that represent Stratis file systems in the pool.
filesystem
Each pool can contain one or more file systems, which store files.
File systems are thinly provisioned and do not have a fixed total size. The actual size of a file system
grows with the data stored on it. If the size of the data approaches the virtual size of the file system,
Stratis grows the thin volume and the file system automatically.
IMPORTANT
Stratis tracks information about file systems created using Stratis that XFS is not
aware of, and changes made using XFS do not automatically create updates in Stratis.
Users must not reformat or reconfigure XFS file systems that are managed by Stratis.
NOTE
Stratis uses many Device Mapper devices, which show up in dmsetup listings and the
/proc/partitions file. Similarly, the lsblk command output reflects the internal workings
and layers of Stratis.
189
Red Hat Enterprise Linux 9 Managing storage devices
Prerequisites
The block devices that you are adding to the Stratis pool are not in use and not mounted.
The block devices that you are adding to the Stratis pool are at least 1 GiB in size each.
Procedure
Additional resources
190
CHAPTER 26. MONITORING STRATIS FILE SYSTEMS
Standard Linux utilities such as df report the size of the XFS file system layer on Stratis, which is 1 TiB.
This is not useful information, because the actual storage usage of Stratis is less due to thin provisioning,
and also because Stratis automatically grows the file system when the XFS layer is close to full.
IMPORTANT
Regularly monitor the amount of data written to your Stratis file systems, which is
reported as the Total Physical Used value. Make sure it does not exceed the Total Physical
Size value.
Additional resources
Prerequisites
Procedure
To display information about all block devices used for Stratis on your system:
# stratis blockdev
# stratis pool
191
Red Hat Enterprise Linux 9 Managing storage devices
# stratis filesystem
Additional resources
192
CHAPTER 27. USING SNAPSHOTS ON STRATIS FILE SYSTEMS
A snapshot and its origin are not linked in lifetime. A snapshotted file system can live longer than
the file system it was created from.
A file system does not have to be mounted to create a snapshot from it.
Each snapshot uses around half a gigabyte of actual backing storage, which is needed for the
XFS log.
Prerequisites
You have created a Stratis file system. See Creating a Stratis filesystem .
Procedure
Additional resources
Prerequisites
193
Red Hat Enterprise Linux 9 Managing storage devices
Procedure
To access the snapshot, mount it as a regular file system from the /dev/stratis/my-pool/
directory:
Additional resources
Prerequisites
Procedure
1. Optionally, back up the current state of the file system to be able to access it later:
# umount /dev/stratis/my-pool/my-fs
# stratis filesystem destroy my-pool my-fs
3. Create a copy of the snapshot under the name of the original file system:
4. Mount the snapshot, which is now accessible with the same name as the original file system:
The content of the file system named my-fs is now identical to the snapshot my-fs-snapshot.
194
CHAPTER 27. USING SNAPSHOTS ON STRATIS FILE SYSTEMS
Additional resources
Prerequisites
Procedure
# umount /dev/stratis/my-pool/my-fs-snapshot
Additional resources
195
Red Hat Enterprise Linux 9 Managing storage devices
Externally, Stratis presents the following volume components in the command-line interface and the
API:
blockdev
Block devices, such as a disk or a disk partition.
pool
Composed of one or more block devices.
A pool has a fixed total size, equal to the size of the block devices.
The pool contains most Stratis layers, such as the non-volatile data cache using the dm-cache
target.
Stratis creates a /dev/stratis/my-pool/ directory for each pool. This directory contains links to
devices that represent Stratis file systems in the pool.
filesystem
Each pool can contain one or more file systems, which store files.
File systems are thinly provisioned and do not have a fixed total size. The actual size of a file system
grows with the data stored on it. If the size of the data approaches the virtual size of the file system,
Stratis grows the thin volume and the file system automatically.
IMPORTANT
Stratis tracks information about file systems created using Stratis that XFS is not
aware of, and changes made using XFS do not automatically create updates in Stratis.
Users must not reformat or reconfigure XFS file systems that are managed by Stratis.
NOTE
Stratis uses many Device Mapper devices, which show up in dmsetup listings and the
/proc/partitions file. Similarly, the lsblk command output reflects the internal workings
and layers of Stratis.
Prerequisites
196
CHAPTER 28. REMOVING STRATIS FILE SYSTEMS
You have created a Stratis file system. See Creating a Stratis filesystem .
Procedure
# umount /dev/stratis/my-pool/my-fs
Additional resources
Prerequisites
Procedure
# umount /dev/stratis/my-pool/my-fs-1 \
/dev/stratis/my-pool/my-fs-2 \
/dev/stratis/my-pool/my-fs-n
197
Red Hat Enterprise Linux 9 Managing storage devices
Additional resources
198