Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Need some help - changing /home to root, or mount it on / (CentOS 6.6 + Virtualmin)
New on LowEndTalk? Please Register and read our Community Rules.

Need some help - changing /home to root, or mount it on / (CentOS 6.6 + Virtualmin)

Setting up a new VPS with Hyper-V, and I see that CentOS is doing it some other way that I'm used to with KVM servers.
Normally I get all the space on the disk on the "main disk/partition". But with this installation, it has created a small /home with only 7 GB free diskspace, and the rest of the 60 GB disk is on /, there I can't use it with Virtualmin (maybe there is a setting, but I have not found it.

My /etc/fstab file looks like this:

[[email protected] ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_vpsxxxx-lv_root 50G 1.8G 45G 4% / tmpfs 935M 0 935M 0% /dev/shm /dev/sda1 477M 48M 405M 11% /boot /dev/mapper/vg_vpsxxxx-lv_home 7.4G 18M 7.0G 1% /home [[email protected] ~]#

When I install Virtualmin, it's sees the disk space on / + /home

But when I upload my backup files, all the files goes to /home, and after 7 GB it's full.

How can I get the /home to get more disk space or get the /home directly on / so Virtualmin (Apache) is using all disk space I have to my websites?

Or do I have to do a new installation to get this right?

The strange thing is that I made three CentOS 6.6 64bit Virtual Machines on the same Hyper-V server, and this is the only one with this issue.

Kenneth Myhre
WindowsTemplate.com - free Windows templates for OVH/Hetzner/Kimsufi/Online.net

Powered by Hetzner.com, backed up by OVH, Kimsufi and VULTR.com

Comments

  • ALinuxNinjaALinuxNinja Member
    edited February 2015

    You have plenty of space on /.

    Just do something like

    sudo cp -pdR /home /home2 #Make sure everything is copied before continuing. If you dont, your data will be GONE

    >

    sudo nano /etc/fstab #Remove or comment out line that matches with /home

    >

    sudo umount /home #Do not continue until it has unmounted, or you will be moving /home2 back onto /home partition!

    >

    sudo rmdir /home #If there are errors here, check to see what files are still there and are preventing it from getting deleted.

    >

    sudo mv /home2 /home

    Use LVM tools (lvdisplay, lvremove, lvresize) to put the space back on the main LV, and then grow whatever filesystem your using

    Maybe something like

    sudo lvremove /dev/mapper/vg_vpsxxxx-lv_home

    >

    sudo lvresize -l +100%FREE /dev/mapper/vg_vpsxxxx-lv_root

    Then, do whatever to grow your filesystem on /

    Some filesystems do not allow online resizing and will require you to boot to livecd or recovery mode

    EDIT:

    I have made a few corrections as of 16:46 PST

    Thanked by 1myhken

    Devops Consultant | GitHub

  • @StartledPhoenix

    All that worked, but when I try to create a domain in Virtualmin or restore backups, I get this error:

    Failed to create virtual server : setquota: Mountpoint (or device) /home not found or has no quota enabled. setquota: Not all specified mountpoints are using quota.

    Kenneth Myhre
    WindowsTemplate.com - free Windows templates for OVH/Hetzner/Kimsufi/Online.net

    Powered by Hetzner.com, backed up by OVH, Kimsufi and VULTR.com

  • ALinuxNinjaALinuxNinja Member
    edited February 2015

    @myhken said:
    StartledPhoenix

    All that worked, but when I try to create a domain in Virtualmin or restore backups, I get this error:

    Failed to create virtual server : setquota: Mountpoint (or device) /home not found or has no quota enabled. setquota: Not all specified mountpoints are using quota.

    Huh.

    I dont use virtualmin, but that looks like virtualmin still thinks there is a /home partition.

    Devops Consultant | GitHub

  • @StartledPhoenix said:
    I dont use virtualmin, but that looks like virtualmin still thinks there is a /home partition.

    Can I take space from / and add to /home then?
    (and then, how to create /home again?)

    Kenneth Myhre
    WindowsTemplate.com - free Windows templates for OVH/Hetzner/Kimsufi/Online.net

    Powered by Hetzner.com, backed up by OVH, Kimsufi and VULTR.com

  • @myhken said:

    You can resize / (depending on filesystem, can be done online, or offline) and then use lvresize to squish the Logical Volume. Be sure not to squish it beyond the amount you have squished the partition

    lvcreate can then be used to create a new logical volume, in which you can format and mount as home.

    Devops Consultant | GitHub

  • I think I just will try a fresh install. I have now created my custom disk setup, on a 80 GB disk, I have put 10 GB at / , 5 GB at swap, 500 MB at /boot and the rest on /home
    Since Virtualmin is using /home for all domains and files, and CentOS takes only around 700 MB + some 100 MBs to Virtualmin etc, 10 GB at / is really too much. But then I have some to go on.
    I only take backup with Virtualmin, and it don't care about size etc, so as long as I have enough disk space there I restore it, it's no problem.

    Was planning to have the server up and running, and replacing another server tonight, but now it's bedtime here in Norway.

    Have to do the work tomorrow.

    Kenneth Myhre
    WindowsTemplate.com - free Windows templates for OVH/Hetzner/Kimsufi/Online.net

    Powered by Hetzner.com, backed up by OVH, Kimsufi and VULTR.com

Sign In or Register to comment.