From owner-freebsd-questions@FreeBSD.ORG Wed Oct 24 15:35:53 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 876C016A41A for ; Wed, 24 Oct 2007 15:35:53 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id 4911813C481 for ; Wed, 24 Oct 2007 15:35:53 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id l9OFX7WL088576; Wed, 24 Oct 2007 11:33:07 -0400 (EDT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id l9OFX6Cf088575; Wed, 24 Oct 2007 11:33:06 -0400 (EDT) (envelope-from jerrymc) Date: Wed, 24 Oct 2007 11:33:06 -0400 From: Jerry McAllister To: FreeBSD Questions Message-ID: <20071024153306.GA88476@gizmo.acns.msu.edu> References: <20071023181503.GC54356@demeter.hydra> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071023181503.GC54356@demeter.hydra> User-Agent: Mutt/1.4.2.2i Cc: Jerry McAllister Subject: Re: resizing partitions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2007 15:35:53 -0000 On Tue, Oct 23, 2007 at 12:15:03PM -0600, Chad Perrin wrote: > I have need to alter some partition sizes on a (laptop) system I use > daily, with FreeBSD 6.2-RELEASE installed. Are there tools you'd > recommend for this, that should be stable and not prone to hosing up my > filesystems? In particular, I probably don't need to shrink any > partitions -- only grow them -- but I'm not sure how I want to handle > this at this time. I worry a bit about using some Linux LiveCD's > partition management tools on a FreeBSD system. Any advice would be > appreciated. First, is there a strong reason that you must change the partition sizes? Could you not instead just move some directories and make soft links (Symbolic Links) from the old location to the new? This can solve most issues with much less hassle. Second, are you for sure meaning partition and not slice in FreeBSD terms? If you mean slices, then there is no reasonable way other than to back things up - using dump - and rebuild things and then restore data. If you mean FreeBSD partitions, then it is possible you could use a utility called growfs. But, it requires adjacent space to grow in to. You would have to free space in the partition that is next higher in address space. That would mean also backing that partition up and blowing it away, growing the lower partition and creating the higher one anew. Given all that trouble - and room for error, it might be easier just to back up each partition/file system with a reliable dump (check it before nuking things) and then rebuilding the file systems from scratch using the fixit CD and then restoring each file system. If you are referring to FreeBSD partitions (and not MS partitions which FreeBSD calls slices), then after making dumps of each file system (except /tmp - don't bother with it) you boot the install CD, select the fixit shell, use disklabel to remake partitions and newfs to build the file systems. Make temporary mount pointss (which really exist in a memory file system, but you don't care about that) in the fixit's root and then cd in to each and restore the appropriate dump in to it with a 'restore -rf ' Since you would, in this case be restoring a root that you were already using, if you do not change the number and names of partitions/file systems - just sizes, such things as /etc/fstab and rc.conf, etc would already be there and set up as you need them, so just reboot when all the restores are done. If you change any of the partitions so that mount information needs to be redone, then you will want to go to that /etc/fstab in the temporarily mounted restored root file system and modify it to suit the new situation. Then reboot. I think that if moving a directory and creating a symlink, as in my first comment above, will not do the trick for you, then doing the complete dump and rebuild of partitions/file systems is a better bet that growfs. Growfs is really more suitable for those situations where a person left a large glob of space un the slice unallocated in any partition, thinking another use was to be put to it later but now wants to incorporate that glob in to the partition next to it. It is not really designed for moving stuff around in the middle of things. But you can try it. Third, Anyway, don't try using LINUX tools to manipulate the FreeBSD partitions. There is too much difference. ////jerry > > -- > CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] > John W. Russell: "People point. Sometimes that's just easier. They also use > words. Sometimes that's just easier. For the same reasons that pointing has > not made words obsolete, there will always be command lines." > _______________________________________________ > 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"