using swap on a separate slice

talon at lpthe.jussieu.fr talon at lpthe.jussieu.fr
Sat Dec 23 08:43:58 PST 2006


walt wrote:

>x ad0s4{a,b}, etc.).
> 
> I just tried using my linux swap partition/slice on DF.  To avoid
> the errors you mention I had to add a disklabel to the swap slice:
> 
> #disklabel -w -r /dev/ad0s8 auto
> 
> #swapon /dev/ad0s8
> 
> # swapinfo
> Device          1K-blocks     Used    Avail Capacity  Type
> /dev/ad1s6b        524160        0   524160     0%    Interleaved
> /dev/ad0s8         529984        0   529984     0%    Interleaved
> Total             1054144        0  1054144     0%
> 
> I'm guessing that if I now reboot into linux and anything swaps to
> disk, my new disklabel will get trashed -- just something to keep
> in mind for us OS junkies ;o)

I am routinely using my linux swap partition (on an extended partition) as
swap partition for FreeBSD. This works completely straightforwardly. Here
is my fstab swap line:
/dev/ad0s5              none            swap    sw              0       0

Here ad0s3 is an extended partition comprising logical partition ad0s5 for
swap and other Linux partitions. FreeBSD is on ad0s4, ad0s1 and ad0s2 are
Windows stuff. I can ensure you i have not applied any special formatting,
disklabel or whatever to ad0s5, it is straight naked as Linux formatted it.

The only problem is when you reboot Linux. You have to run makswap on said
partition or Linux will refuse to use it. I have added a mkswap invocation 
in the Linux boot script just before it runs swapon. This is almost
instantaneous, so there is no drawback at all.

By the way, i have seen concrete reports that one can install FreeBSD
completely on logical partitions (that is even /boot/loader supports that),
and i am quite sure that DragonFly supports it as well. So there is no
problem with lack of free primary partitions to install these systems.


-- 
Michel Talon





More information about the Users mailing list