From owner-freebsd-stable@FreeBSD.ORG Wed Mar 15 12:53:20 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 1602316A422 for ; Wed, 15 Mar 2006 12:53:20 +0000 (UTC) (envelope-from dmitry@atlantis.dp.ua) Received: from postman.atlantis.dp.ua (postman.atlantis.dp.ua [193.108.47.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44ECF43D53 for ; Wed, 15 Mar 2006 12:53:19 +0000 (GMT) (envelope-from dmitry@atlantis.dp.ua) Received: from smtp.atlantis.dp.ua (smtp.atlantis.dp.ua [193.108.46.231]) by postman.atlantis.dp.ua (8.13.1/8.13.1) with ESMTP id k2FCrEC4024163; Wed, 15 Mar 2006 14:53:14 +0200 (EET) (envelope-from dmitry@atlantis.dp.ua) Date: Wed, 15 Mar 2006 14:53:14 +0200 (EET) From: Dmitry Pryanishnikov To: Vadim Goncharov In-Reply-To: <1591151085.20060315181926@mail.ru> Message-ID: <20060315143939.Q17761@atlantis.atlantis.dp.ua> References: <1591151085.20060315181926@mail.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-stable@freebsd.org 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 12:53:20 -0000 Hello! On Wed, 15 Mar 2006, Vadim Goncharov wrote: > I have 5.5-PRERELEASE server in production, booting from ad0s1: > > # BLOCKSIZE=512 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 > > Previously, on a 4.11 system, swapinfo said that swap size was less than > 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 ? It seems to me as a dangerous setup indeed - swap could easily overwrite disklabel (which is in sector 1 of the slice for every arch except Alpha). FFS doesn't touch first several sectors, so it would be safe to start FFS partition from the offset 0, but AFAIK swap engine makes no such guaranties. I don't know about current situation in RELENG_5, but in CURRENT bsdlabel by default reserves first 16 sectors for the disklabel, so offset of the first partition will be 16 regardless of the partition type. But stupid sysinstall still insists on putting first partition at offset 0, and it's a shame. For production server I would deactivate swap on this disk and recreate b-partition in order to start at offset 16, not 0. Sincerely, Dmitry -- Atlantis ISP, System Administrator e-mail: dmitry@atlantis.dp.ua nic-hdl: LYNX-RIPE