From owner-freebsd-stable@FreeBSD.ORG Wed Mar 15 14:38:32 2006 Return-Path: X-Original-To: freebsd-stable@FreeBSD.org Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57FA616A424 for ; Wed, 15 Mar 2006 14:38:32 +0000 (UTC) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 070A743D46 for ; Wed, 15 Mar 2006 14:38:22 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id k2FEcKsn052508; Wed, 15 Mar 2006 16:38:20 +0200 (EET) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ip.net.ua [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 16092-04; Wed, 15 Mar 2006 16:38:03 +0200 (EET) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id k2FEboHK052492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Mar 2006 16:37:50 +0200 (EET) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.4/8.13.4) id k2FEc9Y3013786; Wed, 15 Mar 2006 16:38:09 +0200 (EET) (envelope-from ru) Date: Wed, 15 Mar 2006 16:38:09 +0200 From: Ruslan Ermilov To: freebsd-stable@FreeBSD.org, Vadim Goncharov Message-ID: <20060315143809.GF10897@ip.net.ua> References: <1591151085.20060315181926@mail.ru> <200603151348.k2FDmVht027797@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E7i4zwmWs5DOuDSH" Content-Disposition: inline In-Reply-To: <200603151348.k2FDmVht027797@lurza.secnetix.de> User-Agent: Mutt/1.5.11 X-Virus-Scanned: amavisd-new at ip.net.ua Cc: Subject: Re: swap at beginning of slice - danger? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Mar 2006 14:38:32 -0000 --E7i4zwmWs5DOuDSH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 15, 2006 at 02:48:31PM +0100, Oliver Fromme wrote: > Vadim Goncharov wrote: > > I have 5.5-PRERELEASE server in production, booting from ad0s1: > >=20 > > # BLOCKSIZE=3D512 swapinfo > > Device 512-blocks Used Avail Capacity > > /dev/ad0s1b 2097152 52872 2044280 3% > > /dev/ad1s1b 2097152 51952 2045200 2% > > Total 4194304 104824 4089480 2% > > # bsdlabel ad0s1 | fgrep b: > > b: 2097152 0 swap > >=20 > > Previously, on a 4.11 system, swapinfo said that swap size was less th= an > > size of b: partition on a slice - it was ok, as boot sectors are > > located at beginning of slice. But now, sizes match exactly. What > > changed and is it dangerous nowadays to have swap partition at offset = 0 ? >=20 > The code in sys/swap_pager.c does not touch the first two > blocks, where blocks are measured in PAGE_SIZE units. > The smallest page size supported on FreeBSD architectures > is 4 KB (on i386), so that's at least 2 * 4k, which is 16 > sectors on the disk. That's enough to skip MBR, disklabel > and boot blocks. >=20 > In other words: You're save. No danger. No need to worry. >=20 Also, geom_bsd.c doesn't allow writing to the "label" sector: : # bsdlabel md0 : # /dev/md0: : 8 partitions: : # size offset fstype [fsize bsize bps/cpg] : a: 2048 0 unused 0 0 =20 : c: 2048 0 unused 0 0 # "raw" part, don= 't edit : # dd if=3D/dev/zero of=3D/dev/md0a count=3D1 seek=3D1 : dd: /dev/md0a: Operation not permitted : 1+0 records in : 0+0 records out : 0 bytes transferred in 0.000153 secs (0 bytes/sec) Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --E7i4zwmWs5DOuDSH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFEGCbRqRfpzJluFF4RAtOsAJ9xCwA6DAfzf01yjQ3Sqj7972LY7ACeJiiV 7iwfXfauCPmv4XsdZMfMKog= =9/KT -----END PGP SIGNATURE----- --E7i4zwmWs5DOuDSH--