Hello!

On Wed, 15 Mar 2006, Oliver Fromme wrote:
>  # 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.

You're right about RELENG_5 (and CURRENT). I've found this code (though not from the first attempt ;) in /sys/vm/swap_pager.c, at start of swaponsomething():

        /*
         * Do not free the first two block in order to avoid overwriting
         * any bsd label at the front of the partition
         */
        blist_free(sp->sw_blist, 2, nblks - 2);

However I don't see any equivalent code in RELENG_4. Neither can I find where it's documented, and thus any guarantees that it won't disappear tomorrow ;(

In other words:  You're save.  No danger.  No need to worry.

 In this particular case - yes.


Sincerely, Dmitry
--
Atlantis ISP, System Administrator
e-mail:  [EMAIL PROTECTED]
nic-hdl: LYNX-RIPE
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to