Hello freebsd-stable, 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 ? -- Best regards, Vadim Goncharov ICQ UIN 166852181 mailto:vadim_nuclight@mail.ru
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
Vadim Goncharov <vadim_nuclight@mail.ru> 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 ? 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. In other words: You're save. No danger. No need to worry. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. > Can the denizens of this group enlighten me about what the > advantages of Python are, versus Perl ? "python" is more likely to pass unharmed through your spelling checker than "perl". -- An unknown poster and Fredrik Lundh