Howdy, Stranger!

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


CentOS root partition is full how to add more space?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

CentOS root partition is full how to add more space?

KodisKodis Member

Sorry for a dumb question.
I have online.net dedicated server and now root partition is almost full see image below:
https://i.gyazo.com/bb0ac1c274ec1323731b0272eb52e13a.png
Is there any chance to allocate more space on a working server without losing data?

Thank You

Comments

  • Remove the tmpfs. And allocate it to /.
    Not sure though.

  • why tmpfs ?
    root is /dev/mdl

  • As an emergency thing try tune2fs - r 0 /dev/md1

  • @perryoo11 said:
    Remove the tmpfs. And allocate it to /.
    Not sure though.

    Tmpfs is a ramdisk anyway.

  • Try with parted you should be able to resize partitions

  • Try to clean up your OS log?

  • If you need to ask this, then perhaps you should trade your dedicated for a managed VPS, IMHO.

  • defaultdefault Veteran
    edited October 2018

    I can think of a few solutions:

    easy: ask support from online.net to attach another drive to your machine, and use that for whatever application needs space.

    hard: backup your whole system with rsync, on an NFS attached VPS that has a lot more space, and re-initiate the whole system from there. I recommend cloud VPS because later you can easily attach more space to it as needed, to not get in this mess again (you can use Scaleway because it's already hosted by Online, so you get fast network transfer).

    Remember: it's not hard to do, it's hard to think before you do it.

  • @default said:
    I can think of a few solutions:

    easy: ask support from online.net to attach another drive to your machine, and use that for whatever application needs space.

    hard: backup your whole system with rsync, on an NFS attached VPS that has a lot more space, and re-initiate the whole system from there. I recommend cloud VPS because later you can easily attach more space to it as needed, to not get in this mess again (you can use Scaleway because it's already hosted by Online, so you get fast network transfer).

    Remember: it's not hard to do, it's hard to think before you do it.

    If you are opting to re-install the system, may I give you a few suggestions:

    1) use LVM on top of your RAID
    2) leave at least 10% or 15% of your overall space free on the Virtual Group (VG) that are holding your Logical Volumes (LV) (i.e. root, data, etc)

    With that setup you have space to increase any of your LVs as needed and also give you some space to create snapshots as well.

    LVs can be safely increased on demand and online.

    LVMs will even give you an "easier" way to reduce Logical Volumes if/when needed.

    No matter how safe these operations may be always keep your backups up-to-date.

  • I notice 2 things that suggest a possible solution to running out of space in your root partition (a workaround to avoid resizing).

    First, you seem to have about 1.7 TB available on another partition (/dev/md2). So that provides plenty of room to move stuff around. (Though I would really want backups on a separate system in any case.)

    Second, I don't see a separate partition for /home or /var or /opt (etc) - so I assume these are all currently taking up some of that precious 20 GB root partition.

    I would consider moving one or more of these directories to the /dev/md2 partition and changing the mountpoints via fstab - in order to make more of the 20 GB root partition available for essential root partition type stuff while avoiding the risk of something going sideways during the more acrobatic manuevers required to actually resize the partitions.

    LVM would make resize much easier - something to keep in mind for future setups.

  • He got a 1.7TB drive with no usage on it. Maybe some wrong hdd parted when install the server? (should have chosen to use the whole disk to use as /?) it's mounted as /data but barely anything in it.

    Best solution is that you remove that partition and resize root to use up the whole disk (will need to boot into rescue mode and do some work).

  • Looks like a standard lame CentOS/RH 6 setup.

    Now if this was LVM on top of an MD RAID, it'd be easy. Since it's just MD, you're going to need to resize /dev/md2 (offline), extend /dev/md1, and then resize the filesystem.

  • How is 20G not enough for / and OS? You must have application and/or data things in /. Do some du investigation to find out what you might have configured wrong.

  • I done investigation and i have CentOS 7.2 version and directadmin installed on it.
    So Directadmin installation done wrong and Home dir and mysql stuff stored in /root partition by defoult. Now i need somehow to move all things to /data.

  • You can decrease the space of /data and resize the /root partition .

  • Increase root partition may harm my files? If i will add more space to it?

  • I don't think resizing partitions is the right strategy. Probably will want to stop services, copy/move home and MySQL data to new locations in /data/path/to/new/dirs, then symlink MySQL and home to new locations, then restart services. That's just high level, but that's probably the idea of the direction you might want to look at.

    Thanked by 1AlwaysSkint
  • Thank you all for trying to help me.
    I managed to increase root partition size, but lost /data partition so i will do backups and will try to reinstall whole server.

    Thanked by 1uptime
Sign In or Register to comment.