Find the answer to your Linux question:
Results 1 to 9 of 9
Hi, I'm having problems with my LVM (I'm a begginer with LVM) that's setup on my RAID5. The story is that I've had a 4x 2TB HDD RAID5 with an ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2011
    Posts
    9

    Unhappy RAID5 + LVM - how to resize the LVM after growing RAID5?


    Hi,

    I'm having problems with my LVM (I'm a begginer with LVM) that's setup on my RAID5. The story is that I've had a 4x 2TB HDD RAID5 with an LVM setup. Now I've added an HDD to the RAID5 array. After reshaping:
    Code:
    md5 : active raid5 sdd1[0] sdm1[4] sdn1[3] sdf1[2] sde1[1]
    7814047744 blocks super 1.2 level 5, 512k chunk, algorithm 2 [5/5] [UUUUU]
    Code:
    (parted) print
    Model: Linux Software RAID Array (md)
    Disk /dev/md5: 8002GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt
    Code:
    VG #PV #LV #SN Attr VSize VFree
    lvm-magazyn 1 1 0 wz--n- 5,46t 0
    So the LVM is the same size as before (nothing special with that), but it does not see the additional free space provided by adding the new 2TB HDD.

    How can I make it see the new space so I can extend my LV's ?

    _____
    Best regards
    Szafran

  2. #2
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    896
    You're going to have to grow the partition that the PV(s) reside on, or create a new partition with the free space, make a PV out of it, import it to the volume group, grow the logical volume, then extend the file system.

  3. #3
    Just Joined!
    Join Date
    Jun 2011
    Posts
    9
    Quote Originally Posted by mizzle View Post
    You're going to have to grow the partition that the PV(s) reside on
    Yes. I know that. But how ? GParted can't touch the partition (every option for modification i greyed out in it)

  4. #4
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    896
    Then just add a new partition with the free space, make that a PV, and import it to the vg.

    Also, you won't be able to modify the partition if you have it mounted. So, you would need to boot from live cd, etc, if you want to modify your root partition.

  5. #5
    Just Joined!
    Join Date
    Jun 2011
    Posts
    9
    Quote Originally Posted by mizzle View Post
    Then just add a new partition with the free space, make that a PV, and import it to the vg.

    Also, you won't be able to modify the partition if you have it mounted. So, you would need to boot from live cd, etc, if you want to modify your root partition.
    Yes, that's a short way around the problem (of which I know from the start). After that I'll end up with 2 partitions used by the LVM. And after that I'll be adding the rest of my disks from the old array to this one and rebuilding it. So yet another partition. And even after that (in about a week) I'll be adding another disk to it right after it comes back exchanged from the shop (warranty). So I don't think that adding a partition everytime is a good idea. Any other propositions maybe ?

  6. #6
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    896
    Creating a new partition, pv, and importing it into the volume group would take less than 60 seconds. If you don't want to do this, you can do what I suggested in my first reply. Just unmount the file system, and do those steps. I don't use GParted, so I can't tell you what your problem is there. I just use command line utils such as fdisk. If you are trying to grow the / file system, then you'll need to use a live cd.

    I suggest you look into a storage solution such as freenas if you just want to point and click to grow the size of your storage, but that would require another system.

  7. #7
    Just Joined!
    Join Date
    Jun 2011
    Posts
    9
    Quote Originally Posted by mizzle View Post
    Creating a new partition, pv, and importing it into the volume group would take less than 60 seconds. If you don't want to do this, you can do what I suggested in my first reply. Just unmount the file system, and do those steps. I don't use GParted, so I can't tell you what your problem is there. I just use command line utils such as fdisk. If you are trying to grow the / file system, then you'll need to use a live cd.

    I suggest you look into a storage solution such as freenas if you just want to point and click to grow the size of your storage, but that would require another system.
    I really don't like when people assume that I'm stupid or sthing. And I don't want a point and click solution. I want the proper solution. And making partitions is not it. Sooner or later I'll get to the max partition number. And then what do you suppose I can do ?? Another simple walkaround instead of finding a direct solution ?
    I wrote that I'm a begginer with LVM's, but since I've started (about a week ago, when I started to install Proxmox on my NAS pc) I've done hundreds of operations on them. The only thing missing from LVM is vgresize. And because of that this topic exists.

  8. #8
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,756
    You have a GPT partition table, which supports up to 128 partitions. (Google: max number gpt partitions) Creating the new PV and adding it to the existing VG *is* the correct way to do this. Following that, any LV's created from the VG can be extended via lvextend (Google: how to grow lvm volume). However, note that the LV is the "disk" seen by the filesystem and when you extend it via lvextend, you are *changing* the underlying disk geometry that the filesystem saw when it was created. After extending the LV, the filesystem has to be grown as well - so make sure the filesystem supports this before attempting it. If you are asking for help and do not understand what the solution is, I am not sure why you are so hostile to mizzle's help...

    * Or you can follow existing guides using pvresize. As an admin, I know that the comments about "what if one of the new disks die" do not apply to your environment, hence I would still add a new PV to the VG.

  9. #9
    Just Joined!
    Join Date
    Jun 2011
    Posts
    9
    Quote Originally Posted by HROAdmin26 View Post
    You have a GPT partition table, which supports up to 128 partitions. (Google: max number gpt partitions) Creating the new PV and adding it to the existing VG *is* the correct way to do this. Following that, any LV's created from the VG can be extended via lvextend (Google: how to grow lvm volume). However, note that the LV is the "disk" seen by the filesystem and when you extend it via lvextend, you are *changing* the underlying disk geometry that the filesystem saw when it was created. After extending the LV, the filesystem has to be grown as well - so make sure the filesystem supports this before attempting it. If you are asking for help and do not understand what the solution is, I am not sure why you are so hostile to mizzle's help...

    * Or you can follow existing guides using pvresize. As an admin, I know that the comments about "what if one of the new disks die" do not apply to your environment, hence I would still add a new PV to the VG.
    I allready know how to handle lvs if I have the space for that.
    Anyways the topic is resolved.
    I've found a way without endlessly adding partitions.
    The only partition handling tool that I've tested, and has the ability to change the size of the lvm partition is KVPM.
    After changing the size of the partition it was easy to do the rest.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •