Reallocating Partitions

Discussion in 'Server Operation' started by Mario90, Oct 1, 2014.

  1. Mario90

    Mario90 New Member

    i'm currently owning a server with ISPConfig.
    Here is my partition info:

    sda 8:0 0 110,8G 0 disk
    ├─sda1 8:1 0 19,5G 0 part /
    ├─sda2 8:2 0 90,8G 0 part /home
    └─sda3 8:3 0 511M 0 part [SWAP]

    Sda2 is currently empty and i would like to delete the partition and assign the space to sda1.
    Is this a safe operation to do? It's an hosting server and i must not break it!
    How to do that by terminal in a safe way?
    Thank you very much.
  2. srijan

    srijan New Member HowtoForge Supporter

    It depends on the preconfiguraton.
    You need to copy the data from one partition to the other. You need to delete the old home partition and resize the root partition. That cannot be done on a running system, so a live CD seems like as good as it gets.

    Boot the live CD.
    Mount the root partition to /mnt/root.
    Mount the home partition to /mnt/oldhome.

    Copy the data using rsync:

    Open /mnt/root/etc/fstab and delete the entry for your home partition.
    Unmount the root and home partition and reboot the system. If everything works as expected you can reboot again into the live system and then:
    Open Gparted.
    Delete the old home partition, resize the root partition.

    Note:please perform proper backups before performing the task.

Share This Page