Resizing "/" Partition

General support questions
ae9803
Posts: 7
Joined: 2014/02/21 13:51:47

Resizing "/" Partition

Post by ae9803 » 2015/09/24 17:45:04

Hi Guys,
I am needing some help, my current "/" is full, and I need to allocate more space to it, it is currently on 20gb and is almost full. However, I have about 2 tb of free space on another partition /home, how can I allocate more space to that partition? I am currently running Centos 6.6 on cpanel

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Resizing "/" Partition

Post by TrevorH » 2015/09/24 18:14:07

Post the output from the following commands:

Code: Select all

fdisk -l
pvs
vgs
lvs
df -m
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ae9803
Posts: 7
Joined: 2014/02/21 13:51:47

Re: Resizing "/" Partition

Post by ae9803 » 2015/09/24 18:20:07

TrevorH wrote:Post the output from the following commands:

Code: Select all

fdisk -l
pvs
vgs
lvs
df -m
I told you the wrong partitions btw but here is is:
fdisk -l

Code: Select all

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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      243202  1953514583+  ee  GPT

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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      243202  1953514583+  ee  GPT

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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

pvs doesnt do anything
vgs doesnt do anything
lvs doesnt do anything

df -m

Code: Select all

Filesystem     1M-blocks  Used Available Use% Mounted on
devtmpfs           16070     1     16070   1% /dev
tmpfs              16082     7     16075   1% /dev/shm
/dev/md2           19842 13418      5425  72% /
devtmpfs           16070     1     16070   1% /dev
/dev/md3         1857474 14904   1748210   1% /home
/dev/loop1           485    11       449   3% /tmp
/dev/loop1           485    11       449   3% /var/tmp
/dev/md2           19842 13418      5425  72% /var/named/chroot/etc/named
/dev/md2           19842 13418      5425  72% /var/named/chroot/etc/named.rfc1912.zones
/dev/md2           19842 13418      5425  72% /var/named/chroot/etc/rndc.key
/dev/md2           19842 13418      5425  72% /var/named/chroot/usr/lib64/bind
/dev/md2           19842 13418      5425  72% /var/named/chroot/etc/named.iscdlv.key
/dev/md2           19842 13418      5425  72% /var/named/chroot/etc/named.root.key
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/var/lib/mysql
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/opt
tmpfs              16082     7     16075   1% /usr/share/cagefs-skeleton/dev/shm
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/local/apache/domlogs
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/var/lib/proxyexec/cagefs.sock
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/lib
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/lib
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/lib64
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/lib64
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/include
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/share/locale
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/share/terminfo
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/share/zoneinfo
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/share/vim
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/local/lib/php
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/local/cpanel/Cpanel
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/local/cpanel/3rdparty/perl
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/local/cpanel/3rdparty/share
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/usr/local/cpanel/3rdparty/php
/dev/md2           19842 13418      5425  72% /usr/share/cagefs-skeleton/opt/suphp/sbin

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Resizing "/" Partition

Post by gerald_clark » 2015/09/24 21:21:25

You're not using LVM, so there is not much you can do.
I don't know what you are doing with sda and sdb. Doesn't loo like anything CentOS to me.

scottro
Forum Moderator
Posts: 2556
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: Resizing "/" Partition

Post by scottro » 2015/09/24 21:56:51

You can try booting with a gparted live CD. It may show you that you have room to shrink other partitions and enlarge your root partition. (It doesn't recognize some partitions, and if you had, say, FreeBSD on an adjacent partition, I don't know if it would work with gparted.)

However, it has a fairly easy to understand GUI and might (or might not) be of use.
However, keep in mind that shrinking or moving partitions can result in data loss, so back up anything important first.
New users should check the FAQ and Read Me First pages

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Resizing "/" Partition

Post by TrevorH » 2015/09/24 23:21:59

I'm pretty sure that gparted won't know about mdadm software RAID which is what's in use here.

