{"id":6,"date":"2018-11-18T21:36:00","date_gmt":"2018-11-18T21:36:00","guid":{"rendered":""},"modified":"2021-08-31T10:12:24","modified_gmt":"2021-08-31T09:12:24","slug":"create-loop-device-volumes-on-centos-7-from-files","status":"publish","type":"post","link":"https:\/\/www.srivittal.com\/wp\/?p=6","title":{"rendered":"Create Loop device volumes on CentOS 7 from files"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left;\">It has been a while since I wrote my previous article. The substance for this article came from the video on YouTube here:<\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=dd08qoOyTCA\">https:\/\/www.youtube.com\/watch?v=dd08qoOyTCA<\/a><\/p>\n<h4 style=\"text-align: left;\"><b>What was I trying to do:<\/b><\/h4>\n<p>As a part of production docker configuration, I was playing with devicemapper storage drivers for creating a persistent storage area for containers. Docker documentation allows you to configure both block volumes and loop-lvm volumes. loop-lvm volumes are mainly used for testing purposes and hence the research.<\/p>\n<h4 style=\"text-align: left;\">How does this work:<\/h4>\n<div>A bit of an intro to volumes in CentOS 7 Linux.<\/div>\n<div><\/div>\n<div>One or more physical Volumes are added to Logical Volume Groups and then within the Logical Volume Group, one or more Logical volumes are created.<\/div>\n<div><\/div>\n<div>In our case the situation is a bit different:<\/div>\n<div><\/div>\n<div>Remember to run all the following commands as root user<\/div>\n<div>\n<ul style=\"text-align: left;\">\n<li>We create a simple file called raid-0 using the touch command like so<\/li>\n<\/ul>\n<p><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">touch raid-0<\/span><\/p>\n<ul style=\"text-align: left;\">\n<li>Then we use the dd command to copy some portion of the root device to this file. We are creating a file that is 200 MB in size (2M * 100)<\/li>\n<\/ul>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">dd if=\/dev\/sda of=raid-0 bs=2M count=100<\/span><\/div>\n<ul style=\"text-align: left;\">\n<li>We then copy this raid-0 file 3 times to create 4 files of 200MB each<\/li>\n<\/ul>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">cp raid-0 raid-1<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">cp raid-0 raid-2<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">cp raid-0 raid-3<\/span><\/div>\n<ul style=\"text-align: left;\">\n<li>We then create 4 loop devices using the losetup command from these 4 files<\/li>\n<\/ul>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">losetup \/dev\/loop0 raid-0<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">losetup \/dev\/loop1 raid-1<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">losetup \/dev\/loop2 raid-2<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">losetup \/dev\/loop3 raid-3<\/span><\/div>\n<ul style=\"text-align: left;\">\n<li>Verify that the devices are created correctly<\/li>\n<\/ul>\n<div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">[root@centos75 ~]# losetup -a<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\/dev\/loop0: [64768]:17786836 (\/root\/raid-0)<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\/dev\/loop1: [64768]:17786805 (\/root\/raid-1)<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\/dev\/loop2: [64768]:17013266 (\/root\/raid-2)<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\/dev\/loop3: [64768]:17013268 (\/root\/raid-3)<\/span><\/div>\n<\/div>\n<ul style=\"text-align: left;\">\n<li>Create 4 physical volumes based on these loop devices<\/li>\n<\/ul>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">pvcreate \/dev\/loop{0,1,2,3}<\/span><\/div>\n<ul style=\"text-align: left;\">\n<li>Verify that the physical devices exist. Ignore the original device volume \/dev\/sda2 below and also a step below that &#8211; which adds the 4 physical volumes to the same Logical Volume Group<\/li>\n<\/ul>\n<div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">[root@centos75 ~]# pvs<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; PV&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;VG&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Fmt&nbsp; Attr PSize&nbsp; &nbsp;PFree<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; \/dev\/loop0 vg00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lvm2 a&#8211;&nbsp; 196.00m&nbsp; &nbsp; 0&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; \/dev\/loop1 vg00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lvm2 a&#8211;&nbsp; 196.00m&nbsp; &nbsp; 0&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; \/dev\/loop2 vg00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lvm2 a&#8211;&nbsp; 196.00m&nbsp; &nbsp; 0&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; \/dev\/loop3 vg00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lvm2 a&#8211;&nbsp; 196.00m&nbsp; &nbsp; 0&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; \/dev\/sda2&nbsp; centos_centos75 lvm2 a&#8211;&nbsp; &nbsp;18.00g&nbsp; &nbsp; 0&nbsp;<\/span><\/div>\n<\/div>\n<div><\/div>\n<ul style=\"text-align: left;\">\n<li>Create a volume group out of these 4 physical devices now. See the above message after the command has been executed<\/li>\n<\/ul>\n<div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">vgcreate vg00 \/dev\/loop{0,1,2,3}<\/span><\/div>\n<\/div>\n<ul style=\"text-align: left;\">\n<li>The following command will confirm the created Logical Volume Group. Ignore the root volume group starting with centos..<\/li>\n<\/ul>\n<div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">[root@centos75 ~]# vgs<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; VG&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #PV #LV #SN Attr&nbsp; &nbsp;VSize&nbsp; &nbsp;VFree<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; centos_centos75&nbsp; &nbsp;1&nbsp; &nbsp;2&nbsp; &nbsp;0 wz&#8211;n-&nbsp; 18.00g&nbsp; &nbsp; 0&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; vg00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4&nbsp; &nbsp;3&nbsp; &nbsp;0 wz&#8211;n- 784.00m&nbsp; &nbsp; 0&nbsp;<\/span><\/div>\n<\/div>\n<ul style=\"text-align: left;\">\n<li>Issuing a pvscan command will also show the full arrangement<\/li>\n<\/ul>\n<div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">[root@centos75 ~]# pvscan<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; PV \/dev\/loop0&nbsp; &nbsp;VG vg00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lvm2 [196.00 MiB \/ 0&nbsp; &nbsp; free]<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; PV \/dev\/loop1&nbsp; &nbsp;VG vg00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lvm2 [196.00 MiB \/ 0&nbsp; &nbsp; free]<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; PV \/dev\/loop2&nbsp; &nbsp;VG vg00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lvm2 [196.00 MiB \/ 0&nbsp; &nbsp; free]<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; PV \/dev\/loop3&nbsp; &nbsp;VG vg00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lvm2 [196.00 MiB \/ 0&nbsp; &nbsp; free]<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; PV \/dev\/sda2&nbsp; &nbsp; VG centos_centos75&nbsp; &nbsp;lvm2 [18.00 GiB \/ 0&nbsp; &nbsp; free]<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; Total: 5 [<18 .77=\"\" 0=\"\" 5=\"\" font=\"\" gib=\"\" in=\"\" nbsp=\"\" no=\"\" use:=\"\" vg:=\"\"><\/18><\/span><\/div>\n<\/div>\n<ul style=\"text-align: left;\">\n<li>Issue the following commands to create 3 different logical volumes within the same volume group to use the entire size of the volume group. <b>Please note: <\/b>The maximum size that can be used by a volume group will be slightly less due to the amount of space taken for storing metadata about these volumes&nbsp;<\/li>\n<\/ul>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">lvcreate -L 300M -n lv00 vg00<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">lvcreate -L 150M -n lv01 vg00<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">lvcreate -L 332M -n lv02 vg00<\/span><\/div>\n<ul style=\"text-align: left;\">\n<li>Issuing an lsblk command shows the entire arrangement<\/li>\n<\/ul>\n<div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">[root@centos75 ~]# lsblk<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">NAME&nbsp; &nbsp; &nbsp; &nbsp; MAJ:MIN RM&nbsp; SIZE RO TYPE MOUNTPOINT<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">sda&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8:0&nbsp; &nbsp; 0&nbsp; &nbsp;20G&nbsp; 0 disk&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\u251c\u2500sda1&nbsp; &nbsp; &nbsp; &nbsp; 8:1&nbsp; &nbsp; 0&nbsp; 1.9G&nbsp; 0 part \/boot<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\u2514\u2500sda2&nbsp; &nbsp; &nbsp; &nbsp; 8:2&nbsp; &nbsp; 0&nbsp; &nbsp;18G&nbsp; 0 part&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; \u251c\u2500centos_centos75-root<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 253:0&nbsp; &nbsp; 0&nbsp; &nbsp;16G&nbsp; 0 lvm&nbsp; \/<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; \u2514\u2500centos_centos75-swap<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 253:1&nbsp; &nbsp; 0&nbsp; &nbsp; 2G&nbsp; 0 lvm&nbsp; [SWAP]<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">sdb&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8:16&nbsp; &nbsp;0&nbsp; &nbsp; 8G&nbsp; 0 disk&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">sr0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 11:0&nbsp; &nbsp; 1 55.3M&nbsp; 0 rom&nbsp; \/run\/media\/user\/VBox_GAs_5.2.<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">loop0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7:0&nbsp; &nbsp; 0&nbsp; 200M&nbsp; 0 loop&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\u2514\u2500vg00-lv00 253:2&nbsp; &nbsp; 0&nbsp; 300M&nbsp; 0 lvm&nbsp;&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">loop1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7:1&nbsp; &nbsp; 0&nbsp; 200M&nbsp; 0 loop&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\u251c\u2500vg00-lv00 253:2&nbsp; &nbsp; 0&nbsp; 300M&nbsp; 0 lvm&nbsp;&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\u2514\u2500vg00-lv02 253:4&nbsp; &nbsp; 0&nbsp; 332M&nbsp; 0 lvm&nbsp;&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">loop2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7:2&nbsp; &nbsp; 0&nbsp; 200M&nbsp; 0 loop&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\u251c\u2500vg00-lv01 253:3&nbsp; &nbsp; 0&nbsp; 152M&nbsp; 0 lvm&nbsp;&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\u2514\u2500vg00-lv02 253:4&nbsp; &nbsp; 0&nbsp; 332M&nbsp; 0 lvm&nbsp;&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">loop3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7:3&nbsp; &nbsp; 0&nbsp; 200M&nbsp; 0 loop&nbsp;<\/span><\/div>\n<div><span style=\"font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace;\">\u2514\u2500vg00-lv02 253:4&nbsp; &nbsp; 0&nbsp; 332M&nbsp; 0 lvm&nbsp;&nbsp;<\/span><\/div>\n<\/div>\n<ul style=\"text-align: left;\">\n<li>As can be seen above, we have created 4 physical volumes called loop0, 1, 2 and 3. We have added all the 4 physical volumes to a single Logical volume group called vg00. Within the volume group called vg00, we have created 3 logical volumes lv00, lv01 and lv02 with 300M, 150M and 332M sizes respectively. <b>Please note:&nbsp;<\/b>&nbsp;Logical volume lv00 spans physical volumes loop0 and loop1, Logical volume lv01 is contained within physical volume loop2 and logical volume lv02 spans physical volumes loop1, loop2 and loop3 &#8211; nice!<\/li>\n<li>Issue the following command to see the entire arrangement<\/li>\n<\/ul>\n<div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">[root@centos75 ~]# lvmdiskscan<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/loop0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; &nbsp; &nbsp;200.00 MiB] LVM physical volume<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/centos_centos75\/root [&nbsp; &nbsp; &nbsp; 16.00 GiB]&nbsp;<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/loop1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; &nbsp; &nbsp;200.00 MiB] LVM physical volume<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/sda1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[&nbsp; &nbsp; &nbsp; &nbsp;1.86 GiB]&nbsp;<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/centos_centos75\/swap [&nbsp; &nbsp; &nbsp; &nbsp;2.00 GiB]&nbsp;<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/loop2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; &nbsp; &nbsp;200.00 MiB] LVM physical volume<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/sda2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[&nbsp; &nbsp; &nbsp; 18.00 GiB] LVM physical volume<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/vg00\/lv00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; &nbsp; &nbsp;300.00 MiB]&nbsp;<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/loop3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; &nbsp; &nbsp;200.00 MiB] LVM physical volume<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/vg00\/lv01&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; &nbsp; &nbsp;152.00 MiB]&nbsp;<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/vg00\/lv02&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; &nbsp; &nbsp;332.00 MiB]&nbsp;<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; \/dev\/sdb&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; &nbsp; &nbsp; &nbsp;8.00 GiB]&nbsp;<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; 3 disks<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; 4 partitions<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; 0 LVM physical volume whole disks<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; 5 LVM physical volumes<\/span><\/div>\n<\/div>\n<ul style=\"text-align: left;\">\n<li>To format them using the xfs filesystem, issue the following commands<\/li>\n<\/ul>\n<div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">[root@centos75 ~]# mkfs.xfs \/dev\/vg00\/lv00<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">meta-data=\/dev\/vg00\/lv00&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;isize=512&nbsp; &nbsp; agcount=4, agsize=19200 blks<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sectsz=512&nbsp; &nbsp;attr=2, projid32bit=1<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;crc=1&nbsp; &nbsp; &nbsp; &nbsp; finobt=0, sparse=0<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">data&nbsp; &nbsp; &nbsp;=&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bsize=4096&nbsp; &nbsp;blocks=76800, imaxpct=25<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sunit=0&nbsp; &nbsp; &nbsp; swidth=0 blks<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">naming&nbsp; &nbsp;=version 2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bsize=4096&nbsp; &nbsp;ascii-ci=0 ftype=1<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">log&nbsp; &nbsp; &nbsp; =internal log&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bsize=4096&nbsp; &nbsp;blocks=855, version=2<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sectsz=512&nbsp; &nbsp;sunit=0 blks, lazy-count=1<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">realtime =none&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;extsz=4096&nbsp; &nbsp;blocks=0, rtextents=0<\/span><\/div>\n<\/div>\n<div><\/div>\n<ul style=\"text-align: left;\">\n<li>Repeat the same command for the remaining 2 logical volumes<\/li>\n<\/ul>\n<div><span style=\"font-family: &quot;Courier New&quot;, Courier, monospace;\">mkfs.xfs \/dev\/vg00\/lv01<\/span><\/div>\n<div><span style=\"font-family: &quot;Courier New&quot;, Courier, monospace;\">mkfs.xfs \/dev\/vg00\/lv02<\/span><\/div>\n<ul style=\"text-align: left;\">\n<li>If you want to mount these volumes into some branch do the following<\/li>\n<\/ul>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">mkdir \/lvm<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">mkdir \/lvm\/disk1<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">mkdir \/lvm\/disk2<\/span><\/div>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">mkdir \/lvm\/disk3<\/span><\/div>\n<ul style=\"text-align: left;\">\n<li>Mount the volumes now<\/li>\n<\/ul>\n<div><span style=\"font-family: Courier New, Courier, monospace;\">mount \/dev\/vg00\/lv00 \/lvm\/disk1<\/span><br \/><span style=\"font-family: Courier New, Courier, monospace;\">mount \/dev\/vg00\/lv01 \/lvm\/disk2<\/span><br \/><span style=\"font-family: Courier New, Courier, monospace;\">mount \/dev\/vg00\/lv02 \/lvm\/disk3<\/span><\/p>\n<p>Now &#8211; how I am going to map this to devicemapper will be updated below shortly &#8230; Have to save this page before I lose power ..&nbsp;<\/p><\/div>\n<div><\/div>\n<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>It has been a while since I wrote my previous article. The substance for this article came from the video on YouTube here: https:\/\/www.youtube.com\/watch?v=dd08qoOyTCA What was I trying to do: As a part of production docker configuration, I was playing with devicemapper storage drivers for creating a persistent storage area for containers. Docker documentation allows &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4,6,2,5],"tags":[],"class_list":["post-6","post","type-post","status-publish","format-standard","hentry","category-centos","category-docker","category-lvm","category-redhat-linux","category-storage","entry entry-center"],"_links":{"self":[{"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6"}],"version-history":[{"count":1,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/6\/revisions"}],"predecessor-version":[{"id":53,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/6\/revisions\/53"}],"wp:attachment":[{"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.srivittal.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}