From owner-freebsd-fs@FreeBSD.ORG Fri Aug 27 18:53:12 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E95521065673; Fri, 27 Aug 2010 18:53:11 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (brucec-2-pt.tunnel.tserv5.lon1.ipv6.he.net [IPv6:2001:470:1f08:679::2]) by mx1.freebsd.org (Postfix) with ESMTP id 90E2B8FC20; Fri, 27 Aug 2010 18:53:11 +0000 (UTC) Received: from unknown (client-82-31-24-1.midd.adsl.virginmedia.com [82.31.24.1]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 1B6725F15; Fri, 27 Aug 2010 18:53:06 +0000 (UTC) Date: Fri, 27 Aug 2010 19:53:07 +0100 From: Bruce Cran To: Doug Barton Message-ID: <20100827195307.0000619a@unknown> In-Reply-To: <4C77EEC2.80909@FreeBSD.org> References: <4C7715D0.10604@FreeBSD.org> <20100827070233.000075a8@unknown> <4C77EEC2.80909@FreeBSD.org> X-Mailer: Claws Mail 3.7.4cvs1 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org Subject: Re: Difference of opinion about my disk geometry X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 18:53:12 -0000 On Fri, 27 Aug 2010 09:58:42 -0700 Doug Barton wrote: > What I definitely think is true at this point is that my 25-year-old > "knowledge" about this stuff is now worse than useless. :) So I need > to learn how to to do it better. I took a look at the man page for > gpart and it's way over my head. I was not impressed with the way > that the disk slicer for the ubuntu installer worked. Biggest single > objection was that it considers 1 gigabyte to be 1,000,000 bytes, but > at least it said this somewhere obvious so I could do the math to > make it "right" myself, and fwiw Nautilus and the gnome "Disk > Utility" seem to have the same view of the world, even though 'df -h' > shows the "real" Gbs. However the results seemed Ok. I did some > digging on line and saw many references to gparted, which is included > in the ubuntu live cd, and seemed quite easy to work with. Apparently it's Ubuntu's policy to use base 10 units for disks: https://wiki.ubuntu.com/UnitsPolicy gpart isn't very easy to learn, but quite straightforward to use once you understand it - but one problem is that the manpage leaves a lot of usability details out such as the ability to specify sizes in MB/GB and to omit sizes in order to use the rest of the space. It also doesn't mention initializing the freebsd container with a "bsd" (or MBR) scheme. For example, to setup a disk with 40GB for FreeBSD, 50GB for Windows and the rest for Linux: Create an mfs system to work on: truncate -s 100G mdfs mdconfig -a -f mdfs Init the disk with an MBR: gpart create -s mbr md0 Create a BSD container: gpart add -t freebsd -s 40G md0 Init with a BSD scheme: gpart create -s bsd md0s1 Use 1GB for /: gpart add -t freebsd-ufs -s 1G md0s1 4GB for swap: gpart add -t freebsd-swap -s 4G md0s1 2GB for /var: gpart add -t freebsd-ufs -s 2G md0s1 1GB for /tmp: gpart add -t freebsd-ufs -s 1G md0s1 The rest for /usr: gpart add -t freebsd-ufs md0s1 Back in the MBR, create an NTFS partition: gpart add -t ntfs md0 We also want Linux, so del and re-create: gpart delete -i 2 md0 This time, only use 50GB for NTFS: gpart add -t ntfs -s 50G md0 At this point it's not possible to create Linux partitions, because the "linux-data" and "linux-swap" types are only available if you're working on a GPT disk. At each stage you can also specify "-f x" e.g. "gpart create -f x -s mbr md0" in order to have the new layout stored in memory but not written to disk until you run "gpart commit md0". It seems the issue about cylinder alignment came about through compatibility issues with old versions of Windows (98/ME) and appartently (http://tldp.org/HOWTO/Large-Disk-HOWTO-6.html) sparc needs the boot partition to start on a cylinder boundary. It also seems that diskpart in Windows has some rules regarding cylinder alignment too (http://support.microsoft.com/kb/300415). -- Bruce Cran