bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resizing hda1 question


From: Andrew Clausen
Subject: Re: Resizing hda1 question
Date: Sun, 05 Nov 2000 13:50:18 -0200

Steven Pagano wrote:
> 
> Andrew Clausen wrote:
> 
> > Steven Pagano wrote:
> >
> >> Hello,
> >>
> >> I was looking for further info regarding resizing a partition.
> >>
> >> I am currently using only one HD, it's a 13.6GB.  Currently under cfdisk
> >> my table looks like the following:
> >>
> >> hda1 - - - Boot - - - Primary - - - Linux ext2 - - - 8422.69
> >> hda2 - - -          - - - Primary - - - Linux swap - - - 501.75
> >>          - - -          - - - Pri/Log  - - - Free Space - - - 4746.00
> >>
> >> How would I get all of that free space to merge with my hda1 w/o
> >> disrupting any of my files.  Your instructions sound like I need to have
> >> the resizing drive (hda1) and freespace right next to each other,
> >> however it is not like that in my case.
> >
> >
> > This is correct.  However, if you remove your linux swap
> > partition, your free space will be next to your ext2 partition
> > ;-)
> >
> > So, kill partition 2, and grow partition 1, leaving some space
> > to create a new swap partition.
> >
> > Andrew Clausen
> >
> >
> Andrew,
> 
> I did basically that.  To simplify it, this is what my table looks like:
> 
> hda1(native)----FREE SPACE---hda2(swap)
> 
> Due to the fact I am a newbie (I still consider myself one) to Linux I
> do not feel very comfortable running this program.  Also, I have yet to
> find someone on an IRC linux help chat room that knows how to do this
> procedure.
> 
> Would you be able to describe in detail how it is accomplished.

I just added this to the Parted documentation.  Does this help?  Please
tell me if some parts don't make sense.

Thanks,
Andrew Clausen

--------

SITUATION
 
Suppose your disk layout looks like this:
 
        (parted) print
        Disk geometry for /dev/hda: 0.000-1000.000 megabytes
        Disk label type: msdos
        Minor    Start       End     Type      Filesystem  Flags
        1          0.063    500.000  primary   ext2
        2        500.000    625.000  primary   linux-swap
 
There is 375 Mb of free space at the end of the disk (after partition
2).
Partition 1 has an ext2 file system, which is the root device. 
Partition 2
is a swap device.
 
Suppose you wanted to use the free space at the end of the disk for the
file]
system on partition 1.

EXAMPLE PROCEDURE
 
(1) The following steps will modify both the root file system on
partition 1,
and the swap device on partition 2.  Therefore, you shouldn't be using
either
partitions.  You should probably use a Parted boot disk (see section
1.5).
>From the boot disk, run Parted:

        # parted /dev/hda
 
(2) Remove partition 2 (the swap partition).  Normally, you wouldn't
want to
delete a partition with data on it.  However, a swap partition doesn't
contain
data when it isn't "swapped on" (mounted), so you can remove it, and
create a
replacement swap partition later.
 
        (parted) rm 2
 
(3) Create the new swap partition at the end of the disk:
 
        (parted) mkpartfs primary linux-swap 875 999.9
        (parted) print
        Disk geometry for /dev/hda: 0.000-1000.000 megabytes
        Disk label type: msdos
        Minor    Start       End     Type      Filesystem  Flags
        1          0.063    500.000  primary   ext2
        2        875.000   1000.000  primary   linux-swap
 
(4) Grow partition 1, into the adjacent free space:
 
        (parted) resize 1 0.063 0.874.9
 
All done!
 
        (parted) print
        Disk geometry for /dev/hda: 0.000-1000.000 megabytes
        Disk label type: msdos
        Minor    Start       End     Type      Filesystem  Flags
        1          0.063    874.999  primary   ext2
        2        875.000   1000.000  primary  
linux-swap



reply via email to

[Prev in Thread] Current Thread [Next in Thread]