uter
By:
uter

Merging disks? Convert root partition to lvm?

March 25, 2017 750 views
Block Storage CentOS

I have a $5/Month Droplet, which has a 20 GB disk. Then I add a 10 GB block storage to it. Now my Droplet has 30 GB space.
But these 30 GB are not continuous, when disk1 is full, system will not write data to disk2, instead, system throw a "No space left on device" error.

So I tried to merging disks.
LVM seems to be a good choice, so I tried to convert root partition to lvm. I found some instruction on Google, but I just can't make it work, I just keep crash the system since I am a noob.

Is there a detailed Instruction for convert root partition to lvm on Droplet?
Thanks!

2 comments
  • @uter
    I don't have an answer for you, since I haven't used LVM.
    But have you seen this tutorial - I know it's Ubuntu based, but I think LVM is very similar across the different distros:
    https://www.digitalocean.com/community/tutorials/how-to-use-lvm-to-manage-storage-devices-on-ubuntu-16-04

    LVM, or Logical Volume Management, is a storage device management technology that gives users the power to pool and abstract the physical layout of component storage devices for easier and flexible administration. Utilizing the device mapper Linux kernel framework, the...
  • Thanks for reply.
    But I don't think this tutorial would help me, this tutorial is about managing, I know how to manage once root partition converted to LVM, but it didn't say anything about convert root partition to LVM.

    Here's my thoughts:
    disk1 = Original 20GB disk(1 root partition ), disk2 = external 10GB disk(no data at all).
    Convert disk2 to LVM -------- Backup disk1 data to disk2 -------- Boot from disk2 -------- Convert disk1 to LVM -------- vgextend(merging disks space)
    But I am not sure about detail. So I need someone to help me.

1 Answer

Hi Uter,

I want to inform you that converting root partition is require a lot of effort and very complicated.What i can suggest you to move some of the bigger directory to some other new LVM partion like /var /home/ /opt. like which are the folder utilizing the most of the space and then move it to new partition.you can determine the space using below command.
du -sh /var

Please format the partition as LVM and visit below post to mount any directory to new partition which utilizing most space.

http://blog.oshim.net/2011/10/how-to-move-var-folder-to-new-partition.html

If you want to go for converting root partition to LVM use below post.

http://thegeekdiary.com/centos-rhel-converting-an-existing-root-filesystem-to-lvm-partition/

Hope it will help.

Have another answer? Share your knowledge.