Resizing LVM Volume with Cache

I had to increase the size of my media LVM logical volume again. In a previous post, I provided the instructions. I have done this many times. However, this time around, I ran into a snag.

Apparently this is the first time I try to increase the logical volume after I implemented LVM caching, which I wrote about in this post.

The steps in the “Linux LVM Super Simple to Expand” post are the same right up to and including the step involving the resizing of the physical volume. Afterwards, in order to resize the logical volume, we first have to disable the cache temporarily.

sudo lvconvert --splitcache /dev/airvideovg2/airvideo

Once the logical volume is no longer cached, then we can proceed with the resizing.

sudo lvresize -l +100%FREE /dev/airvideovg2/airvideo

Once the resize is completed, we can unmount the volume and perform the required resizing of the filesystem.

sudo systemctl stop smbd.service

sudo systemctl stop mpd.service

sudo systemctl stop apache2.service

sudo umount /mnt/airvideo

sudo e2fsck -y -f /dev/airvideovg2/airvideo

sudo resize2fs -p /dev/airvideovg2/airvideo

Note that e2fsck and resize2fs will take some time, between thirty minutes to an hour each. Once the file system is resized, we can reattach the cache.

sudo lvconvert --type cache --cachepool airvideovg2/lv_cache airvideovg2/airvideo

Usually it is a good idea to reboot the server after this just to make sure it mounts properly.

This is a small snag and LVM is still super simple to expand.

Update on Prius Charging Economics

In my previous post, I talked about how charging the Prius Prime at home versus filling up its gas tank. Well we are in a very special time right now with gasoline prices hovering between $1 / L to $1.05 / L. The electricity rate has also changed to a flat $0.128 / KWh to be applied around the clock until October 31st, 2020.

I figured that I provide an update with these new conditions. With the lowered gasoline prices, the 4.4 L / 100 Km milage rating of the Prius Prime, it would now yield 22.7 km / $ assuming $1 / L as our cost.

Hidden Electrical Costs

When we use the per KWh charge of $0.128 for time of use; $0.0098 for delivery; $0.0039 for regulatory; yielding a total of $0.1417 / KWh, our Prius plugin yields (40 Km / 8.8 KWh / $0.1417) 32.078 km / $ when using the battery alone as an EV.

Clearly 32 km is still better than 23 km. Therefore, it is still better to charge the Toyota Prius Prime at any time of the day now because the electricity cost is the same around the clock.

I left out the monthly delivery and regulatory flat rates because I have to pay that regardless whether I’m charging the Prius or not. Also this calculation does not consider additional savings when charging due to the current Ontario Electricity Rebate that is in effect.

I hope you find this up to date information useful.