Results 1 to 8 of 8

Thread: LVM not the right size

  1. #1

    Default LVM not the right size

    Hi
    I have made 2 partitions that I have setup for LVM these partitions are 200G and formatted with ext4. However, when I do an "fdisk -l" on the drive it shows that these partitions
    are only 4G in size, I wanted them to be the whole 200G. What have I done wrong and how can this be fixed ?. I assume if I try "mkfs.ext4" again I will end up with what I have now.

    Your help is appreciated Thank you.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,643

    Default Re: LVM not the right size

    To begin with, sorry but saying things ".... when I do an "fdisk -l" on the drive it shows ...." without showing it to us is not a good way to inform your potential helpers.

    Please copy that from your terminal, starting with the prompt, the mouse sweep should include that prompt, the command, the output and the next prompt. Paste it in your post between CODE tags. You get the CODE tags by clicking on the button with the # in the tool bar of the post editor.

    Posting the computer facts in this way is very easy and relieves you then from typing a lot of explanations (that in many cases are just your conclusions, others may come to other conclusions based on the same facts).

    And apart from the
    Code:
    fdisk -l
    you could also post what your LVM configuration is with the use of pvdisplay, vgdisplay and lvdisplay.

    We need that the the more because IMHO your description is not very clear. You say that you use two partitions with LVM. That means for me that they are then LVM Physical Volumes. But you also say that you created ext4 file systems on those partitions. You can not have both of them. Thus seeing what you have in reality is rather important.
    Henk van Velden

  3. #3

    Default Re: LVM not the right size

    Thank you hccv
    I must have had a little brain fade yesterday. Here is what you requested

    fdisk -l
    Code:
    Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0xb63d5863
    
    Device     Boot     Start        End   Sectors  Size Id Type
    /dev/sdb1            2048  734005247 734003200  350G 83 Linux
    /dev/sdb2       734005248  775948287  41943040   20G 8e Linux LVM
    /dev/sdb3       775948288 1258293247 482344960  230G 8e Linux LVM
    
    
    Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x00037a16
    
    Device     Boot    Start       End   Sectors   Size Id Type
    /dev/sda1  *        2048   1026047   1024000   500M 83 Linux
    /dev/sda2        1026048   2050047   1024000   500M 83 Linux
    /dev/sda3        2050048   2152447    102400    50M 82 Linux swap / Solaris
    /dev/sda4        2152448 976773119 974620672 464.8G  f W95 Ext'd (LBA)
    /dev/sda5        2154496   6361087   4206592     2G 82 Linux swap / Solaris
    /dev/sda6        6363136  90253311  83890176    40G 83 Linux
    /dev/sda7       90255360 976773119 886517760 422.7G 83 Linux
    
    
    Disk /dev/mapper/PDFGroup0-Linux: 5 GiB, 5368709120 bytes, 10485760 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/mapper/PDFGroup0-Network: 5 GiB, 5368709120 bytes, 10485760 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes

    pvdisplay, vgdisplay and lvdisplay.

    Code:
    --- Physical volume ---
      PV Name               /dev/sdb2
      VG Name               PDFGroup0
      PV Size               20.00 GiB / not usable 4.00 MiB
      Allocatable           yes 
      PE Size               4.00 MiB
      Total PE              5119
      Free PE               2559
      Allocated PE          2560
      PV UUID               quxo4i-jJfa-UE71-PIG4-QcAd-lIJN-O024k3
       
      --- Physical volume ---
      PV Name               /dev/sdb3
      VG Name               VideoGroup0
      PV Size               230.00 GiB / not usable 4.00 MiB
      Allocatable           yes 
      PE Size               4.00 MiB
      Total PE              58879
      Free PE               58879
      Allocated PE          0
      PV UUID               kJWVa3-eQVO-hQBr-lfow-9EcJ-wivp-bIzv1P
       
      --- Volume group ---
      VG Name               PDFGroup0
      System ID             
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  3
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                2
      Open LV               2
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               20.00 GiB
      PE Size               4.00 MiB
      Total PE              5119
      Alloc PE / Size       2560 / 10.00 GiB
      Free  PE / Size       2559 / 10.00 GiB
      VG UUID               iYEh2f-6lZ3-UGmW-qu0y-3RZU-UzZa-e5cAAR
       
      --- Volume group ---
      VG Name               VideoGroup0
      System ID             
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  1
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                0
      Open LV               0
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               230.00 GiB
      PE Size               4.00 MiB
      Total PE              58879
      Alloc PE / Size       0 / 0   
      Free  PE / Size       58879 / 230.00 GiB
      VG UUID               GF1T4g-g4sx-RnWa-maH6-BPTp-zBKr-QYNUlk
       
      --- Logical volume ---
      LV Path                /dev/PDFGroup0/Linux
      LV Name                Linux
      VG Name                PDFGroup0
      LV UUID                l2VLyM-cQlt-hxUc-Hqg1-KtKA-m0mT-WGKBqX
      LV Write Access        read/write
      LV Creation host, time Leap42-Server, 2017-10-21 09:30:31 +1030
      LV Status              available
      # open                 1
      LV Size                5.00 GiB
      Current LE             1280
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     1024
      Block device           254:0
       
      --- Logical volume ---
      LV Path                /dev/PDFGroup0/Network
      LV Name                Network
      VG Name                PDFGroup0
      LV UUID                mTpsFb-q32S-LfBd-Wbd1-btHf-dUwj-k0SxoU
      LV Write Access        read/write
      LV Creation host, time Leap42-Server, 2017-10-21 09:31:25 +1030
      LV Status              available
      # open                 1
      LV Size                5.00 GiB
      Current LE             1280
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     1024
      Block device           254:1

  4. #4
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,547

    Default Re: LVM not the right size

    LVM is a container not a file system you must put partitions and file systems in the LVMs

  5. #5
    Join Date
    Sep 2012
    Posts
    4,927

    Default Re: LVM not the right size

    Quote Originally Posted by Subzero01 View Post
    Here is what you requested
    I do not see anything with size 4G in "fdisk -l" output.

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,643

    Default Re: LVM not the right size

    Quote Originally Posted by gogalthorp View Post
    LVM is a container not a file system you must put partitions and file systems in the LVMs
    No partitions!
    Partitions are direct on a disk configured through a partition table.

    LVM uses Physical Volumes (which can be partitions, but also whole disks), they are gathered in Volume Groups and the Volume Groups are divided into (one or more) Logical Volumes.

    Those Logical Volumes are now the containers of the same things that will be put into partitions by most people: swap space and file systems. But please do not confuse LVs with partitions, the discussion then becomes then a mess.
    Henk van Velden

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,643

    Default Re: LVM not the right size

    To the OP, please next time please extend your mouse sweep a little bit so that it also includes the prompts (before and after) and the commands (this I asked you earlier!). Then we have all as you see it. And you do not have to explain with extra story telling that what follows is
    pvdisplay, vgdisplay and lvdisplay.
    because it is all there exactly as you did it, including options or whatever.

    =================

    So, you have given partitions sdb2 (20G) and sdb3 (230G) the id 8e (Linux LVM).

    Then they are made into PVs of 20G and 230G resp.

    Then there are two VGs, each one based on one of the PVs, PDFGroup0 of 20G and VideoGroup0 of 230G.

    There is a LV Linux on VG PDFGroup0 with the size of 5G.
    There is a LV Network on VG PDFGroup0 with the size 5G.

    And that is it.

    So there is still ~10G unused on VG PDFGroup0 and VideoGroup0 is not used at all.

    To begin with, like @avidjaar, I wonder why you are talking about number like 200G and 4G. They are nowhere in what we see here.

    And then of course, you talk about having "formatted" ext4 file systems on partitions. Which partitions?

    And did you do anything with those two LVs? Created a file system on them? When yes, tried to mount them? In that case, please show
    Code:
    df -h
    to see what the size of those file system is.

    And maybe, referring to to old saying "Describe the goal, not the step", you could explain what you are trying to achieve. Until now we can only explain what we see, but we have no idea if this comes one step nearer to what you want.

    Personally, I do not understand much about what you are doing. First you split off two partitions, then you made them into two VGs. Why not just one partition, one VG and then dividing that in the LVs you need?
    Why are you using LVM in the first place and are you not using simply partitions? I know there might be reason (like encryption) but we have no idea at all what you are after.
    Last edited by hcvv; 23-Oct-2017 at 01:28.
    Henk van Velden

  8. #8

    Default Re: LVM not the right size

    Thank you hcvv I now understand a bit more about LVM . I am going to have a rethink and possibly start over.

Posting Permissions

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