I've got a physical server (RHEL 6.7) using standard partitioning with 10 partitions on block device /dev/sda. /dev/sda6 /home needs more space.

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda5        39G   18G   19G  49% /
tmpfs            16G  412K   16G   1% /dev/shm
/dev/sda1       477M   61M  392M  14% /boot
/dev/sda6        20G   17G  1.8G  91% /home
/dev/sda2       231G   66G  165G  29% /opt/data1
/dev/sda3        48G  2.0G   47G   4% /opt/data2
/dev/sda7        20G  2.8G   17G  15% /opt/data3
/dev/sda8        20G  3.3G   16G  18% /opt/data4
/dev/sda9        20G   14G  4.2G  78% /var

I would like to extend /dev/sda6 which is a logical partition under /dev/sda4 the extended partition.

Disk /dev/sda: 599.9 GB, 599932581888 bytes
255 heads, 63 sectors/track, 72937 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
Disk identifier: 0x00046047

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
 Partition 1 does not end on cylinder boundary.
/dev/sda2              64       30660   245760000   83  Linux
/dev/sda3           30660       37034    51200000   83  Linux
/dev/sda4           37034       72938   288398336    5  Extended
/dev/sda5           37034       42134    40960000   83  Linux
/dev/sda6           42134       44683    20480000   83  Linux
/dev/sda7           44684       47233    20480000   83  Linux
/dev/sda8           47233       49783    20480000   83  Linux
/dev/sda9           49783       52333    20480000   83  Linux
/dev/sda10          52333       54373    16384000   82  Linux swap /     Solaris

parted shows there is 153GB of free space not allocated:

Disk /dev/sda: 600GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
    32.3kB  1049kB  1016kB            Free Space
 1      1049kB  525MB   524MB   primary   ext4            boot
 2      525MB   252GB   252GB   primary   ext4
 3      252GB   305GB   52.4GB  primary   ext4
 4      305GB   600GB   295GB   extended
 5      305GB   347GB   41.9GB  logical   ext4
 6      347GB   368GB   21.0GB  logical   ext4
    368GB   368GB   104kB             Free Space
 7      368GB   389GB   21.0GB  logical   ext4
 8      389GB   409GB   21.0GB  logical   ext4
 9      409GB   430GB   21.0GB  logical   ext4
 10      430GB   447GB   16.8GB  logical   linux-swap(v1)
    447GB   600GB   153GB             Free Space
    600GB   600GB   309kB             Free Space

How can I take about 50GB from that free space and add it to /dev/sda6 without impacting the other partitions? I'm thinking I would need to blow away the current partition layout and start from scratch by my concern is what would need to stay the same and what would change in terms of start and ending sectors? Can this even be done?

  • It looks like the free space is not right after sda6; sda7 is right after. If that's the case, no you cannot add free space (without destroying sda7). – Emmanuel Rosa Jul 16 '18 at 22:03
  • 1
    You'd need to shove 7 through 10 further down the disc. You might be better off allocating a new 70GB partition and putting it in place of sda6. – Ignacio Vazquez-Abrams Jul 16 '18 at 22:18
  • And while it's possible, though cumbersome, to move around partitions 7-10 to make space for a larger partition 6, or to allocate an 11th partition in place of partition 6: This is exactly what LVM was made for, so now would be a good time to read up on LVM, and switch to LVM. Or, do away with the partitions, and just allocate a single large partition. (Or do so on your next harddisk, when this one starts to age). – dirkt Jul 17 '18 at 6:36
  • Thanks guys, I can't gamble on touching the partitions below 6, so I'll just create a new part 11 and use that in place of 6. – user53029 Jul 17 '18 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.