From owner-freebsd-questions@FreeBSD.ORG Sat Jun 21 10:07:35 2008 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 105B01065675 for ; Sat, 21 Jun 2008 10:07:35 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr14.xs4all.nl (smtp-vbr14.xs4all.nl [194.109.24.34]) by mx1.freebsd.org (Postfix) with ESMTP id 8DAED8FC26 for ; Sat, 21 Jun 2008 10:07:34 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr14.xs4all.nl (8.13.8/8.13.8) with ESMTP id m5LA7OhW065659; Sat, 21 Jun 2008 12:07:24 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id AED93BA9C; Sat, 21 Jun 2008 12:07:23 +0200 (CEST) Date: Sat, 21 Jun 2008 12:07:23 +0200 From: Roland Smith To: Nejc =?iso-8859-15?Q?=A6koberne?= Message-ID: <20080621100723.GA30639@slackbox.xs4all.nl> References: <20080620123154.K47466@wojtek.tensor.gdynia.pl> <867893.19250.qm@web57012.mail.re3.yahoo.com> <20080620105111.GA2249@owl.midgard.homeip.net> <485CC929.2030604@skoberne.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: <485CC929.2030604@skoberne.net> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: User Questions Subject: Re: FreeBSD fdisk how to? 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: Sat, 21 Jun 2008 10:07:35 -0000 --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 21, 2008 at 11:26:01AM +0200, Nejc =A6koberne wrote: > Hi, >=20 > > Well, fdisk(8) is somewhat cumbersome to use. Personally I tend to inv= oke > > sysinstall(8) to create new slices (can be done after install too.) Mu= ch > > easier to use. >=20 > OT, but: does sysinstall's "fdisk" also support gmirror and gstripe devic= es? No > Or do I need to use fdisk to make slices there? Yes. But it is not hard. First of all: _make backups_ ! To create this mirror configuration, the machine is booted from a CD which contains a live filesystem. I used the 7.0-RELEASE-amd64-livefs.iso image to create this CD. After the machine boots, the sysinstall(8) application is started automatically. In the first two menus you have to set your location and keyboard type. The location doesn't really matter since we won't be installing anything. It is probably best to choose the default keyboard layout, unless you know otherwise. Next the ``Fixit'' option is chosen, followed by the ``CDROM/DVD'' option in the next menu. We are now in the shell of the livefs. The first order of business is to check if the disks have been recognized. The command # ls /dev/ad* should return two disks.=20 Now it is time to create a mirrored device using the gmirror(8) tool. Next the mirror is activated by loading the geom_mirror kernel module. After the kernel module has been loaded, the mirrored device \texttt/dev/mirror/gm0 should appear. # gmirror label gm0 ad4 ad6 # kldload /mnt2/boot/kernel/geom_mirror.ko Now it is time to devide the disks into slices (which are called partitions in PC parlance). The -I option creates one FreeBSD slice covering the entire disk. The -B option writes a boot block. # fdisk -vBI /dev/ad4 # fdisk -vBI /dev/ad6 Now that the disk has been given a single slice, a new device /dev/mirror/gm0s1 will appear. We will now subdivide that into FreeBSD partitions using bsdlabel(8). First we will write a standard label and boot blocks.=20 # bsdlabel -wB /dev/mirror/gm0s1 # export EDITOR=3D/mnt2/usr/bin/ee # bsdlabel -e /dev/mirror/gm0s1 The command in the middle sets the editor to something more user friendly then vi! The last command will open a text editor with the partition table that the first command made. It should be edited to look like the following (for example); # /dev/mirror/gm0s1: 8 partitions: # size offset fstype [fsize bsize] a: 500M 16 4.2BSD 2048 16384 # / b: 8G * swap # Reserved for swap. c: * * unused 0 0 # "raw" part. d: 2G * 4.2BSD 2048 16384 # /var e: 50G * 4.2BSD 2048 16384 # /tmp f: 20G * 4.2BSD 2048 16384 # /usr g: * * 4.2BSD 2048 16384 # /home The disk partitions are now ready to put the filesystems on them. To minimize the chance of problems with the root partition, softupdates are not enabled for root. # newfs /dev/mirror/gm0s1a # newfs -U /dev/mirror/gm0s1d # newfs -U /dev/mirror/gm0s1e # newfs -U /dev/mirror/gm0s1f # newfs -U /dev/mirror/gm0s1g Now you can restore your backups. Before you reboot, edit /etc/fstab to mount the right partitions. And edit /boot/loader.conf to load the geom_mirror module. # echo 'geom_mirror_load=3D"YES"' >>/boot/loader.conf Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --tThc/1wpZn/ma/RB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkhc0tsACgkQEnfvsMMhpyVg1wCfYSB46rp7ZXyf1/FOBcP6K7UR e38An3fRiy9hm4Kv+OotRaWBVh9GCuIY =ERU3 -----END PGP SIGNATURE----- --tThc/1wpZn/ma/RB--