Expanding a Partition

Issues related to applications and software problems
Post Reply
BaghdadIT
Posts: 18
Joined: 2020/05/13 19:29:45

Expanding a Partition

Post by BaghdadIT » 2023/04/26 19:52:07

Good day CentOS masters

I currently have a CentOS system that I need to expand a certain Partition on. It is a VM with three (3) VMDKs the second one is a 1.5 TB drive that is sdb

sdb 1.5TB
datavg-pgdata 400GB lvm /opt/data/inv/pgdata-9.6
datavg-inv 4GB lvm /opt/data/jlg/inv
datavg-mdldata 550GB lvm /opt/data/inv/mdl
data-vg-enrolldata 50GB lvm /opt/data/inv/enroll_audio

As you can see the drive itself is 1.5 TB, but according to the lsblk command only 1004GB (1.004TB) is being used which should give me close to 500GB free, I need to expand the datavg-pgdata Logical Volume (lvm) because it is at 93 percent, But I am not seeing where my system actually says I can use that potential "free space". I am not an expert at any Linux based O/S by any stretch of the imagination so I am not even sure if this is the proper way to read it. Can anyone tell me the best way to A. know if I can actually use the potential free space on sdb. Or, how to expand that lvm another way?

the vgs command display

VG #PV #LV #SN Attr VSize VFree
backupvg 1 1 0 wz--n- <500.00g <100.00g
centos 1 3 0 wz--n- <119.00g 4.00m
datavg 1 4 0 wz--n- <1024.00g <20.00g

ENTIRE lsblk command

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 120G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 119G 0 part
├─centos-root 253:0 0 50G 0 lvm /
├─centos-swap 253:1 0 7.9G 0 lvm [SWAP]
└─centos-home 253:2 0 61.1G 0 lvm /home
sdb 8:16 0 1.5T 0 disk
├─datavg-pgdata 253:3 0 400G 0 lvm /opt/data/inv/pgdata-9.6
├─datavg-inv 253:4 0 4G 0 lvm /opt/data/jlg/inv
├─datavg-mdldata 253:5 0 550G 0 lvm /opt/data/inv/mdl
└─datavg-enrolldata 253:6 0 50G 0 lvm /opt/data/inv/enroll_audio
sdc 8:32 0 500G 0 disk
└─backupvg-mdlbackup 253:7 0 400G 0 lvm /backup/mdlbackup
sr0 11:0 1 1024M 0 rom

FDSIK -l for sdb

Disk /dev/sdb: 1649.3 GB, 1649267441664 bytes, 3221225472 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

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Expanding a Partition

Post by TrevorH » 2023/04/26 21:00:55

What happens if you run pvresize /dev/sdb ? Might want to read the man page for pvresize before you run that to find out what it does.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

BaghdadIT
Posts: 18
Joined: 2020/05/13 19:29:45

Re: Expanding a Partition

Post by BaghdadIT » 2023/04/27 01:16:20

Trevor

I havd not done that and after I did run the command (after taking two snapshots of my VM) my PVS command prints

PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a-- <119.00g 4.00m
/dev/sdb datavg lvm2 a-- <1.50t <532.00g
/dev/sdc backupvg lvm2 a-- <500.00g <100.00g

And my VGS command does show a change from 1024GB to 1.5TB My free space expanded considrably

VG #PV #LV #SN Attr VSize VFree
backupvg 1 1 0 wz--n- <500.00g <100.00g
centos 1 3 0 wz--n- <119.00g 4.00m
datavg 1 4 0 wz--n- <1.50t <532.00g
[
Thnak you for that, I did not even consider the pvresize, Now I just need to expand the datavg-pgdata lvm, can you give me a push on that portion of it?

sdb 8:16 0 1.5T 0 disk
├─datavg-pgdata 253:3 0 400G 0 lvm /opt/data/inv/pgdata-9.6
├─datavg-inv 253:4 0 4G 0 lvm /opt/data/jlg/inv
├─datavg-mdldata 253:5 0 550G 0 lvm /opt/data/inv/mdl
└─datavg-enrolldata 253:6 0 50G 0 lvm /opt/data/inv/enroll_audio

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Expanding a Partition

Post by TrevorH » 2023/04/27 09:09:55

man lvresize

Probably something like lvresize -L+250G -r datavg/pgdata

adjusting amount to add (the + in the -L+ says add to, if missing it will resize it _down_ to 250GB in my example!)
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

BaghdadIT
Posts: 18
Joined: 2020/05/13 19:29:45

Re: Expanding a Partition

Post by BaghdadIT » 2023/04/27 21:11:34

Trevor

Thanks again, It worked perfectly. I had read all that you suggested, But the fact that the drive said one thing but the software said another really confused me and I did not want to do anything unless I was absolutely sure. I appreciate you giving me the reassurance!

tunk
Posts: 1206
Joined: 2017/02/22 15:08:17

Re: Expanding a Partition

Post by tunk » 2023/04/27 21:36:26

The difference could be that some is counted in TB (1E12) and some in TiB (2^40 = 1.0995E12).

BaghdadIT
Posts: 18
Joined: 2020/05/13 19:29:45

Re: Expanding a Partition

Post by BaghdadIT » 2023/04/28 16:21:23

I am not familiar with those units of measure for size, can you explain the difference?

tunk
Posts: 1206
Joined: 2017/02/22 15:08:17

Re: Expanding a Partition

Post by tunk » 2023/04/28 16:29:16


User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Expanding a Partition

Post by TrevorH » 2023/04/28 16:56:21

Those of us old enough to remember know that a computer megabyte was always 1024x1024 bytes then someone from the international standards organisation put their oar in and said that 'mega' was already used and meant 1000x1000 so we all had to tear up our definition of MB and rewrite it as MiB (not Men in Black!). Same for KB, GB and TB which now all have to have an i in them to mean what everyone used to already know.

:evil:
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: Expanding a Partition

Post by Whoever » 2023/04/29 16:27:42

TrevorH wrote:
2023/04/28 16:56:21
Those of us old enough to remember know that a computer megabyte was always 1024x1024 bytes then someone from the international standards organisation put their oar in and said that 'mega' was already used and meant 1000x1000 so we all had to tear up our definition of MB and rewrite it as MiB (not Men in Black!). Same for KB, GB and TB which now all have to have an i in them to mean what everyone used to already know.

:evil:
I think it had more to do with hard drive manufacturers wanting people to think there was more space on the hard drives they were selling.

Post Reply