Date: Wed, 15 Mar 2006 14:53:14 +0200 (EET) From: Dmitry Pryanishnikov <dmitry@atlantis.dp.ua> To: Vadim Goncharov <vadim_nuclight@mail.ru> Cc: freebsd-stable@freebsd.org Subject: Re: swap at beginning of slice - danger? Message-ID: <20060315143939.Q17761@atlantis.atlantis.dp.ua> In-Reply-To: <1591151085.20060315181926@mail.ru> References: <1591151085.20060315181926@mail.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060315143939.Q17761>