Following this tutorial assumes that you have followed along with the other two parts in this series. However, if you already have some familiarity with Linux you should be able to follow along. Working with logical volumes (part 1) Working with logical volumes (part 2) Add a disk to the volume group One of the great things about lvm is that you can add and remove physical volumes on the fly without data loss and without interrupting services.
In this post I want to cover one of the most commonly used features of lvm, extending a logical volume. If you were following along with the last post, “Working with logical volumes part 1”, then you should already have a volume group with a couple of live volumes attached. With lvm you can quickly and easily extend a Linux file system on the fly without interrupting any services. Becoming familiar with our lvm environment.
Not too long ago I ran into a problem where a server with systemd would not shutdown or reboot through normal means. When executing sudo shutdown -r now I would get a weird message back as output: Failed to start reboot.target: Connection timed out See system logs and 'systemctl status reboot.target' for details. Failed to open /dev/initctl: No such device or address Failed to talk to init daemon. I’m still not entirely certain what caused the problem and the suggestion of running systemctl status reboot.
Part one of working with logical volumes will cover the basic’s involved in creating logical volumes. TL;DR For those of you who just want the order of the commands. sudo pvcreate </path/to/device> sudo vgcreate <vgname> </path/to/device> sudo lvcreate -n <lvname> -L <size> <vgname> sudo mkfs.<filesystem> </path/to/lv> What you need to follow this guide A free disk (I used an empty virtual machine disk) Any Linux distribution (In this example I’ll be using Fedora 26, but the commands are the same across the entire Linux spectrum) LVM packages (lvm2 - usually pre-installed) What is LVM?
There are many instances when it’s useful to have multiple files open in vim , but if you aren’t familiar with this tool you can find yourself needlessly jumping around between multiple windows. If you are not already using vim start by opening a command prompt and type vimtutor , once you’ve become familiar with how to navigate, search, and edit a document with vim this post will make more sense to you.
Finding help with Linux If you hang out in enough Linux forums asking questions sooner or later someone will tell you to read the manual (presumably they think this will help you). Fortunately, over the last few years “rtfm” has ceased being the default answer to most questions from new users. All things considered, the Linux world has become more user friendly even if the man pages haven’t. Learning to read and understand man pages will allow you to separate yourself from new, and even some intermediate, users.