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

  • 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 at 15:11
  • I will update my answer with the output of that command shortly. – welwelwel Sep 23 at 16:00
  • i don't think it's LVM based partitions though, filesystem must be FAT32 i guess. – welwelwel Sep 23 at 17:39
  • File system unallocated. – welwelwel Sep 24 at 9: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 at 10:13
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
| improve this answer | |
  • ok thanks, and no xfs_global or resize2fs needed in the end ? – welwelwel Sep 25 at 10:57
  • -r on lvextend does this, resizes filesystem. – Krackout Sep 25 at 11:05
  • Alright i will try this thanks ! – welwelwel Sep 25 at 11:08
  • Just copy-paste the commands exactly as you see them. Sorry lad, it's too tiring and out of scope of this site to give such precise details. In case something doesn't work, check the man pages. The principle of the commands apply. – Krackout Sep 25 at 12:25
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

| improve this answer | |
  • Thanks i'll check this out. – welwelwel Sep 24 at 11:18
  • sry it's not helping – welwelwel Sep 25 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.