[CLUE-Tech] making use of unused disk space

David Anselmi anselmi at americanisp.net
Sun Jul 21 20:55:10 MDT 2002


Jason Friedman wrote:
>                             cfdisk 2.10s
> 
>                         Disk Drive: /dev/hda
>                       Size: 20020396032 bytes
>         Heads: 255   Sectors per Track: 63   Cylinders: 2434
> 
>    Name      Flags    Part Type FS Type       [Label]      Size (MB)
>  ------------------------------------------------------------------
>    hda1      Boot      Primary  Linux ext2    [/boot]          41.13
>    hda5                Logical  Linux ext2    [/usr]         3150.29
>    hda6                Logical  Linux ext2    [/home]        3150.29
>    hda7                Logical  Linux ext2    [/var]         3150.29
>    hda8                Logical  Linux ext2    [/opt]         3150.29
>    hda9                Logical  Linux ext2    [/]            3150.29
>    hda10               Logical  Linux ext2    [/tmp]         1052.84
>    hda11               Logical  Linux swap                    271.44
>                        Logical  Free Space                   2903.53
> 
> Above is the output from cfdisk.
> It shows I have 2.9GB of free space on my disk.
> I want to allocate some of that to an existing partition.
> How do I do that?

You have to repartition, and partd can do that non-destructively at 
least in some cases.

Best may be to backup everything and redo the whole disk.  Quicker may 
be to just backup/rearrange the partitions you want to grow.  For 
example, if you wanted to grow hda9 [/] you could swapoff, unmount /tmp, 
and grow / with partd (preferrably in single-user and read-only).  Maybe 
partd isn't reliable enough for that (I haven't used it).  In that case, 
you can at least grow /tmp (because it doesn't have any valuable files 
on it).

Partitions nearer the front of the disk are more trouble which is why I 
try to put those likely to fill near the end, when I'm saving space at 
the end of a disk (like when I have a 40GB drive and only expect ever to 
use 2-3GB).

Anyway, the better solution in the long run is to use a volume manager 
like LVM.  Then you can add space from anywhere on any disk to any 
partition.  I played with it last fall and couldn't grow/shrink a 
partition (the filesystem has to be adjusted too) reliably.  So I gave 
up, but the problems may have been fixed by now.

Dave




More information about the clue-tech mailing list