Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2001 22:01:49 -0500
From:      Mike Meyer <mwm@mired.org>
To:        jonas <jonas.bulow@servicefactory.se>
Cc:        questions@freebsd.org
Subject:   Re: help with growfs on 4.3-STABLE
Message-ID:  <15192.61597.755372.771975@guru.mired.org>
In-Reply-To: <91587784@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
jonas <jonas.bulow@servicefactory.se> types:
> When I was young and stupid ( :-) ) I partitioned my hard drive as:
> 
> Offset       Size(ST)        End     Name  PType       Desc  Subtype   
> Flags
> 
>          0         63         62        -      6     unused       
> 0          
>         63    4188177    4188239    ad0s1      2        fat        6
>    4188240    1043280    5231519    ad0s2      3    freebsd      165   
> C
>    5231520    8179920   13411439    ad0s3      4   extended        5
>   13411440    8179920   21591359    ad0s4      3    freebsd      165
>   21591360    1980720   23572079        -      6     unused        0
> 
> What I didn't know at that time was that I could only have four
> partitions.

BSD uses a different terminology than MS - the four disk segments
identified by the standard boot block table are "slices".  The disk
segments inside a slice that BSD uses are "partitions" - and have been
since the early 70s.

> The problem: 
> 
> I would like to extend ad0s4 to use all the space availble on the disk.
> Then I would like to use growfs to grow the filesystem on that partition
> ( /usr ) to use the newly created space in the partition.
> 
> Is that possible?

Depends on what you mean by "all the space on the disk". If you are
talking about the unused space that follows s4, yes. If you're talking
about s1, s2, and s3 as well, then no. The first sectors of a disk
segment are the critical ones. You can only safely add space to a
slice or a partition if the space follows it on the disk, not if it
precedes it.

> Last time I tried to change the partition size I ended up with the ad0s4
> unreadable. I managed to restore it by restoring the original valus in
> the partition table.
> 
> So, the question is: 
> How do I resize a partition without loosing it? 

You should be able to just change the size on s4 to include the unused
space. Once that's done and you have extra space in s4, you can use
disklabel to do the same thing. As in the note above, you can only add
space to /usr if that space directly follows /usr on the disk. After
you've edited it with disklabel, you can use growfs to grow the file
system to use the new space. If the last partition on ad0s4 isn't
/usr, you have to move that partition by hand, or grow it instead of
growing /usr.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15192.61597.755372.771975>