After using clone and resize commands of virtualbox I was able to extend a dynamic disk of 16GB to 20 as I wanted. After that I used a debian live ISO with gparted and lvm2 and extended the partition with the allocated space.
fdisk
though shows error as shown below and df
shows allocated space unchanged.
Output of fdisk
:
sudo fdisk -l
Disk /dev/sda: 21.0 GB, 20971520000 bytes
255 heads, 63 sectors/track, 2549 cylinders, total 40960000 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 identifier: 0x0000af96
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 499711 248832 83 Linux
/dev/sda2 501758 40959999 20229121 5 Extended
/dev/sda5 501760 40959999 20229120 8e Linux LVM
Disk /dev/mapper/mint--vg-root: 20.7 GB, 20711473152 bytes
255 heads, 63 sectors/track, 2518 cylinders, total 40452096 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 identifier: 0x00000000
Disk /dev/mapper/mint--vg-root doesn't contain a valid partition table
and df -h
:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/mint--vg-root 12G 11G 29M 100% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 734M 4.0K 734M 1% /dev
tmpfs 150M 1.1M 149M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 749M 964K 748M 1% /run/shm
none 100M 12K 100M 1% /run/user
/dev/sda1 236M 49M 176M 22% /boot
/dev/loop0 526M 82M 434M 16% /var/cache/openafs
AFS 2.0T 0 2.0T 0% /afs
Output of lsblk
:
$ sudo pvs
PV VG Fmt Attr PSize PFree
/dev/sda5 mint-vg lvm2 a-- 15.76g 24.00m
user@debian:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 19.5G 0 disk
├─sda1 8:1 0 243M 0 part
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 15.8G 0 part
├─mint--vg-root
254:0 0 11.8G 0 lvm
└─mint--vg-swap_1
254:1 0 4G 0 lvm
sr0 11:0 1 1.1G 0 rom /lib/live/mount/medium
loop0 7:0 0 1008.4M 1 loop /lib/live/mount/rootfs/filesystem.squashfs
Also pvs
, lvs
and vgs
as asked:
$ sudo pvs
PV VG Fmt Attr PSize PFree
/dev/sda5 mint-vg lvm2 a-- 15.76g 24.00m
$ sudo vgs
VG #PV #LV #SN Attr VSize VFree
mint-vg 1 2 0 wz--n- 15.76g 24.00m
$ sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root mint-vg -wi-a----- 11.74g
swap_1 mint-vg -wi-a----- 4.00g
Guest OS I want to extend the partition is Linux Mint with lvm2 filesystem.
I have also tried with guidelines from command as https://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/lv_extend.html but with the same error message(Disk /dev/mapper/mint--vg-root doesn't contain a valid partition table
).
What am I missing?
User contributions licensed under CC BY-SA 3.0