How to Resize the / using LVM
==============================
Error Summary
-------------
Disk Requirements:
At least 923MB more space needed on the / filesystem.
[root@thermalite ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs tmpfs 3.9G 8.0K 3.9G 1% /dev/shm
tmpfs tmpfs 3.9G 1.2M 3.9G 1% /run
tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/fedora-root xfs 15G 15G 970M 94% /
tmpfs tmpfs 3.9G 4.5M 3.9G 1% /tmp
/dev/sda2 ext4 976M 197M 713M 22% /boot
/dev/sda1 vfat 200M 8.7M 192M 5% /boot/efi
tmpfs tmpfs 787M 4.0K 787M 1% /run/user/1000
[root@thermalite ~]# fdisk -l
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 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: E39A4721-3CD4-4444-9A32-0F3EE22331B5
Device Start End Sectors Size Type
/dev/sda1 2048 411647 409600 200M EFI System
/dev/sda2 411648 2508799 2097152 1G Linux filesystem
/dev/sda3 2508800 1953523711 1951014912 930.3G Linux LVM
Disk /dev/mapper/fedora-root: 15 GiB, 16106127360 bytes, 31457280 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
Disk /dev/mapper/fedora-swap: 7.8 GiB, 8388608000 bytes, 16384000 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
[root@thermalite ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs tmpfs 3.9G 8.0K 3.9G 1% /dev/shm
tmpfs tmpfs 3.9G 1.2M 3.9G 1% /run
tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/fedora-root xfs 15G 15G 971M 94% /
tmpfs tmpfs 3.9G 4.5M 3.9G 1% /tmp
/dev/sda2 ext4 976M 197M 713M 22% /boot
/dev/sda1 vfat 200M 8.7M 192M 5% /boot/efi
tmpfs tmpfs 787M 4.0K 787M 1% /run/user/1000
[root@thermalite ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 930.3G 0 part
├─fedora-root 253:0 0 15G 0 lvm /
└─fedora-swap 253:1 0 7.8G 0 lvm [SWAP]
[root@thermalite ~]# sudo parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit GB
(parted) print
Model: ATA WDC WD10EZEX-00B (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 0.00GB 0.21GB 0.21GB fat16 EFI System Partition boot, esp
2 0.21GB 1.28GB 1.07GB ext4
3 1.28GB 1000GB 999GB lvm
(parted) q
[root@thermalite ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda3
VG Name fedora
PV Size Allocatable yes
PE Size 4.00 MiB
Total PE 238160
Free PE 232320
Allocated PE 5840
PV UUID etHzhN-vONC-31VY-qdA5-zcWx-Drsq-52CcO6
[root@thermalite ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 fedora lvm2 a-- 930.31g 907.50g
[root@thermalite ~]# vgdisplay
--- Volume group ---
VG Name fedora
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 930.31 GiB
PE Size 4.00 MiB
Total PE 238160
Alloc PE / Size 5840 / 22.81 GiB
Free PE / Size 232320 / 907.50 GiB
VG UUID l3ifpd-93Wv-Y8Wl-4I31-CBnH-gxt5-2BYg7v
[root@thermalite ~]# vgdisplay -v
--- Volume group ---
VG Name fedora
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 930.31 GiB
PE Size 4.00 MiB
Total PE 238160
Alloc PE / Size 5840 / 22.81 GiB
Free PE / Size 232320 / 907.50 GiB
VG UUID l3ifpd-93Wv-Y8Wl-4I31-CBnH-gxt5-2BYg7v
--- Logical volume ---
LV Path /dev/fedora/swap
LV Name swap
VG Name fedora
LV UUID sW7ldx-Jqwk-2Bxu-ptej-ekok-sKRg-Rd3H2a
LV Write Access read/write
LV Creation host, time localhost, 2018-08-04 16:53:32 -0400
LV Status available
# open 2
LV Size 7.81 GiB
Current LE 2000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Path /dev/fedora/root
LV Name root
VG Name fedora
LV UUID SRHprS-qKyi-tNfo-f71c-UOEE-fBQL-y7rBYe
LV Write Access read/write
LV Creation host, time localhost, 2018-08-04 16:53:32 -0400
LV Status available
# open 1
LV Size 15.00 GiB
Current LE 3840
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Physical volumes ---
PV Name /dev/sda3
PV UUID etHzhN-vONC-31VY-qdA5-zcWx-Drsq-52CcO6
PV Status allocatable
Total PE / Free PE 238160 / 232320
[root@thermalite ~]# lvextend -L+100G /dev/fedora/root
Size of logical volume fedora/root changed from 15.00 GiB (3840 extents) to 115.00 GiB (29440 extents).
Logical volume fedora/root successfully resized.
[root@thermalite ~]# vgdisplay -v
--- Volume group ---
VG Name fedora
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
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 930.31 GiB
PE Size 4.00 MiB
Total PE 238160
Alloc PE / Size 31440 / 122.81 GiB
Free PE / Size 206720 / 807.50 GiB
VG UUID l3ifpd-93Wv-Y8Wl-4I31-CBnH-gxt5-2BYg7v
--- Logical volume ---
LV Path /dev/fedora/swap
LV Name swap
VG Name fedora
LV UUID sW7ldx-Jqwk-2Bxu-ptej-ekok-sKRg-Rd3H2a
LV Write Access read/write
LV Creation host, time localhost, 2018-08-04 16:53:32 -0400
LV Status available
# open 2
LV Size 7.81 GiB
Current LE 2000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Path /dev/fedora/root
LV Name root
VG Name fedora
LV UUID SRHprS-qKyi-tNfo-f71c-UOEE-fBQL-y7rBYe
LV Write Access read/write
LV Creation host, time localhost, 2018-08-04 16:53:32 -0400
LV Status available
# open 1
LV Size 115.00 GiB
Current LE 29440
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Physical volumes ---
PV Name /dev/sda3
PV UUID etHzhN-vONC-31VY-qdA5-zcWx-Drsq-52CcO6
PV Status allocatable
Total PE / Free PE 238160 / 206720
[root@thermalite ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs tmpfs 3.9G 8.0K 3.9G 1% /dev/shm
tmpfs tmpfs 3.9G 1.2M 3.9G 1% /run
tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/fedora-root xfs 15G 15G 971M 94% /
tmpfs tmpfs 3.9G 4.5M 3.9G 1% /tmp
/dev/sda2 ext4 976M 197M 713M 22% /boot
/dev/sda1 vfat 200M 8.7M 192M 5% /boot/efi
tmpfs tmpfs 787M 4.0K 787M 1% /run/user/1000
[root@thermalite ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 930.3G 0 part
├─fedora-root 253:0 0 115G 0 lvm /
└─fedora-swap 253:1 0 7.8G 0 lvm [SWAP]
[root@thermalite ~]# pvresize /dev/sda3
Physical volume "/dev/sda3" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
[root@thermalite ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 fedora lvm2 a-- 930.31g 807.50g
[root@thermalite ~]# vgs
VG #PV #LV #SN Attr VSize VFree
fedora 1 2 0 wz--n- 930.31g 807.50g
[root@thermalite ~]# lvextend -l +100%FREE /dev/mapper/fedora-root
Size of logical volume fedora/root changed from 115.00 GiB (29440 extents) to 922.50 GiB (236160 extents).
Logical volume fedora/root successfully resized.
[root@thermalite ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs tmpfs 3.9G 8.0K 3.9G 1% /dev/shm
tmpfs tmpfs 3.9G 1.2M 3.9G 1% /run
tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/fedora-root xfs 15G 15G 970M 94% /
tmpfs tmpfs 3.9G 4.5M 3.9G 1% /tmp
/dev/sda2 ext4 976M 197M 713M 22% /boot
/dev/sda1 vfat 200M 8.7M 192M 5% /boot/efi
tmpfs tmpfs 787M 4.0K 787M 1% /run/user/1000
[root@thermalite ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 fedora lvm2 a-- 930.31g 0
[root@thermalite ~]# df -hT | grep mapper
/dev/mapper/fedora-root xfs 15G 15G 970M 94% /
[root@thermalite ~]# sudo resize2fs /dev/mapper/fedora-root
resize2fs 1.44.2 (14-May-2018)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/fedora-root
Couldn't find valid filesystem superblock.
[root@thermalite ~]# xfs_growfs /
meta-data=/dev/mapper/fedora-root isize=512 agcount=4, agsize=983040 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=1 spinodes=0 rmapbt=0
= reflink=0
data = bsize=4096 blocks=3932160, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=2560, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 3932160 to 241827840
[root@thermalite ~]# df -hT | grep mapper
/dev/mapper/fedora-root xfs 923G 15G 908G 2% /
[root@thermalite ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs tmpfs 3.9G 8.0K 3.9G 1% /dev/shm
tmpfs tmpfs 3.9G 1.2M 3.9G 1% /run
tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/fedora-root xfs 923G 15G 908G 2% /
tmpfs tmpfs 3.9G 4.5M 3.9G 1% /tmp
/dev/sda2 ext4 976M 197M 713M 22% /boot
/dev/sda1 vfat 200M 8.7M 192M 5% /boot/efi
tmpfs tmpfs 787M 4.0K 787M 1% /run/user/1000
[root@thermalite ~]#
No comments:
Post a Comment