Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Sep 2006 11:45:37 -0400
From:      Jerry McAllister <jerrymc@msu.edu>
To:        Kristopher Yates <kris_yates64@hotmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: growfs HELP
Message-ID:  <20060928154537.GD95657@gizmo.acns.msu.edu>
In-Reply-To: <BAY103-F424E1E193E8828920B11AEB1B0@phx.gbl>
References:  <BAY103-F424E1E193E8828920B11AEB1B0@phx.gbl>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Thu, Sep 28, 2006 at 03:26:27AM -0500, Kristopher Yates wrote:

> Hi everyone,
> 
> First of all, glad to still be running FBSD after all these years.
> 
> I tried following some docs I found online in order to make my /usr 
> partition bigger and made it all the way to growfs -s, which is where I got 
> stuck.
> 
> First of all, here was my original dilema, what I did, then a descript of 
> where I am regarding growfs problem.
> 
> System (aka firewall): Pentium60 40M RAM 2 NICS, running FBSD4.5-stable (a 
> great firewall running 24/7 since OCT 2000.)
> 
> I tried to upgrade (make buildword make installworld to 4.11-stable).. I 
> made the new world and installed the new kernel but not quite enough space 
> to do the last steps (mergemaster and then installworld).
> 
> So I built a spare box, and installed FBSD on it.
> 
> I put the hard drive from the firewall as secondary master, and a larger 
> drive as secondary slave.
> 
> * I ran dd and imaged the old drive onto the new drive
> 
>   old drive seagate 1.2gb
>   new drive quantum 4.3gb
> 
> * I put the new drive into the old faithful P60 (firewall).  It boots up 
> fine running 4.11-p22 and is currently online as my firewall.
> 
> What is left to do:
> 
> Finish the 4.11 install which ended on make kernel KERNCONF=CUSTOMKERN.. I 
> just need to mergemaster then installworld as single user.
> 
> Obviously, /usr partition (/dev/ad0s1f) is basically full w/ 8.6MB free.
> 
> ** soo.. I did some fdisk magic and got stuck on the growfs (final step) in 
> order to growfs /usr
> 
> fdisk reports my 1 partition @ full size of disk but no idea how to 
> properly use growfs.

To use growfs you must have space in the slice contiguous with
the partition you want to increase in size.   It cannot just grow
anywhere.   You really did not want to move things using dd.
You really wanted to build the new file systems to the sizes you
want on the new disk and then use dump/restore to to the new
partitions.

First, fdisk the new disk and put the MBR on it and create your
one slice on it and flag that as bootable.

Then, use disklabel (in 4.xxx, bsd label in later versions of FreeBSD)
to create your slices and also make it write out the boot sector.
There is a block of examples in the disklabel/bsdlabel man page
that tells how to use dd to make sure a drive is clean
and then fdisk to make one slice with MBR and finally two disklabels
to create the bootable partition and then to edit the partition
table for all the partitions.   That group of commands is just what
you need.

Then, do a newfs on each partition created (except swap) and 
then make a mount point for them.   Mount the 'a' partition on
something like '/newroot' for example and then run dump/restore
to copy root    
             cd /newroot
             dump 0af - / | restore -rf -

Do the same dump/restore thing for each of the partitions/filesystems.
Make sure you cd in to the base of each mounted new filesystem
before doing the dump/restore and replace the '/' in the dump to
be each filesystem  - for example, for /usr, make a /newusr mountpoint
mount it and then cd to /newusr and do 'dump 0af - /usr | restore -rf -'

When you get done, you will have a fully useable, bootable copy of your
machine on the new disk.   Move the new disk to the primary boot
position in your boot chain and start it up.

By the way, those are pretty small drives.   I don't see any 
on the market nowdays less that 18 GB and more likely larger.
Maybe you need some new hardware.    

////jerry

> 
> Here is what I have:
> cylinders=8895 heads=15 sectors/track=63 (945blks/cyl)
> 
> media sector size 512
> 
> partition 1 sysid 165, start 63, size 8405712 (4104 Meg), flag 80 (active)
> beg: cyl 0/head 1 / sector 1
> end: cyl 1023 / head 14 / sector 63
> 
> basically I need help filling in the following blank (/dev/ad0s1f == /usr 
> slice)
> 
> # growfs -s ______ /dev/ad0s1f
> 
> as shown above, fdisk sees the correct geometry as 4104MB partition but 
> /stand/sysinstall disklabel editor sees ad0s1 as 2888MB, which is the 
> amount of space I thought I was to be adding to /usr via growfs. Currently, 
> my /usr slice is 975MB and really needs to grow. :)
> 
> Please let me know what other info I can provide that will help you help me 
> solve this problem.  I have read man growfs and some docs online, however, 
> I'm stuck and dont know exactly how to resolve the problem.
> 
> Much thanks,
> 
> Kris
> 
> _________________________________________________________________
> Find a local pizza place, music store, museum and more?then map the best 
> route!  http://local.live.com
> 
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20060928154537.GD95657>