Skip to main content

Logical Volume Manager (LVM) of MultiPath Block Storage

Logical Volume Manager (LVM) of MultiPath Block Storage

01.00. Attached Block Storage Device:

01.01. Check the attached block storage device on the host.

lsblk

If we can see the mpathX, where X = a, b, c etc. our block storage device provides by multipath channel. In that case we also check by- 'multipath -l' or 'multipath -ll' command.

01.02. Now check the mpathX block storage device and its associated representator disk.

sdb             8:16   0  600G  0 disk  
└─mpatha      253:5    0  600G  0 mpath 
sdc             8:32   0  600G  0 disk  
└─mpathb      253:6    0  600G  0 mpath 
sdd             8:48   0  600G  0 disk  
└─mpathc      253:7    0  600G  0 mpath 
sde             8:64   0    1T  0 disk  
└─mpathd      253:8    0    1T  0 mpath 
sdf             8:80   0  400G  0 disk  
└─mpathe      253:10   0  400G  0 mpath 
sdg             8:96   0    1T  0 disk  
└─mpathf      253:12   0    1T  0 mpath 
sdh             8:112  0    1T  0 disk  
└─mpathd      253:8    0    1T  0 mpath 
sdi             8:128  0  400G  0 disk  
└─mpathe      253:10   0  400G  0 mpath 
sdj             8:144  0    1T  0 disk  
└─mpathf      253:12   0    1T  0 mpath 
sdk             8:160  0  600G  0 disk  
└─mpatha      253:5    0  600G  0 mpath 
sdl             8:176  0  600G  0 disk  
└─mpathb      253:6    0  600G  0 mpath 
sdm             8:192  0  600G  0 disk  
└─mpathc      253:7    0  600G  0 mpath 

In that case, mpatha associated to sdb.

So, in the views of multipath our total diak and size will be.

fdisk /dev/mapper/mpatha size=600G
fdisk /dev/mapper/mpathb size=600G
fdisk /dev/mapper/mpathc size=600G
fdisk /dev/mapper/mpathd size=1.0T
fdisk /dev/mapper/mpathe size=400G
fdisk /dev/mapper/mpathf size=1.0T

02.00. Format the disk.

02.01. In that case, the attached block storage device is connected through multipath, so we use 'fdisk /dev/mapper/mpathX' command to format the disk.

fdisk /dev/mapper/mpatha -> p -> n -> Three Enter -> [Y] -> p -> t -> 8e -> Enter -> p -> w
fdisk /dev/mapper/mpathb -> p -> n -> Three Enter -> [Y] -> p -> t -> 8e -> Enter -> p -> w
fdisk /dev/mapper/mpathc -> p -> n -> Three Enter -> [Y] -> p -> t -> 8e -> Enter -> p -> w
fdisk /dev/mapper/mpathd -> p -> n -> Three Enter -> [Y] -> p -> t -> 8e -> Enter -> p -> w
fdisk /dev/mapper/mpathe -> p -> n -> Three Enter -> [Y] -> p -> t -> 8e -> Enter -> p -> w
fdisk /dev/mapper/mpathf -> p -> n -> Three Enter -> [Y] -> p -> t -> 8e -> Enter -> p -> w

In that workflow, we create a primary Linux LVM partition;

/dev/mapper/mpatha-part1       4096 1258291199 1258287104  600G 8e Linux LVM
/dev/mapper/mpathb-part1       4096 1258291199 1258287104  600G 8e Linux LVM
/dev/mapper/mpathc-part1       4096 1258291199 1258287104  600G 8e Linux LVM
/dev/mapper/mpathd-part1       4096 2147483647 2147479552 1024G 8e Linux LVM
/dev/mapper/mpathe-part1       4096 838860799 838856704    400G 8e Linux LVM
/dev/mapper/mpathf-part1       4096 2147483647 2147479552 1024G 8e Linux LVM

02.02. Enter the below command to commit all changes on run time.

partprobe

02.03. Check the formated disk.
blkid

/dev/mapper/mpatha: PTUUID="4302be30" PTTYPE="dos"
/dev/mapper/mpathb: PTUUID="a84320d1" PTTYPE="dos"
/dev/mapper/mpathc: PTUUID="b2e72e21" PTTYPE="dos"
/dev/mapper/mpathd: PTUUID="aacb7071" PTTYPE="dos"
/dev/mapper/mpathe: PTUUID="f743f2b8" PTTYPE="dos"
/dev/mapper/mpathf: PTUUID="63ba010e" PTTYPE="dos"
/dev/mapper/mpatha1: PARTUUID="4302be30-01"
/dev/mapper/mpathb1: PARTUUID="a84320d1-01"
/dev/mapper/mpathc1: PARTUUID="b2e72e21-01"
/dev/mapper/mpathd1: PARTUUID="aacb7071-01"
/dev/mapper/mpathe1: PARTUUID="f743f2b8-01"
/dev/mapper/mpathf1: PARTUUID="63ba010e-01"

Here, '/dev/mapper/mpatha1' is the formated partition of the block storage '/dev/mapper/mpatha'.

03.00. Create Physical Volume:

pvcreate [/partitin/of_the/disk]

Create physical volume using the above patrition.

pvcreate /dev/mapper/mpatha1
  Physical volume "/dev/mapper/mpatha1" successfully created.
pvcreate /dev/mapper/mpathb1
  Physical volume "/dev/mapper/mpathb1" successfully created.
pvcreate /dev/mapper/mpathc1
  Physical volume "/dev/mapper/mpathc1" successfully created.
pvcreate /dev/mapper/mpathd1
  Physical volume "/dev/mapper/mpathd1" successfully created.
pvcreate /dev/mapper/mpathe1
  Physical volume "/dev/mapper/mpathe1" successfully created.
