how to expand space (centos7)?

faustineaiden

New Member
Joined
May 26, 2021
Messages
7
Reaction score
1
Credits
106
the /dev/sda2 is root. it is used. so I need to enlarge. How to convert the space of /dev/mapper/centos-root to the space of /dev/sda2?

Thanks.
best wishes.

1622135707942.png
 


Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,074
Reaction score
1,012
Credits
10,354
Before you resize your partition you should copy it to an external HDD or clone it with Clonezilla.

What size is the drive?


 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
4,124
Reaction score
2,871
Credits
29,784
It would have been easier if you had actually had root as a logical volume, I don't see what you didn't setup the actual root partition as a logical volume since you did it for your /data volume.
 

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,074
Reaction score
1,012
Credits
10,354
It would have been easier if you had actually had root as a logical volume, I don't see what you didn't setup the actual root partition as a logical volume since you did it for your /data volume.
Without the partition being a logical volume will that make it difficult to resize?
 

peichen

New Member
Joined
May 28, 2021
Messages
3
Reaction score
1
Credits
23
You need extend the lvs first in volume group before you expand the /dev/mapper

1. Check the lvs by using command lvs or lsblk
2. Check the vgs (volume group space status) whether the volume group have enough space or not (if not then you need to increate disk)
3. Only lvsextend the lvs size
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
4,124
Reaction score
2,871
Credits
29,784
Without the partition being a logical volume will that make it difficult to resize?
It can be done be resize the partitions using fdisk or gparted but others here on the forums will be better to able to help with that.


You need extend the lvs first in volume group before you expand the /dev/mapper

1. Check the lvs by using command lvs or lsblk
2. Check the vgs (volume group space status) whether the volume group have enough space or not (if not then you need to increate disk)
3. Only lvsextend the lvs size
The OP's root volume is a normal partition and not using lvm so this won't do any good, only the volume mount on /data is setup as lvm with a logical volume called root.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!


Top