-   Linux - General (
-   -   FDISK! /var too big; / too small, reallocate disk space (

pauljtester 08-05-2004 04:05 PM

FDISK! /var too big; / too small, reallocate disk space
I need to reallocate disk space from my /var partition to my / partition. I don't have Partition Magic handy (and from what I've read, it's not always the best). I'm wondering if what I'm trying to do is possible with fdisk? I've searched the forum and googled, but no dice.

GOAL: move ~800MB from the /var partition to /
[root@linuxbox root]# fdisk -l

Disk /dev/hda: 6448 MB, 6448619520 bytes
255 heads, 63 sectors/track, 784 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 268 2048287+ 83 Linux
/dev/hda3 269 760 3951990 83 Linux
/dev/hda4 761 784 192780 5 Extended
/dev/hda5 761 784 192748+ 82 Linux swap

[root@linuxbox root]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 3.8G 2.0G 1.6G 56% /
/dev/hda1 99M 12M 82M 13% /boot
none 62M 0 62M 0% /dev/shm
/dev/hda2 2.0G 89M 1.8G 5% /var

Detailed answers are appreciated as I am a newbie.

born4linux 08-05-2004 06:22 PM

parted should do the trick. you can search for details.
what parted can do for you is reduce /dev/hda2 and then extend /dev/hda3 using the resize option.
before you do it, make sure you backup your data.
but being a newbie, i suggest that you just repartition.

jschiwal 08-05-2004 08:10 PM

Here is a live-cd image that contains the program parted. It is only around 50 Meg in size and contains many tools you could use to backup and change partitions on your hard drive.
It will resize a ext2, ext3 or reiserfs file system. However the start of the partition can't change. You could boot up with this disk ( your / and /var partitions won't be mounted then ) and back up the /var partition, delete /var, resize / , create a new /var, and restore /var.

Luckily, your /var partition is situated just after your / partition.

All times are GMT -5. The time now is 05:15 AM.