I have a dedicated server that has a 500GB hard disk (a Kimsufi from OVH to be specific), and during OS installation I was given the option to resize partitions. I left it at the default (20GB for /, the rest for /home), which is a mistake I only just realized.
Here is my df -h output:
Code:
Filesystem Size Used Avail Use% Mounted on
rootfs 20G 8.3G 9.9G 46% /
/dev/root 20G 8.3G 9.9G 46% /
devtmpfs 987M 0 987M 0% /dev
tmpfs 198M 300K 198M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 498M 0 498M 0% /dev/shm
/dev/sda2 439G 160G 257G 39% /home
I'm running a database server which keeps its data in /var, and is quickly filling up. I want to "merge" all partitions so that all free space is shared, if that makes sense. My desired filesystem would look something like this:
Code:
Filesystem Size Used Avail Use% Mounted on
rootfs 459G 168G 267G ??% /
/dev/root 459G 168G 267G ??% /
devtmpfs 987M 0 987M 0% /dev
tmpfs 198M 300K 198M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 498M 0 498M 0% /dev/shm
Is it possible to do this without losing data? Using a rescue CD to manage the hard drive, what would I need to do in order to do what I want?
Edit: Here's fdisk -l if it matters:
Code:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000121c8
Device Boot Start End Blocks Id System
/dev/sda1 * 4096 40962047 20478976 83 Linux
/dev/sda2 40962048 975718399 467378176 83 Linux
/dev/sda3 975718400 976764927 523264 82 Linux swap / Solaris