0

I'm not really good at this mounting/unmouting thing on Centos, so here goes my question:

With df -h I get the following overview:

Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   50G   50G   20K 100% /
devtmpfs                  48G     0   48G   0% /dev
tmpfs                     48G     0   48G   0% /dev/shm
tmpfs                     48G  201M   47G   1% /run
tmpfs                     48G     0   48G   0% /sys/fs/cgroup
/dev/mapper/centos-home  5.4T   33M  5.4T   1% /home
/dev/sda2               1014M  184M  831M  19% /boot
tmpfs                    9.5G     0  9.5G   0% /run/user/0

How do I get all of / onto /home and make that my default? I cant run anything becuase / is full and seems to be the default.

Here is the partition mapping.partition mapping

  • 1
    /home/ is where users' stuff should be located, but it looks like it's not your case (only 33M of used space). Are you the only user? If so, what is the output of echo $HOME? – fra-san Nov 4 '18 at 22:11
  • 1
    You will have to move files. It is probably easier to resize and reduce the size of /home and increase/ – Panther Nov 4 '18 at 22:26
  • You need to reduce the size of /dev/maper/centos/home logical volume to free up disk space, and make /var' its own fileystem so that you do not fill up '/' again. – fpmurphy Nov 4 '18 at 22:48
  • What's that machine doing? On a desktop machine you would normally have most of the usage in /home and much less usage in /. On a server it is more likely to see lots of usage in /var (though it depends on what kind of server). – kasperd Nov 4 '18 at 23:47
  • for this very reason is why I hate having /home or anything other than /boot on a separate partition. NO VALUE ADDED – ron Nov 5 '18 at 2:37
1

Don’t. It’s not the mount points that need to change. It’s your partition sizes. Your safest option is to use gparted.

It’s a graphical front end for a very powerful partitioning program. You need to slide the partitions around to give root more space. This may quite literally take hours or days, depending on how far your root partition is from your home partition. If you need additional assistance. Post your partition mapping.

lvm resizing

  • OP is using lvm and I am not sure gparted will resize lvm – Panther Nov 5 '18 at 7:04
  • More difficult but still doable. I added a link to an example above. – mreff555 Nov 5 '18 at 12:32
  • gparted can't resize logical volumes... you have to use the command line lvm tools and filesystem resizers. While booted from removable media. This is why you shouldn't just blindly allocate 100% of your space to logical volumes at install time; it would be much easier to just increase the root now if space were still left unallocated. – psusi Nov 7 '18 at 18:18
0

You cannot simply move "all" of / onto /home. The df -h output clearly shows that, everything is being stored in / which is not a good practice at all. Spare the / partition from any application or user data. Now, to get rid of this situation, use any of the following. 1) if there is enough free space on the vg, you can extend centos-root lv on the fly. 2) If there is not free space on the vg, move userfiles/application from /. This can be useful even if you choose 1. 3) If there is not free space on the vg and centos-home is not xfs then unmount /home, shrink centos-home lv, and add that free space to centos-root.

Use a seperate partition/lv (preferably /opt) for installing application

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.