0% found this document useful (0 votes)
41 views

Eninam - Learning - Chapter 04 Storage

The document discusses storage concepts in Red Hat Enterprise Linux including disk devices like /dev/sda, disk partitions, filesystems, volume management, and storage utilities. It covers topics such as creating partitions with fdisk, formatting partitions to create volumes, mounting volumes, labeling volumes, cloning disks with dd, checking disks with fsck, and configuring automatic mounts in /etc/fstab. The document provides examples of common commands used to manage disks, partitions, volumes and storage in Linux systems.

Uploaded by

Eninam Bagnabana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Eninam - Learning - Chapter 04 Storage

The document discusses storage concepts in Red Hat Enterprise Linux including disk devices like /dev/sda, disk partitions, filesystems, volume management, and storage utilities. It covers topics such as creating partitions with fdisk, formatting partitions to create volumes, mounting volumes, labeling volumes, cloning disks with dd, checking disks with fsck, and configuring automatic mounts in /etc/fstab. The document provides examples of common commands used to manage disks, partitions, volumes and storage in Linux systems.

Uploaded by

Eninam Bagnabana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

28/07/2022 18:03 Eninam - Learning

Thursday July 28, 2022


Red Hat Enterprise Linux
Email: [email protected]
Eninam BAGNABANA Phone: (+228) 91 98 48 07
Home Login Courses .... .... Chapters Exercises ...
... ... ... ....

Chapter 04: Storage

Disks
/dev/sda A hard disk that uses the SCSI driver. Used for SCSI and SATA disk
devices. Common on physical
servers but also in VMware virtual machines.

/dev/hda The (legacy) IDE disk device type. You will seldom see this device type on
modern computers.

/dev/vda A disk in a KVM virtual machine that uses the virtio disk driver. This is the
common disk device type
for KVM virtual machines.

/dev/xvda A disk in a Xen virtual machine that uses the Xen virtual disk driver. You
see this when installing
RHEL as a virtual machine in Xen. RHEL 7
cannot be used as a Xen hypervisor, but you might see RHEL 7
virtual
machines on top of the Xen hypervisor using these disk types.

/dev/nvme

www.learning.bg/DOC/REDHAT/index.php?chap=01/04 1/8
28/07/2022 18:03 Eninam - Learning

As you can see, all disk device names end with the letter a. That is
because it is the first disk that was found in
your server. The second SCSI disk, for
instance, would have the name /dev/sdb. If many disks are installed in
a server, you
can have up to /dev/sdz and even beyond. After /dev/sdz, the kernel continues creating
devices
with names like /dev/sdaa and /dev/sdab.

Partitions

Partitions Creation

1. Open disk with fdisk Utility


2. n command for new partition
3. Choose the type of partition
4. Choose The partition number
5. Define first sector
6. Define Last Sector
7. w command to save configuration

Example

www.learning.bg/DOC/REDHAT/index.php?chap=01/04 2/8
28/07/2022 18:03 Eninam - Learning

Commands
www.learning.bg/DOC/REDHAT/index.php?chap=01/04 3/8
28/07/2022 18:03 Eninam - Learning

[root@redhat ~]# lsblk list disks details

[root@redhat ~]# lsblk -f list disks details including filesystems

[root@redhat ~]# df show mounted partitions usage

[root@redhat ~]# df -h Human View of df Commmand

[root@redhat ~]# du show disk usage of directories (du /root)

[root@redhat ~]# du -h Human view

[root@redhat ~]# du -h /home/user1 Example

[root@redhat ~]# blkid The blkid command gives an overview of existing partitions with a file system on them
and the UUID of the filesystem, as well as the file system used to format the partition.

[root@redhat ~]# blkid partition

Mount an image on a device

[root@redhat ~]# dd if=image.iso of=special_file

[root@redhat ~]# dd if=image.img of=special_file

Removable Storage Devices

/run/media/user/label

www.learning.bg/DOC/REDHAT/index.php?chap=01/04 4/8
28/07/2022 18:03 Eninam - Learning

Clone Device

[root@lab ~]# cat /dev/sda > /dev/sdb!

[root@lab ~]# dd if=/dev/sda of=/dev/sdb more efficient

gdisk used for operating on GPT Partitions

[root@lab ~]# gdisk /dev/disk Operate on disk


[root@lab ~]# gdisk /dev/partition Operate on partition

Volumes
Volume is a disk partition formated with a filesystem .
Before using a disk partition to store files, we must :

1. format it (filesystem)
2. mount it in a directory

Format Partition

Syntax

[root@lab ~]# mkfs.filesystem –b blocksize partition format a partition [+]

exple: [root@lab ~]# mkfs.ext2 –b 2048 /dev/sda3

www.learning.bg/DOC/REDHAT/index.php?chap=01/04 5/8
28/07/2022 18:03 Eninam - Learning

Mount a Volume

[root@redhat ~]# mount show mounted devices

[root@redhat ~]# mount specialfile mountdirectory

[root@redhat ~]# mount –o loop ISOfile mountdirectory

[root@redhat ~]# umount mountdirectory

Volume Settings

UUID

LABEL

[root@redhat ~]# e2label partition label : Make label for an EXT Volume

[root@redhat ~]# xfs_admin -L label partition-file : Make label for an XFS Volume

www.learning.bg/DOC/REDHAT/index.php?chap=01/04 6/8
28/07/2022 18:03 Eninam - Learning

Volumes Automounting

We need to configure /etc/fstab file to automount a Volume (Automatically mount when System boots)

Check Disk Partition

[root@redhat ~]# fsck specialfile brief check of disk

[root@redhat ~]# fsck /dev/sdg1 brief check of disk

[root@redhat ~]# xfs_repair partition brief check of xfs partition

[root@redhat ~]# xfs_repair /dev/sdg1 brief check of xfs partition

Files

/mnt/ : System Default mountpoint directory

Disk Utilities

fdisk
gdisk
parted
patprobe

Files

www.learning.bg/DOC/REDHAT/index.php?chap=01/04 7/8
28/07/2022 18:03 Eninam - Learning

/etc/fstab Automatic mount points


[+]

Eninam Learning 2022

www.learning.bg/DOC/REDHAT/index.php?chap=01/04 8/8

You might also like