[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to Resize Partition on LVM



ray wrote :
> 
> Displaying the resize pv:
> # pvdisplay -v -m
>     DEGRADED MODE. Incomplete RAID LVs will be processed.

Hmm. Not sure wha that means. Was there anothed disk in the VG ?

>     Scanning for physical volume names
>   --- Physical volume ---
>   PV Name               /dev/sda5
>   VG Name               mycomp-vg
>   PV Size               55.00 GiB / not usable 3.00 MiB
>   Allocatable           yes 
>   PE Size               4.00 MiB
>   Total PE              14079
>   Free PE               1695
>   Allocated PE          12384
>                  (the file system is smaller than the pv)  
>  lsblk
> NAME                   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
> sda                      8:0    0   477G  0 disk 
> ├─sda1                   8:1    0   243M  0 part /boot
> ├─sda2                   8:2    0     1K  0 part 
> └─sda5                   8:5    0 476.7G  0 part 
>   ├─mycomp--vg-root   254:0    0   8.4G  0 lvm  /
>   ├─mycomp--vg-var    254:1    0   2.8G  0 lvm  /var
>   ├─mycomp--vg-swap_1 254:2    0  31.9G  0 lvm  [SWAP]
>   ├─mycomp--vg-tmp    254:3    0   380M  0 lvm  /tmp
>   └─mycomp--vg-home   254:4    0     5G  0 lvm  /home

The sizes don't match. The size of /dev/sda5 is 476 GiB but the PV
within claims its size is only 55 GiB and is almost full. Did you reduce
the PV size in /dev/sda5 with pvresize ?

Now you need to explain what you want to do exactly, because you have
been unclear so far.

Do you want to reduce the partition /dev/sda5 and create a new plain
partition for whatever use (filesystem, new PV for existing or new VG) ?

Then you must reduce /dev/sda5 with whatever partitioning tool, to a
size of at least the PV size, 55 GiB (*not* 55 GB which is only 51.2
GiB, beware if using parted). In the free space on the disk you can
create a new partition.

Or do you want to create a new LV in the existing VG ?

Then, if the new LV size is less than the remaining free space in the VG
(about 6.5 GiB), just use lvcreate to create the LV. If its size must be
bigger than the available free space, then you need to resize the PV
first, up to the size of /dev/sda5.


Reply to: