Ask Your Question
2

How to resize a lv on Fedora 21?

asked 2015-02-16 15:50:53 -0600

nashsx gravatar image

Hello,

I have installed Fedora within a LV in the VG /dev/fedora and there want to resize my /home partition, I have 65G unallocated space on /dev/sda, when I say sudo lvextend - - size +25G /dev/fedora/home it says: Insufficient free space: need 6400 extents, but only 1 available.

Can anybody help me with this issue? Do I need to resize some higher instance first? I am quite new to the whole lvm thing, this is my first Fedora installation on a LV and hard disk stuff was never my domain... Thanks a lot!

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted
3

answered 2015-02-17 05:22:05 -0600

cobra gravatar image

Normally I'd say 'do this then do this' to fix such a problem, but LVM is a large subject with the potential to completely screw over your computer if you get it wrong. Instead of providing some simple instructions, it might be more useful to you get a grounding in how LVM works.

If you're keen to learn about it, howtoforge has a really good LVM 101, it's here: https://www.howtoforge.com/linux_lvm

If you get through that, you'll understand this a lot better, and it goes on to explain how resizing happens.

edit flag offensive delete link more
1

answered 2015-02-17 11:36:03 -0600

sergiomb gravatar image
edit flag offensive delete link more
1

answered 2016-08-14 12:03:13 -0600

diman82 gravatar image

These are the steps to Extend a LVM partition:

  1. Format some unused space to a LVM2 volume/s.
  2. Add the newly created Physical Volume/s to a Volume Group that is used by your primary root/home/swap partition, by running the following command: sudo vgextend fedora /dev/sda8 (substitue /dev/sda8 with your newly created Physical Volume/s). A sucessful output would be: Volume group "**fedora**" successfully extended.
  3. sudo lvresize --size +9.99G /dev/fedora/home - substitute the size param with the size you want (no more than the max availalbe space, of course) and the second param with the partition you want to extend (root/home/swap). A sucessful output would be:

    Rounding size to boundary between physical extents: 9.99 GiB. Size of logical volume fedora/home changed from 15.84 GiB (4054 extents) to 25.83 GiB (6612 extents). Logical volume home successfully resized.

  4. sudo resize2fs /dev/fedora/home - substitute the desired partition with the needed one (root/home/swap). A sucessful output would be:

    resize2fs 1.42.13 (17-May-2015) Filesystem at /dev/fedora/home is mounted on /home; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 2 The filesystem on /dev/fedora/home is now 6770688 (4k) blocks long.

edit flag offensive delete link more
0

answered 2015-02-17 17:29:10 -0600

nashsx gravatar image

Well, thanks for the answers, I happened to get it work for myself now. I had to allocate the free space to the fedora-lv2-partition in gparted, took not even a second to perform this action. Afterwards, it worked with

sudo lvresize --size +25G /dev/home/fedora

It was just that unallocated space on the hard drive first has to be allocated to the overall LV before it can be available for resizing a lv-partition. This of course can be done in any partition programm or the terminal with the right set of commands.

I got this working maybe about fifteen minutes after posting my question, altough I really tried hard on my own first and then used the search function ln this board before posting. Though thanks for the answers! Regards, Nash.

edit flag offensive delete link more

Comments

"It was just that unallocated space on the hard drive first has to be allocated to the overall LV before it can be available for resizing a lv-partition"

So, how did you do that?

Alessio.AguirrePimentel gravatar imageAlessio.AguirrePimentel ( 2015-09-19 22:00:23 -0600 )edit

Hello, I’ve resized my home partition using your solution. However, though sudo lvdisplay /dev/fedora/home shows the right size of the partition, nautilus and other programs don’t seem to have picked up the change. Have you made any further steps?

tomekwi gravatar imagetomekwi ( 2016-02-24 23:57:00 -0600 )edit

The last step would be to resize the associated filesystem to use the new partition, i.e. format the extra space.

sudo resize2fs /dev/fedora/home
JimParker gravatar imageJimParker ( 2016-06-10 15:20:56 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2015-02-16 15:50:53 -0600

Seen: 17,725 times

Last updated: Feb 17 '15