Other FreeBSD mounted my hackintosh partition as swap?!

I happened to notice this in the output of dmesg as I was looking for any sign of life from my unsupported SD card reader:

Code:
EOM_PART: Partition 'ada0p3' not suitable for kernel dumps (wrong type?)
warning: total configured swap (31668793 pages) exceeds maximum recommended amount (16159496 pages).
warning: increase kern.maxswzone or reduce amount of swap.
warning: total configured swap (31930937 pages) exceeds maximum recommended amount (16159496 pages).
warning: increase kern.maxswzone or reduce amount of swap.

I ran top and it reported 121GB of swap!

I have 3 drives in my system: ada0 is Linux + Hackintosh, ada1 and ada2 are mirrored freebsd zfs:

Code:
gpart show ada0
=>       34  488397101  ada0  GPT  (233G)
         34          6        - free -  (3.0K)
         40     409600     1  efi  (200M)
     409640  234375000     2  linux-data  (112G)
  234784640     262144        - free -  (128M)
  235046784  253350344     3  !7c3457ef-0000-11aa-aa11-00306543ecac  (121G)
  488397128          7        - free -  (3.5K)

It looks like FreeBSD saw partition 3 on ada0 and decided (based on the layout of the other drives where the 3rd slice is freebsd-swap) the strange Apple filesystem was 122GB of swap.

Code:
gpart show ada1
=>       40  937703008  ada1  GPT  (447G)
         40     409600     1  efi  (200M)
     409640       1024     2  freebsd-boot  (512K)
     410664        984        - free -  (492K)
     411648    2097152     3  freebsd-swap  (1.0G)
    2508800  935192576     4  freebsd-zfs  (446G)
  937701376       1672        - free -  (836K)

Code:
part show ada2
=>       40  937703008  ada2  GPT  (447G)
         40     409600     1  efi  (200M)
     409640       1024     2  freebsd-boot  (512K)
     410664        984        - free -  (492K)
     411648    2097152     3  freebsd-swap  (1.0G)
    2508800  935192576     4  freebsd-zfs  (446G)
  937701376       1672        - free -  (836K)

I ran swapoff /dev/ada0p3 and it looks like now there is only 1GB of swap. But can I prevent it from being used as swap again when I reboot?
I guess I could put it in a shell script in /usr/local/rc.d/ ....

I'm not sure if selected ada1 or ada2 in the bios as the default startup drive. Could it be messing something up if I selected one and then then other, returning to FreeBSD from using another OS? ada1 and ada2 are mirrors.

There is no mention of swap in /etc/fstab or rc.conf. I don't want to disable swap completely, but just make sure freebsd never touches /dev/ada0p3.
 
So I guess changing the boot order in the bios switched ada0 <--->ada2 since I had selected ada1 and ada2 in the setup utility.

After rebooting, I see the correct partitions as swap:
Code:
swapinfo
Device          1K-blocks     Used    Avail Capacity
/dev/ada1p3       1048576        0  1048576     0%
/dev/ada2p3       1048576        0  1048576     0%
Total             2097152        0  2097152     0%

Can I assign swap in fstab by 0xhex_blah_blah instead of using /dev/adaXpY ?
Can I write instead of /dev/ada1p3 in fstab for the swap:

Code:
# Device                Mountpoint      FStype  Options         Dump    Pass#
UUID=516e7cb5-6ecf-11d6-8ff8-00022d09712b            none    swap    sw              0       0
?

I'll have to be more careful switching OSes in the bios. Or find a boot manager that can load OS X, FreeBSD, and Linux not all residing on the same drive.
 
You can use labels, GPT labels, GPT UUIDs, UFS volume names, UFS filesystem IDs, etc. See glabel(8) for a list of possible labels you can use.
 
Back
Top