Answer the question
In order to leave comments, you need to log in
How to extend root partition in centos?
There is a 1Tb hard drive with CentOS installed, 53 GB in the root partition, and 941 GB in the home partition.
How can I increase the size of the root partition at the expense of the home partition?
fdisk -l gives this information
Answer the question
In order to leave comments, you need to log in
This is not an easy question to ask :)
It's easy to expand an LVM volume. But to free up space in it - it will be more difficult.
By the way, DO NOT climb into LVM volumes using partition editors! (gparted, partition magic, acronis and others like them) - ditch everything the fuck.
First you need to free up space in /home. And this is not easy, because the system will only allow you to trim the volume if the blocks are not used. Then the vacant place is assigned to another volume.
In words, everything is simple. In fact, it will be long and thoughtfulreading the documentation on LVM, a full backup of data (because the chance of ruining everything with inaccurate handling of volume management commands is not just high - it is fucking high!), And only then try to do something. It will not turn out right away :) so if there is an opportunity and there is no time, it is better to ask someone.
in general, for any linux, usually everything is just done with live media, gparted or patritionmanager , if sneakers
.. this is just in case of a simple markup, without LVM (although .. maybe with LVM everything will be just as simple ... almost as in acronis)
ps if suddenly these utilities are not in live (which would be strange) they can be installed in the standard way (although for one session, but more is not needed)
pps and yes - backup of important data is highly desirable BEFORE
ppps fallback (for dummies, but why not?) - from live (under root):
- comment the home line in /etc/fstab
- create a home folder in
root - rsync/grsync/ and even mc - hamster movie
- kill the hamster partition
- expand the root to the physical limit (utilities mentioned above)
... but never forget about backups of everything important before starting the meat grinder..
ppps
By the way, DO NOT climb into LVM volumes using partition editors! (gparted, partition magic, acronis and others like them) - ditch everything the fuck.
Centos is installed on LVM by default.
Look for how to expand the LVM partition.
In general, you need to unmount /home, delete the volume, add space to the volume of the root partition, expand the file system on the root partition. Well, fix fstab so that home is not mounted at startup;)
It's better not to touch it, if not when this was not done on the test server
we can also remember such a "collective farm-style" :)
we are looking for the largest and most unnecessary directory using ncdu or similar programs.
from under the root we transfer it to the section with home (kudan separately, so as not to be scratched :) )
and in the same place we make a soft link to the moved directory for transparent access.
CityCat4 wrote everything correctly. At first glance, the question is simple and easily solved. Until you ruin a couple of servers with archaic important data that no one has ever backed up.
Therefore, it is better to make a backup copy of everything and everything and roll the server over again. I'm sure there is still something to change / improve, but for this you need to reinstall the OS - it's always like that.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question