Partition errors - Noob

General support questions
Post Reply
tgw
Posts: 3
Joined: 2018/05/17 22:31:52

Partition errors - Noob

Post by tgw » 2018/05/17 23:31:41

I have been 'feet wet' with CentOS 7 for about 6 weeks now. Been a Windows user for about 25+ years.
I am currently using VMware Workstation for virtualizing CentOS before trying my hand at a production server to run some software I plan on using. I have been getting better with lvm resizing and understanding it's structure and operation. The sizes of the current lvm mounts (root, swap, home) are correct (in size) for what they planned to be used for (I hope that I am addressing the terms correctly <lvm mounts>).

*One caveat to what this solution is to be. The solution must be done through a Putty terminal (remotely, no boot CD) and not directly on the VM, as this would be the same scenario with the production server also.

But alas, my first unsolvable (for me) problem. I cannot release unused space (PFree) on the /dev/sda2/ (i hope I am addressing this correctly) to be used for another mountpoint (/dev/sda3/) that I would like to create. I realize this will be probably quite simple for other's to solve. . .

[root@server ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a-- <599.00g <392.00g

[root@server ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 3 0 wz--n- <599.00g <392.00g

[root@server ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home centos -wi-ao---- 125.00g
root centos -wi-ao---- 50.00g
swap centos -wi-ao---- 32.00g


[root@server ~]# fdisk -l

Disk /dev/sda: 644.2 GB, 644245094400 bytes, 1258291200 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 label type: dos
Disk identifier: 0x000b2e8b

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 1258291199 628096000 8e Linux LVM

Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 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 /dev/mapper/centos-swap: 34.4 GB, 34359738368 bytes, 67108864 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 /dev/mapper/centos-home: 134.2 GB, 134217728000 bytes, 262144000 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


Any help with this problem, is greatly appreciated!

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

Re: Partition errors - Noob

Post by TrevorH » 2018/05/17 23:59:12

/dev/sda2 is your LVM Physical Volume in the Volume Group 'centos'. It contains all of your LVM LVs which currently occupy 125+50+32 = 207GB.

What do you want to use /dev/sda3 for? Why are you not using another LVM LV instead?
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

tgw
Posts: 3
Joined: 2018/05/17 22:31:52

Re: Partition errors - Noob

Post by tgw » 2018/05/18 02:59:08

Trevor,

Thank you for the reply! Yes, I had considered that as an option, as I was looking to recover the other free space to be used in a empty (no mounts) volume. The virtualization software I am going to use requires an empty volume group as a storage area.

solution? . . .
Create another Volume Group space on /dev/sda2, correct?

Please, excuse my ignorance, but I have tried this with an error

[root@server /]# vgcreate vstor /dev/sda2
Can't open /dev/sda2 exclusively. Mounted filesystem?

I am missing something in this syntax?

Thanks

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Partition errors - Noob

Post by hunter86_bg » 2018/05/18 03:49:39

Your /dev/sda2 is already part of the 'centos' Volume Group and each Phisical Volume (in your case /dev/sda2 ) can be part of only one VG.
It will require downtime and some remote acces (maybe iLO or iDRAC) to shrink your PV, and the procedure is treated as risky and I wouldn't recommend it.

What is yoir Virtualization ? Maybe we can propose an idea to match your setup.

tgw
Posts: 3
Joined: 2018/05/17 22:31:52

Re: Partition errors - Noob

Post by tgw » 2018/05/18 04:25:58

hunter_86

Thanks for the reply!

Software is located here for the following configuration (LXC)
http://www.virtualizor.com/wiki/Install_LXC

Config is pretty cut and dry. Problem is, my dedicated host provider will not modify the current server config for me, as it is 'non-managed'
The setup there is as follows:

[root@C504D18 ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda4 vg00 lvm2 a-- <707.37g <677.37g

[root@C504D18 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vg00 1 3 0 wz--n- <707.37g <677.37g

[root@C504D18 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home vg00 -wi-ao---- 10.00g
usr vg00 -wi-ao---- 10.00g
var vg00 -wi-ao---- 10.00g

[root@C504D18 ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sda: 799.5 GB, 799535005696 bytes, 1561591808 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 label type: gpt
Disk identifier: F7D23920-D629-4319-B5EE-D72248D5F164


# Start End Size Type Name
1 2048 6143 2M BIOS boot parti primary
2 6144 58593279 28G Linux filesyste primary
3 58593280 78125055 9.3G Linux swap primary
4 78125056 1561589759 707.4G Linux LVM primary

Disk /dev/mapper/vg00-usr: 10.7 GB, 10737418240 bytes, 20971520 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/vg00-var: 10.7 GB, 10737418240 bytes, 20971520 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/vg00-home: 10.7 GB, 10737418240 bytes, 20971520 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


* * * ANY help in this matter, would be GREATLY appreciated! * * *

Post Reply