A Quick Reference to Adding New Storage with LVM
This post walks through the process of adding storage capacity to a Linux server using LVM. There’s nothing new, revolutionary, or cutting-edge about this post—honestly, it’s really more for my own reference than anything else. Adding logical volumes is something that I do so infrequently that it’s hard to remember all the commands, so I’m recording them here for when I need them next time.
First, list the physical disks in the system (all commands should be prefaced with sudo
or run as a user with the appropriate permissions):
fdisk -l
This will help you identify which (new) disk needs to be added. In my examples, I’ll use /dev/sdb
.
Start partitioning the new disk (replace /dev/sdb
with the appropriate values for your system):
fdisk /dev/sdb
I’m assuming that this isn’t a boot drive and that whatever logical volumes you create will take up the entire disk. Once you get into fdisk
, follow these steps:
- Enter
n
to create a new partition. - Enter
p
to make this a primary partition. - Enter
1
to make this the first partition on the disk. - Press enter twice to accept default start and end cylinders (unless you know you need to change them).
- Enter
Continue reading