Additional physical volumes can be added to the volume group as required, and the logical volumes extended using lvextend and resize2fs to take advantage of the additional space.
Adding a New Disk
AWS specific instructions
Launch an LVM Lighthouse instance as per our guidelines or your own deployment processes and note the instance ID.
To add a volume to an AWS Lighthouse without having to shut down the LH:
- In the AWS web console, go to Volumes and create a new 5GB volume.
NOTE: Make sure this volume in the same availability zone as your LH instance. - Once the volume is created, select it and click the Actions button and select Attach Volume.
- Enter the LH instance ID for the instance field and /dev/xvdb (or /dev/xvdd, /dev/xvde and so on) as the device and click Attach.
When you SSH into the LH you should be able to see the new volume as /dev/xvdb (or whatever device name you gave it).
qemu specific instructions
Launch a qemu Lighthouse instance as per our guidelines or your own deployment.
To add a volume to the instance:
- Shutdown the instance with the following command:
shutdown -h now - Create a new disk for the LH. You can use a different number for “count” which is in MiB.
dd if=/dev/zero of=/tmp/new_lh_disk.lh_hdd bs=1024k count=256
qemu-img convert -p -f raw -O qcow2 /tmp/new_lh_disk.lh /tmp/new_lh_disk.qcow2
- Restart your qemu instance but make sure to add the new qcow2 disk to the command.
Here is an example of what you should add to your qemu command when launching the instance:
-drive if=scsi,file=/tmp/new_lh_disk.qcow2
NOTE: this is just an example. You should specify the disk in a similar way to how you specified the primary Lighthouse disk. and you should make sure that the new disk is specified last, otherwise your disk will appear out of order when you boot the Lighthouse. - Once the LH boots you should have a new /dev/sdX device and the 'unused_disks' command should report that disk when you log in.
Azure specific instructions
Launch the LVM Lighthouse instance as per our guidelines or your own deployment.
To add a volume to the instance, use the following link to attach a new disk to your Lighthouse VM. Stop before you reach the section, "Connect to the Linux VM to mount the new disk."
https://docs.microsoft.com/en-us/azure/virtual-machines/linux/attach-disk-portal
Hyper-V specific instructions
Launch the LVM Lighthouse instance as per our guidelines or your own deployment.
To add a volume to the instance:
- Shutdown your Hyper-V Lighthouse instance.
- Open your Hyper-V manager.
- Navigate to the VM list and locate your Lighthouse VM.
- Right click on the instance and click Settings.
- Click on the SCSI controller.
- Select Hard drive on the right and click Add.
- Select Virtual hard disk and click New.
- Follow the prompts and select the options that best suit your needs and environment.
- Once you've created the disk, click Apply in the VM settings window.
- Restart the Lighthouse.
VirtualBox specific instructions
Launch the LVM Lighthouse instance as per our guidelines from the .ova file or your own deployment.
To add a volume to the instance:
- Shutdown the Lighthouse instance.
- In the VirtualBox UI, locate your Lighthouse instance and right-click it.
- Select Settings.
- Select Storage on the left.
- Click the Controller: SCSI in the disk list.
- You will see two small icons, both with a green '+' symbol. Hover your mouse over the one that says Adds a hard disk and click it.
- Click the Create
- Follow the prompts to create a new disk image.
- Select the new disk image and click the Choose
- Click Ok to exit the VM settings window.
- Restart the Lighthouse.
Using the new disk to increase the lh_data logical volume
- Add the new disk to the LH VM (platform dependent, see above).
- Log into the shell on Lighthouse. you should see the new "unused" disk listed in the welcome message. This is the case for any non-system disks aren't currently being used by the LVM system.
- Create a partition on the new disk:
fdisk /dev/sdb (or /dev/xvdb, or /dev/(sd|xvd)X )
NOTE: Be sure specify the correct disk, it might be /dev/xvdb on AWS.
- Type 'n' and ENTER to create a new partition.
- Type 'p' and ENTER to create a primary parition.
- Continue hitting ENTER to accept the defaults to use the whole disk.
- Type 'w' and ENTER to write the changes and exit fdisk.
- Add the new partition as a physical volume (assuming you are now using /dev/sdb1, note that /dev/xvdb1 will now be mapped to /dev/sdb1 so make sure you use sdb1).
pvcreate /dev/sdb1
- Extend the volume group with the new physical volume.
vgextend lhvg /dev/sdb1
- Assuming the new disk gives you at least 2GB of extra space, expand the lh_data logical volume.
lvextend -L +2G /dev/mapper/lhvg-lh_data
- Update the file system of the lh_data disk to use the extra space.
resize2fs /dev/mapper/lhvg-lh_data
- When you log into the shell, the disk should no longer be listed as "unused".
Comments
0 comments
Article is closed for comments.