Can you post the output of parted -l please? The fdisk output was useless as you are using GPT labels on your disks. Resizing anything will be complicated by the use of software RAID so be doubly careful. Please also post the output of uname -a and rpm -q centos-release
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ae9803
Posts: 7
Joined: 2014/02/21 13:51:47

Re: Resizing "/" Partition

Post by ae9803 » 2015/09/25 02:30:43

TrevorH wrote:Post the output from the following commands:

Code: Select all

fdisk -l
pvs
vgs
lvs
df -m
Ok,
So I reformated the hard drive, I am on a fresh install, this is what I got.

fdisk -l

Code: Select all

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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      243202  1953514583+  ee  GPT

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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      243202  1953514583+  ee  GPT

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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
df -m

Code: Select all


rootfs             19714   713     18002   4% /
/dev/root          19714   713     18002   4% /
devtmpfs           16079     1     16079   1% /dev
/dev/md3         1857474    68   1763030   1% /home
tmpfs              16112     0     16112   0% /dev/shm
/dev/root          19714   713     18002   4% /var/named/chroot/etc/named
/dev/root          19714   713     18002   4% /var/named/chroot/var/named
/dev/root          19714   713     18002   4% /var/named/chroot/etc/named.conf
/dev/root          19714   713     18002   4% /var/named/chroot/etc/named.rfc1912.zones
/dev/root          19714   713     18002   4% /var/named/chroot/etc/rndc.key
/dev/root          19714   713     18002   4% /var/named/chroot/usr/lib64/bind
/dev/root          19714   713     18002   4% /var/named/chroot/etc/named.iscdlv.key
/dev/root          19714   713     18002   4% /var/named/chroot/etc/named.root.key


ae9803
Posts: 7
Joined: 2014/02/21 13:51:47

Re: Resizing "/" Partition

Post by ae9803 » 2015/09/25 02:33:44

TrevorH wrote:I'm pretty sure that gparted won't know about mdadm software RAID which is what's in use here.

Can you post the output of parted -l please? The fdisk output was useless as you are using GPT labels on your disks. Resizing anything will be complicated by the use of software RAID so be doubly careful. Please also post the output of uname -a and rpm -q centos-release
parted -l

Code: Select all


Model: ATA HGST HUS724020AL (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system     Name     Flags
 1      20.5kB  1049kB  1029kB                  primary  bios_grub
 2      2097kB  21.0GB  21.0GB  ext3            primary  raid
 3      21.0GB  1800GB  1779GB  ext4            linux
 4      2000GB  2000GB  536MB   linux-swap(v1)  primary
I did redo section 3 @ 90% as you can see, I wanted to use the rest or 20 gb towards sector 2

-uname -a

Code: Select all

Linux ns515100.ip-192-99-9.net 3.14.32-xxxx-grs-ipv6-64 #1 SMP Tue Jun 30 18:50:21 CEST 2015 x86_64 x86_64 x86_64 GNU/Linux
rpm -q centos-release

Code: Select all

centos-release-6-7.el6.centos.12.3.x86_64

ae9803
Posts: 7
Joined: 2014/02/21 13:51:47

Re: Resizing "/" Partition

Post by ae9803 » 2015/09/25 02:34:40

scottro wrote:You can try booting with a gparted live CD. It may show you that you have room to shrink other partitions and enlarge your root partition. (It doesn't recognize some partitions, and if you had, say, FreeBSD on an adjacent partition, I don't know if it would work with gparted.)

However, it has a fairly easy to understand GUI and might (or might not) be of use.
However, keep in mind that shrinking or moving partitions can result in data loss, so back up anything important first.
I am using a dedicated server, so all I have is SSH, however, I can reboot into rescue mode

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Resizing "/" Partition

Post by gerald_clark » 2015/09/25 04:07:09

That is not a CentOS kernel, and your disk partitioning is very peculiar.

Post Reply