Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 08-05-2004, 05:05 PM   #1
LQ Newbie
Registered: Apr 2004
Posts: 28

Rep: Reputation: 15
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.
Old 08-05-2004, 07:22 PM   #2
Senior Member
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
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.
Old 08-05-2004, 09:10 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
fdisk doesn't recognize free space on 300GB Disk thesix Ubuntu 6 05-21-2005 11:30 PM
fdisk doesn't recognize free space on 300GB Disk thesix Linux - Hardware 2 05-14-2005 09:19 PM
3Gb of disk space lost! Disk space problem or mother board conflicts with HDD Mistreated Linux - Hardware 4 12-06-2004 04:58 PM
How to resize a partition or reallocate space? Avatar Linux - Newbie 12 04-22-2004 05:11 PM
I need to reallocate drive space from mount point / to /boot decampbell1 Linux - Newbie 7 01-08-2004 03:34 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:26 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration