Solved Swap on ZFS has been disabled after hardware upgrade.

Greetings to everyone.

Here is my problem :

I just upgraded my workstation, from AMD FX 6300 to AMD Opteron 6380, everything runs fine on my FreeBSD 12.0 p10, except that my swap completely disappear. It is a real problem since I have only 8GB of ram for now on ZFS. Before I used to have 32GB of swap ! Maybe it is also important to mention that I installed FreeBSD 12.0 on a Single Disk with full encryption of data and swap. Here is what I got when I do zfs list :

Code:
zroot                526G   342G    88K  /zroot
zroot/ROOT          26.4G   342G    88K  none
zroot/ROOT/default  26.4G   342G  26.4G  /
zroot/tmp            156M   342G   156M  /tmp
zroot/usr            500G   342G    88K  /usr
zroot/usr/home       492G   342G   492G  /usr/home
zroot/usr/ports     6.86G   342G  6.86G  /usr/ports
zroot/usr/src        684M   342G   684M  /usr/src
zroot/var           2.06M   342G    88K  /var
zroot/var/audit       88K   342G    88K  /var/audit
zroot/var/crash       88K   342G    88K  /var/crash
zroot/var/log       1.61M   342G  1.61M  /var/log
zroot/var/mail       112K   342G   112K  /var/mail
zroot/var/tmp         88K   342G    88K  /var/tmp

zroot/swap is no more. If anyone know how to fix that, I will be grateful.

Thank you in advance for any responses.
 
Also, when I do gpart show I got this :

Code:
=>        40  1953525088  ada2  GPT  (932G)
          40        1024     1  freebsd-boot  (512K)
        1064         984        - free -  (492K)
        2048    67108864     2  freebsd-swap  (32G)
    67110912  1886412800     3  freebsd-zfs  (900G)
  1953523712        1416        - free -  (708K)

So the swap space seems to be still here, but I do not know how to re-enable it.

And here is the content of /etc/fstab, maybe it could help :

Code:
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/ada0p2.eli none            swap    sw      0       0
proc    /proc           procfs  rw      0       0
md      /ramdisk        mfs     rw,-s32G        2       0
fdesc   /dev/fd         fdescfs         rw      0       0
 
I think I managed to fix it, in fact the solution was right in front of my eyes. The problem was that the disk ID changed from 0 to 2. So In order to fix it, I simply changed the ID in /etc/fstab to this :

Code:
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/ada2p2.eli none            swap    sw      0       0
proc    /proc           procfs  rw      0       0
md      /ramdisk        mfs     rw,-s32G        2       0
fdesc   /dev/fd         fdescfs         rw      0       0

I hope this may help person in the same situation in the future, the problem is now solved !
 
Back
Top