Partition resize on live server

Discussion in 'Server Operation' started by Goater, Jan 29, 2014.

  1. Goater

    Goater New Member

    Hi,

    I have set up a server recently which now contains live sites. But I have realised that the partitions are wrong on the server.

    The root partition only has 20GB and the /home partition has 1.8TB. The /home partition is not used at all so I was hoping to decrease the /home to something like 20GB and increase the / partition to 1.8.

    The only other thing is that the server is running 2 HDD's RAID1 (software).

    First of all would it be possible to resize these partitions above without destroying the data on the disks.

    If so how would it be done.Any help would be very much appreciated.

    Here is the output of some commands that I think may be useful.

    lsblk
    Code:
    [[email protected] ~]# lsblk
    NAME    MAJ:MIN RM    SIZE RO TYPE  MOUNTPOINT
    sda       8:0    0    1.8T  0 disk
    ├─sda1    8:1    0 1004.5K  0 part
    ├─sda2    8:2    0   19.5G  0 part
    │ └─md2   9:2    0   19.5G  0 raid1 /
    ├─sda3    8:3    0    1.8T  0 part
    │ └─md3   9:3    0    1.8T  0 raid1 /home
    └─sda4    8:4    0    511M  0 part  [SWAP]
    sdb       8:16   0    1.8T  0 disk
    ├─sdb1    8:17   0 1004.5K  0 part
    ├─sdb2    8:18   0   19.5G  0 part
    │ └─md2   9:2    0   19.5G  0 raid1 /
    ├─sdb3    8:19   0    1.8T  0 part
    │ └─md3   9:3    0    1.8T  0 raid1 /home
    └─sdb4    8:20   0    511M  0 part  [SWAP]
    
    df -h
    Code:
    [[email protected] ~]# df -h
    Filesystem      Size  Used Avail Use% Mounted on
    rootfs           20G  2.5G   16G  14% /
    /dev/root        20G  2.5G   16G  14% /
    devtmpfs         16G  472K   16G   1% /dev
    /dev/md3        1.8T  196M  1.7T   1% /home
    tmpfs            16G     0   16G   0% /dev/shm
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client1/web1/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client2/web2/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client2/web3/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client1/web5/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client2/web6/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client3/web7/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client3/web8/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client3/web9/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client1/web1/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client2/web2/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client2/web3/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client1/web5/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client2/web6/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client3/web7/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client3/web8/log
    /dev/root        20G  2.5G   16G  14% /var/www/clients/client3/web9/log
    
    fdisk -l
    Code:
    [[email protected] ~]# fdisk -l
    
    WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
    
    
    Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
    255 heads, 63 sectors/track, 243201 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1      243202  1953514583+  ee  GPT
    Partition 1 does not start on physical sector boundary.
    
    WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
    
    
    Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
    255 heads, 63 sectors/track, 243201 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1      243202  1953514583+  ee  GPT
    Partition 1 does not start on physical sector boundary.
    
    Disk /dev/md3: 1978.9 GB, 1978886193152 bytes
    2 heads, 4 sectors/track, 483126512 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/md2: 21.0 GB, 20970405888 bytes
    2 heads, 4 sectors/track, 5119728 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    
     

Share This Page