Redhat Linux logical volume extension

I needed to extend a LV as it was small for what I needed to do. As you can see below, it was originally 20G in size. As root, I did the following steps:


# df -h /u01
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-lvU01 20G 9.1G 11G 46% /u01



1. First, I had to check for free size on the Volume Group.

# vgdisplay
--- Volume group ---
VG Name vg00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 7
Open LV 7
Max PV 0
Cur PV 1
Act PV 1
VG Size <222.02 GiB
PE Size 4.00 MiB
Total PE 56836
Alloc PE / Size 20480 / 80.00 GiB
Free PE / Size 36356 / <142.02 GiB
VG UUID poBYqN-t5P3-t6rE-UfeI-eaXj-OoMe-l1a39z



2. From above example, there is/was 142G free so I am extending the LV by 20G


# lvextend -L +20G /dev/mapper/vg00-lvU01
Size of logical volume vg00/lvU01 changed from 20.00 GiB (5120 extents) to 40.00 GiB (10240 extents).
Logical volume vg00/lvU01 successfully resized.



3. After extending my LV, I have to grow it out using xfs_growfs. I tried resizefs but received an error.


# xfs_growfs /dev/mapper/vg00-lvU01
meta-data=/dev/mapper/vg00-lvU01 isize=512 agcount=4, agsize=1310720 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=5242880, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log 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 5242880 to 10485760



4. Rechecked that it now reflects my correct size of 40G.


# df -h /u01
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-lvU01 40G 9.2G 31G 23% /u01

Comments

Popular posts from this blog

RMAN-10038: database session for channel prm3 terminated unexpectedly

ORA-17630: Mismatch in the remote file protocol version client 2 server 3

ORA-00338: log {n} of thread {n} is more recent than control file