<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: arial, helvetica, sans-serif;">Hi all,</span><br /> <br /><span style="font-family: arial, helvetica, sans-serif;"> [TEC]'s new Grafana alerting has already paid dividends, reporting murasoi's var as 100% immediately after coming online.</span><br /> <br /><span style="font-family: arial, helvetica, sans-serif;"> While there was ~10G of space in the volume group to grow into, which I immediately did (`lvresize -L +10G murasoi/var` and `resize2fs /dev/mapper/murasoi-var`), I noticed that there was a large amount of space on the physical partitions that was not being used by the raid1 array which sits directly atop it:<br /></span></div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">&nbsp;</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: andale mono, monospace;">root@murasoi:/# lsblk</span></div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: andale mono, monospace;">NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAJ:MIN RM&nbsp;&nbsp; SIZE RO TYPE&nbsp; MOUNTPOINT</span></div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: andale mono, monospace;">...<br />sdc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8:32&nbsp;&nbsp; 0 465.8G&nbsp; 0 disk &nbsp;<br />└─sdc1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8:33&nbsp;&nbsp; 0&nbsp;&nbsp; 110G&nbsp; 0 part &nbsp;<br />&nbsp; └─md0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9:0&nbsp;&nbsp;&nbsp; 0&nbsp; 68.4G&nbsp; 0 raid1 <br />sdd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8:48&nbsp;&nbsp; 0 465.8G&nbsp; 0 disk &nbsp;<br />└─sdd1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8:49&nbsp;&nbsp; 0&nbsp;&nbsp; 110G&nbsp; 0 part &nbsp;<br />&nbsp; └─md0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9:0&nbsp;&nbsp;&nbsp; 0&nbsp; 68.4G&nbsp; 0 raid1&nbsp;</span></div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: andale mono, monospace;">...</span></div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">&nbsp;</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: arial, helvetica, sans-serif;">What the above is saying is that the data stored across the different partitions of murasoi could occupy a maximum of 68.4 GB, but the underlying storage has space for 110 GB with the current partition layout, or 465.8 GB if the physical partition was expanded to fill the whole disk. This likely happened because the RAID array `/dev/md0` had been physically copied from a smaller disk in the past and hadn't yet been made aware of the extra space available.</span></div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">&nbsp;</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: arial, helvetica, sans-serif;">The steps are fairly simple and can be run without bringing the system down:</span></div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">&nbsp;</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: courier new, courier, monospace;"># mdadm --grow --size max /dev/md0</span></div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: courier new, courier, monospace;"># pvresize /dev/md0</span></div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">&nbsp;</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: arial, helvetica, sans-serif;">First, the RAID array is grown to fill its full allocation on disk, then LVM (the next layer up, which deals with allocating space to different areas of the filesystem) is informed that it has more raw blocks to play with. Now the extra space is available to allocate to one or more partitions in the volume group. I have left /var as is, but there's plenty of space to expand into, even within the 110 GB.</span></div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">&nbsp;</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: arial, helvetica, sans-serif;">Cheers,</span></div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">&nbsp;</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"><span style="font-family: arial, helvetica, sans-serif;">James [MPT]</span></div>
</body></html>