-1

I need to expand the root partition of the server (not LVM) because of the need of testing. How can I expand the root partition without shutting the server down?

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G     0  3.8G   0% /dev
tmpfs           779M  3.5M  776M   1% /run
/dev/sdb2       126G   24G   96G  20% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
$ sudo fdisk -l
Disk /dev/sda: 128 GiB, 137438953472 bytes, 268435456 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4b512b27

Device     Boot Start        End    Sectors  Size Id Type
/dev/sda1  *     2048  268433407  268431360  128G 83 Linux
karel
  • 114,770
Erwin
  • 1

1 Answers1

3

OK, lets start with the fact that you don't want to shutdown the server, presumably because it's production. Therefore, the word "testing" should not be used anywhere near to a production server. Not even in jest.

Next, I don't think I understand the screen prints. It looks like / is on sdb2, but the fdisk is for sda. Some thing inconsistent here.

The ONLY way you can actually expand any partition that is not LVM is if you take the disk off-line. So your only way of expanding the disk, assuming you have space on sdb to do so, is if you boot a live CD and process it from there.

Finally, why? Just why? If you have a spare disk (sda) why not simply format that and mount it as a directory into / (or one of its sub dirs)?