0

I have my current partition disk space (found at /dev/mapper/cl-root) set at 50Go on my CentOS server. I want to extend the current disk space (to become 500Go) used in a neat way with commands.

How to do it ?

UPDATE : parted -l lsblk returns /dev/sda, /dev/sdb, /dev/sdc actual sizes and other infos. But what i want is to extend the root partition under /dev/mapper/cl-root which is listed among others with fdisk -l cmd enter image description here enter image description here enter image description here

welwelwel
  • 99
  • 1
  • 1
  • 7
  • Is `LVM` used and which filesystem is the partition formatted with? Send the output of `parted -l`, `lsblk -o name,fstype,size,fssize,mountpoint,model,vendor`, `pvs`, `vgs`, `lvs` commands. – Krackout Sep 23 '20 at 15:11
  • I will update my answer with the output of that command shortly. – welwelwel Sep 23 '20 at 16:00
  • i don't think it's LVM based partitions though, filesystem must be FAT32 i guess. – welwelwel Sep 23 '20 at 17:39
  • File system unallocated. – welwelwel Sep 24 '20 at 09:39
  • Since you've got `/dev/mapper/cl-root` LVM is used. Copy - paste the output of the 5 commands in my first comment if you want to get help. – Krackout Sep 24 '20 at 10:13
  • @Krakout pls see UPDATE – welwelwel Sep 24 '20 at 11:38
  • Why have you posted screenshots of text? You should post the text instead. – Michael Hampton Sep 24 '20 at 17:54
  • yes sorry for that, hope it will do. – welwelwel Sep 24 '20 at 18:06
  • What a mix and match of disks :) Your first disk, 900GB: Is it really not used or does it have something very exotic (and incomprehensible) installed? Your `/home` volume is LVM RAID residing on a part of the 2nd and on the 3rd disk. So, how do you want to proceed? `sdb` where `/` resides has no more space available. If `sda`, 1st disk, is really empty, you can use this to add space on `/` using LVM. There are alternates, shrinking `/home` for example if `ext4` is used (you added spaces on `lsblk` command so the full info is not provided). But they involve much more work to be done. – Krackout Sep 24 '20 at 20:32
  • I myself was thinking of creating a partition (and mount it?) from `/dev/sda` (that of 900Go) and add that new partition of PV to the VG of `cl` and extend `/dev/sdb3/cl-root` LV with that amount added . So the first cited option is good i think. Please show me the steps with the cmds to use tailored to my case. Thanks. PS : the first disk is unallocated space nothing installed on it and can be used of course. – welwelwel Sep 24 '20 at 20:37

2 Answers2

1

After evaluating the output of commands and the comments, you need:
(execute these commands as a sudoer user, adding sudo in front or as root)

parted /dev/sda mklabel gpt
parted -a opt /dev/sda mkpart lvm 0% 50%
pvcreate /dev/sda1
vgextend cl /dev/sda1
lvextend -r -l 100%VG cl/root
Krackout
  • 1,575
  • 7
  • 20
0

Here's a generic answer I gave a few years back, most if not all of it should still work;

How to resize the disk of a Fedora guest VM in VMWare ESXi

Chopper3
  • 101,299
  • 9
  • 108
  • 239