pvcreate /dev/mapper/mpathf1
  Physical volume "/dev/mapper/mpathf1" successfully created.

04.00. Create Volume Group:

vgcreate [vg_name] [physical_volume_path]

vgcreate vg_u01 /dev/mapper/mpatha1
  Volume group "vg_u01" successfully created


05.00. Extend Volume Group:

We want to make a single mount point. So, we increase Volume group "vg_u01" by all our remaining Physical Volume.

vgextend [vg_name] [physical_volume_path]

vgextend vg_u01 /dev/mapper/mpathb1
  Volume group "vg_u01" successfully extended
vgextend vg_u01 /dev/mapper/mpathc1
  Volume group "vg_u01" successfully extended
vgextend vg_u01 /dev/mapper/mpathd1
  Volume group "vg_u01" successfully extended
vgextend vg_u01 /dev/mapper/mpathe1
  Volume group "vg_u01" successfully extended
vgextend vg_u01 /dev/mapper/mpathf1
  Volume group "vg_u01" successfully extended

06.00. Create Logical Volume:

lvcreate -l 100%VG -n [lv_name] [vg_name]

lvcreate -l 100%VG -n lv_u01 vg_u01
WARNING: xfs signature detected on /dev/vg_u01/lv_u01 at offset 0. Wipe it? [y/n]: y
  Wiping xfs signature on /dev/vg_u01/lv_u01.
  Logical volume "lv_u01" created.

07.00. Create File System:

We want to create xfs file system.

mkfs.xfs /dev/vg_name/lvname

mkfs.xfs /dev/vg_u01/lv_u01
meta-data=/dev/vg_u01/lv_u01     isize=512    agcount=32, agsize=34799616 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=0 inobtcount=0
data     =                       bsize=4096   blocks=1113581568, imaxpct=5
         =                       sunit=512    swidth=512 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=521728, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
Discarding blocks...Done.

08.00. Check the UUID:

blkid

/dev/mapper/vg_u01-lv_u01: UUID="e99622bc-aa32-4a88-a4b5-70a17668d0db" BLOCK_SIZE="4096" TYPE="xfs"

09.00. Mount to a Directory:

09.01. Create a directory.
mkdir /u01

09.02. Append the below line to '/etc/fstab' file.

tee -a /etc/fstab >/dev/null <<'EOF'
UUID=e99622bc-aa32-4a88-a4b5-70a17668d0db    /u01    xfs    defaults,_netdev    0    0
EOF

09.03. mount file system to directory.

mount -a

and check the direcroty size.

df -h

/dev/mapper/vg_u01-lv_u01  4.2T   30G  4.2T   1% /u01


10.00. Done for today!

Comments

Popular posts from this blog

Upgrading Issue for RHEL 7 to 8 With Leapp

Overview The Leapp utility is a framework for updating and upgrading operating systems as well as applications. The operations of this utility consist of two phases 1. the preupgrade Phase – that chack the upgrade possibilities and 2. the actual upgrade phase – that map packages between previous and current versions of the software packages. Issue – 01: After running ‘ sudo leapp preupgrade ‘ sometimes you find the below issue in ‘ /var/log/leapp/leapp-report.txt ‘. Detail: Risk Factor: high (inhibitor) Title: Leapp detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed. Summary: Support for the following RHEL 7 device drivers has been removed in RHEL 8: – pata_acpi Key: f08a07da902958defa4f5c2699fae9ec2eb67c5b Remediation: 1. Disable detected kernel drivers in order to proceed with the upgrade process using the rmmod or modprobe -r . rmmod – Simple program to remove a module from the Linux Kernel modprobe – Add and remove modules from the Linux Ke...

Upgrading Oracle Linux 6 to 7

Overview It is possible to upgrade an Oracle Linux 6 system to Oracle Linux 7.6 under the following conditions: The system meets the minimum installation requirements for Oracle Linux 7 as described in Chapter 1, System Requirements and Limits. The Oracle Linux 6 system has been completely updated from the ol6_x86_64_latest channel or ol6_latest repository. UEK R3 or UEK R4 has been installed on the system to be upgraded and is the default boot kernel. Upgrading from UEK R2 is not supported. Note that the system is upgraded to use the UEK R5 release provided with Oracle Linux 7.6. Upgrading is supported only for systems that are installed with the Minimal Install base environment. If additional packages are installed from an alternative repository or channel, upgrade might fail or the resulting upgrade might not function as expected. reference: https://docs.oracle.com/en/operating-systems/oracle-linux/7/relnotes7.6/ol7-install.html#ol7-upgrade-ol6 Verifying the system before Upgrade: #...

Install Oracle Database 12c Release 2 On Red Hat 8

Overview According to Oracle, Oracle Database 12c is ‘the first database designed for the cloud’; the suffix ‘c’ stands for the cloud. There are many new features in this release such as multitenant architecture, pluggable database, in-memory, etc. The multitenant architecture is designed to simplify consolidation without requiring any changes to the applications. The rapid provisioning and portability capabilities are enhanced by the pluggable databases. Another new feature is in-memory makes it the first Oracle database to offer real-time analytics. This article describes the installation of Oracle Database 12c release 2 (12.2.0.1.0) 64-bit on Red Hat 8 64-bit. Lab Environment Server Machine Work Station or Client Machine OS Release Red Hat Enterprise Linux release 8.4 (Ootpa) Red Hat Enterprise Linux release 8.4 (Ootpa) Kernel 4.18.0-305.3.1.el8_4.x86_64 4.18.0-305.7.1.el8_4.x86_64 Release Oracle Database 12.1.0.2.0 Oracle SQL Developer Version 19.2.1.247 IP Address 192.168.201.116 ...