Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Mar 2006 14:48:31 +0100 (CET)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-stable@FreeBSD.ORG, Vadim Goncharov <vadim_nuclight@mail.ru>
Subject:   Re: swap at beginning of slice - danger?
Message-ID:  <200603151348.k2FDmVht027797@lurza.secnetix.de>
In-Reply-To: <1591151085.20060315181926@mail.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603151348.k2FDmVht027797>