-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlvm-linux-draw.drawio
133 lines (133 loc) · 14.5 KB
/
lvm-linux-draw.drawio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<mxfile modified="2019-12-23T14:42:39.771Z" host="www.draw.io" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" etag="khNrmhCPlLYbzAVmwbnB" version="12.4.3" type="github" pages="1">
<diagram id="20c7962d-87de-d07c-a7db-288fee1c8ec6" name="Page-1">
<mxGraphModel dx="2051" dy="1038" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" background="#ffffff" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="3" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="20" y="380" width="240" height="60" as="geometry"/>
</mxCell>
<mxCell id="4" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="20" y="440" width="240" height="60" as="geometry"/>
</mxCell>
<mxCell id="5" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="20" y="500" width="240" height="60" as="geometry"/>
</mxCell>
<mxCell id="6" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="20" y="560" width="240" height="60" as="geometry"/>
</mxCell>
<mxCell id="7" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="20" y="620" width="240" height="60" as="geometry"/>
</mxCell>
<mxCell id="8" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="20" y="680" width="240" height="60" as="geometry"/>
</mxCell>
<mxCell id="9" value="<font style="font-size: 25px">Physical Storage</font>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="40" y="690" width="200" height="40" as="geometry"/>
</mxCell>
<mxCell id="10" value="<font style="font-size: 25px">PhysicalVolume</font>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="40" y="630" width="200" height="40" as="geometry"/>
</mxCell>
<mxCell id="11" value="<font style="font-size: 25px">Volume Group</font>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="40" y="570" width="200" height="40" as="geometry"/>
</mxCell>
<mxCell id="12" value="<font style="font-size: 25px">LogicalVolumes</font>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="40" y="510" width="200" height="40" as="geometry"/>
</mxCell>
<mxCell id="13" value="<font style="font-size: 25px">MaKeFileSystem</font>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="40" y="450" width="200" height="40" as="geometry"/>
</mxCell>
<mxCell id="14" value="<font style="font-size: 25px">Mounting</font>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="40" y="390" width="200" height="40" as="geometry"/>
</mxCell>
<mxCell id="19" value="<h1><font style="font-size: 18px">$</font> <font style="font-size: 18px">mount /dev/vgname/lvname&nbsp; /mnt/foo</font></h1><p>$ mount /dev/xvdf1/new-vg/lv1 /srv/application<br></p><p>$ mount -a (for updating the mount entry) for fstab entries in case MBR partioning</p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
<mxGeometry x="340" y="270" width="460" height="100" as="geometry"/>
</mxCell>
<mxCell id="20" value="<h1><font style="font-size: 18px">Storage Device (/dev/xvdf)</font></h1><div>$ gdisk /dev/xvdf (for GPT partioning (Lvm))</div><div><br></div>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
<mxGeometry x="330" y="810" width="460" height="110" as="geometry"/>
</mxCell>
<mxCell id="21" value="<p style="line-height: 110%"></p><h1><font style="font-size: 18px">$ pvcreate /dev/xvdf1 /dev/xvdg1</font></h1><div>We dont need always to make the PV it's optonal, we can also create vg on top of the sd coz its also pv.<br></div><div>$ pvdisplay / pvcreate</div><div><span>$ sudo lvdisplay|awk '/LV Name/{n=$3} /Block device/{d=$3; sub(".*:","dm-",d); print d,n;}'</span></div><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p></p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
<mxGeometry x="330" y="685" width="460" height="125" as="geometry"/>
</mxCell>
<mxCell id="22" value="<h1><font style="font-size: 18px">$ vgcreate vgname /dev/xvdf1 /dev/xvdf2</font></h1><p>VG's Will appear inside the /dev/withyellowcolor</p><p>$ vgcreate vgname /dev/xvdf/<br></p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
<mxGeometry x="332" y="580" width="478" height="100" as="geometry"/>
</mxCell>
<mxCell id="23" value="<h1><font style="font-size: 18px">$ lvcreate -n lv1 -L 10G vgname</font></h1><p>LV's will be inside the /dev/new-vg/lv-withbluecolor</p><p>$ lvcreate vgname /dev/xvdf /dev/xvdf1<br></p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
<mxGeometry x="332" y="480" width="460" height="100" as="geometry"/>
</mxCell>
<mxCell id="24" value="<h1><font style="font-size: 18px">$ mkfs -t xfs/ext4 "lv1(GBT) or xvdf1(MBR)"</font><br></h1><p>$ mkfs -t xfs lv1</p><p># Optionally we can also make filesystem for PV also.</p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
<mxGeometry x="340" y="370" width="460" height="100" as="geometry"/>
</mxCell>
<mxCell id="25" value="" style="endArrow=classic;html=1;exitX=1;exitY=0.25;" parent="1" source="3" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="260" y="380" as="sourcePoint"/>
<mxPoint x="320" y="330" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="26" value="" style="endArrow=classic;html=1;exitX=1;exitY=0.75;" parent="1" source="4" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="270" y="490" as="sourcePoint"/>
<mxPoint x="320" y="440" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="27" value="" style="endArrow=classic;html=1;exitX=1;exitY=0.75;" parent="1" source="5" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="260" y="560" as="sourcePoint"/>
<mxPoint x="310" y="510" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="28" value="" style="endArrow=classic;html=1;exitX=1;exitY=0.75;" parent="1" source="6" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="260" y="620" as="sourcePoint"/>
<mxPoint x="320" y="605" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="29" value="" style="endArrow=classic;html=1;exitX=1;exitY=0.75;" parent="1" source="7" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="260" y="740" as="sourcePoint"/>
<mxPoint x="310" y="700" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="30" value="" style="endArrow=classic;html=1;exitX=1;exitY=0.75;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="260" y="740" as="sourcePoint"/>
<mxPoint x="310" y="815" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="33" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="20" y="320" width="240" height="60" as="geometry"/>
</mxCell>
<mxCell id="34" value="<font style="font-size: 25px">fstab-entry(MBR)</font>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="40" y="330" width="200" height="40" as="geometry"/>
</mxCell>
<mxCell id="35" value="<h1><font style="font-size: 18px">$ blkid (for MBR only )</font></h1><p># We need to manually make the fstab entry to make sure the mount&nbsp; persistent after rebooting of system. We dont use mount in this case.</p><p><span># We will make the /etc/fstab entry using the 'blkid' cmd gives blocks available info</span></p><p><span>we can make fstab entry in 2 types tagnames and UUID's the below cmds create the tagnames</span></p><p>$ xfs_admin -L xfsfstagname /dev/xvdg1</p><p>$ tune2fs -L ext4fs-tagname /dev/xvdf1</p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
<mxGeometry x="49" y="70" width="722" height="190" as="geometry"/>
</mxCell>
<mxCell id="36" value="" style="endArrow=classic;html=1;exitX=0.792;exitY=0.017;exitPerimeter=0;entryX=0.267;entryY=1.026;entryPerimeter=0;" parent="1" source="33" target="35" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="260" y="320" as="sourcePoint"/>
<mxPoint x="260" y="270" as="targetPoint"/>
<Array as="points">
<mxPoint x="230" y="300"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="37" value="<font style="font-size: 30px" color="#990000">MBR &amp; GBT-LVM in Linux</font>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="245" y="20" width="355" height="50" as="geometry"/>
</mxCell>
<mxCell id="39" value="<b><font style="font-size: 18px">SWAP memory</font></b>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="230" y="930" width="300" height="40" as="geometry"/>
</mxCell>
<mxCell id="40" value="<div>We create like a normal LV and assign in /etc/fstab entry as swap with UUID, we need to define explicitly the type of memory so the fstab entry will condider the UUID as the SWAP memory.</div><div><br></div><div>$ swapon -s $ cat /proc/partions $ cat /proc/swaps </div><div><br></div><div>SwAP memory is substitute memory to the RAM when the OS having the high RAM consumption the SWAP memory will be consider to use the remaining memory space.<br></div><div><br></div><div>We can make the swap partition by lvm or regular partition ffrom selecting "Linux Swap" then you can mount the pv to mount dedicatedly.</div><div>We create the LVM partition and change to swap file system and then we attach it to the swap space using the below command&nbsp;</div><div>lvcreate -n swap -L 2G vlm-grpname</div><div>mkswap /dev/vlm-grp-name/swaplv-name</div><div>swapon /dev/vlm-grp-name/lv-name</div>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="57.5" y="970" width="730" height="180" as="geometry"/>
</mxCell>
<mxCell id="41" value="<div>MBR: Its is partitioning system which is bit old and maximum partitions allowed in it was only 4.</div><div>Mak size of Partition is 2TiB<br></div><div><br></div><div>GPT: GPT is effecient compared to MBR and i has the max partitions allowed up to 128.</div><div>Max Size of Each Partition: 8ZiB<br></div>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="29" y="810" width="191" height="140" as="geometry"/>
</mxCell>
<mxCell id="3zxoI__Rs_BeG1Az2qIO-42" value="For removing GBT partioning&nbsp; follow<br>unmount&nbsp;<br>lvremove<br>vgremove<br>pvremove<br>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="490" y="860" width="290" height="110" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>