1 (edited by adamwalkerinuk 2022-07-19 17:03:08)

Topic: [SOLVED]FS inside LVM not grown when drive grown from 4TB to 6TB

Hi Recently cloned a drive using Clonezilla ubuntu server from 4Gb drive to 6GB drive.

Gparted sees the main partition as the new size but Ubuntu/webmin still see it as a 4GB drive

Any help would be appreciated

https://photos.smugmug.com/photos/i-cQpxBQz/0/X2/i-cQpxBQz-X2.jpg

 sudo lsblk -o name,maj:min,rm,size,ro,type,fstype,label,mountpoint
NAME   MAJ:MIN RM   SIZE RO TYPE FSTYPE      LABEL MOUNTPOINT
loop0    7:0    0  55.6M  1 loop squashfs          /snap/core18/2538
loop1    7:1    0  61.9M  1 loop squashfs          /snap/core20/1494
loop2    7:2    0 162.5M  1 loop squashfs          /snap/overseerr/1175
loop3    7:3    0  31.3M  1 loop squashfs          /snap/tautulli/1516
loop4    7:4    0  45.1M  1 loop squashfs          /snap/node-red/815
loop5    7:5    0  55.5M  1 loop squashfs          /snap/core18/2409
loop6    7:6    0    47M  1 loop squashfs          /snap/snapd/16292
loop7    7:7    0    45M  1 loop squashfs          /snap/node-red/811
loop8    7:8    0  31.3M  1 loop squashfs          /snap/tautulli/1513
loop9    7:9    0    47M  1 loop squashfs          /snap/snapd/16010
loop10   7:10   0  61.9M  1 loop squashfs          /snap/core20/1518
loop11   7:11   0 164.2M  1 loop squashfs          /snap/overseerr/1290
loop12   7:12   0 464.5M  1 loop squashfs          /snap/home-assistant-snap/487
sda      8:0    0   5.5T  0 disk
├─sda1   8:1    0   1.5M  0 part
├─sda2   8:2    0   732M  0 part ext2              /boot
└─sda3   8:3    0   5.5T  0 part LVM2_member
  ├─ubuntu--vg-root
  │    253:0    0   3.6T  0 lvm  ext4              /
  └─ubuntu--vg-swap_1
       253:1    0   7.9G  0 lvm  swap              [SWAP]
sr0     11:0    1  1024M  0 rom


 sudo lvm pvs -v --segments
[sudo] password for adam:
    Wiping internal VG cache
    Wiping cache of LVM-capable devices
  PV         VG        Fmt  Attr PSize  PFree  Start  SSize  LV     Start Type   PE Ranges
  /dev/sda3  ubuntu-vg lvm2 a--  <5.46t <1.82t      0 951661 root       0 linear /dev/sda3:0-951660
  /dev/sda3  ubuntu-vg lvm2 a--  <5.46t <1.82t 951661   2013 swap_1     0 linear /dev/sda3:951661-953673
  /dev/sda3  ubuntu-vg lvm2 a--  <5.46t <1.82t 953674 476933            0 free  

sudo fdisk -l /dev/sda
Disk /dev/sda: 5.5 TiB, 6001175126016 bytes, 11721045168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: D5898904-908B-4341-B368-FCC2940F4903

Device       Start         End     Sectors  Size Type
/dev/sda1     2048        5119        3072  1.5M BIOS boot
/dev/sda2     5120     1504254     1499135  732M Linux filesystem
/dev/sda3  1504255 11721043967 11719539713  5.5T Linux LVM

Partition 3 does not start on physical sector boundary.

sudo parted /dev/sda unit s print
Model: ATA ST6000DM003-2CY1 (scsi)
Disk /dev/sda: 11721045168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start     End           Size          File system  Name  Flags
 1      2048s     5119s         3072s                            bios_grub
 2      5120s     1504254s      1499135s      ext2
 3      1504255s  11721043967s  11719539713s                     lvm

Thanks

Adam

2

Re: [SOLVED]FS inside LVM not grown when drive grown from 4TB to 6TB

Thanks, you've included all the information I need.

Run this command to grow your root (/) file system to use all the free space available in the LVM Volume Group.  It is an on-line operation.

sudo lvm lvresize -l +100%FREE --resizefs /dev/ubuntu-vg/root

It will grow the ubuntu-vg/root Logical Volume to fill all available space in the Volume Group and then grow the root (/) ext4 file system to fill the Logical Volume in one command.



I have renamed the thread to better describe the situation you encountered.

You mean you resized your drive from 4TB to 6TB as all the commands report the drive as 5.5 TiB (6001175126016 bytes).

So Clonezilla grow your drive sda, partition sda3, and the LVM Physical Volume it contained.  This resulted in LVM Volume Group ubuntu-vg gaining about 2TB of free space.

LVM Volume Groups and Logical Volumes are like a separate level of allocation similar to disk drives and partitions, but with more flexibility (and complexity).  Unfortunately GParted doesn't show LVM Volume Groups and Logical Volumes.

Now you need to allocate the free space in the Volume Group as desired.  Hence the above command.

3

Re: [SOLVED]FS inside LVM not grown when drive grown from 4TB to 6TB

Thank you for your great help, all done.
That makes a lot more sense the way you explained it.


mfleetwo wrote:

Thanks, you've included all the information I need.

Run this command to grow your root (/) file system to use all the free space available in the LVM Volume Group.  It is an on-line operation.

sudo lvm lvresize -l +100%FREE --resizefs /dev/ubuntu-vg/root

It will grow the ubuntu-vg/root Logical Volume to fill all available space in the Volume Group and then grow the root (/) ext4 file system to fill the Logical Volume in one command.



I have renamed the thread to better describe the situation you encountered.

You mean you resized your drive from 4TB to 6TB as all the commands report the drive as 5.5 TiB (6001175126016 bytes).

So Clonezilla grow your drive sda, partition sda3, and the LVM Physical Volume it contained.  This resulted in LVM Volume Group ubuntu-vg gaining about 2TB of free space.

LVM Volume Groups and Logical Volumes are like a separate level of allocation similar to disk drives and partitions, but with more flexibility (and complexity).  Unfortunately GParted doesn't show LVM Volume Groups and Logical Volumes.

Now you need to allocate the free space in the Volume Group as desired.  Hence the above command.