Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I had a partition of 91GB added in a logical volume filled to 61GB. Now I got an external hard drive and added a couple of partitions 43GB and 26GB each to the logical volume.

I now want to move the data to these new pvs and repartition the original 91GB partition. I started out with pvmove -v /dev/sdxx but it says Insufficient free space. Not enough extents. I am confused. My vgdisplay shows me as 91.23GB allocated. Why?

Here's the partition table of my hard disk:

/dev/sda5   91G
/dev/sda1   58G

I have my /home as a logical volume with /dev/sda5 as physical volume.

I now have an external hard drive partition table as follows:

/dev/sdb1    43G
/dev/sdb2    26G
/dev/sdb3    80G

df -h /home gives:

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/home-home--lvm
                      91G   61G  343M  100% /home

I want to remove /dev/sda5 from /home and repartition it. I have /dev/sdb1 and /dev/sdb2 free, so I want to add them to the lv home. How do I get this done?

share|improve this question
    
can you please reformat your question and include a tab formatted list of your HDDs/LVMs information? –  Arctor Apr 27 '11 at 19:00

1 Answer 1

up vote 0 down vote accepted

I was initially naive enough to just add /dev/sdb1 and /dev/sdb2. And try pvmove on /dev/sda5.

Here are the steps that solved the problem:

  • Boot into maintenance mode, umount the /home

  • resize2fs to within the size the new partitions can hold. (here 68G).*

  • lvresize the logical volume.

  • Use pvmove /dev/sda1*

  • Now pvremove /dev/sda1
  • Format it as you please

    • -- Both highly time consuming operations. You can skip the pvmove and resize the partition following the instructions here. http://www.howtoforge.com/linux_resizing_ext3_partitions But then it involves tampering with the partition table, while the data is not backed up. So you better be aware of the risk involved.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.