Solved ZFS - no swap partition loaded?

Hi all,

I installed 10.1-RELEASE on an 8Gbyte RAM, 750Gbyte HDD laptop using the DVD image. Via bsdinstall I set up using Root-on-ZFS with 16GByte swap partition. However, I spied an issue when I tried to build some ports and got out of swap space messages.

The top utility showed no swap info -

upload_2015-5-28_13-39-57.png


even though the swap partition exists as ada0p2. Its entry exists in fstab but does not load at boot (get a no file or directory message for swapon) nor if I tried to manually use the swapon tool.

upload_2015-5-28_13-39-46.png


The /dev/ada0p2 is just not there.

I've reread the handbook and trolled the forum but can't (easily) see an answer.

Not sure what to do except ask for help - so... Help!

Thanks,
Chris.
 
Have a look with gpart show -l:
Code:
dice@armitage:~/test % gpart show -l
=>       34  314572733  vtbd0  GPT  (150G)
         34       1024      1  gptboot0  (512K)
       1058    4194304      2  swap0  (2.0G)
    4195362  310377405      3  zfs0  (148G)
Then use the GPT label to reference the swap:
Code:
dice@armitage:~/test % cat /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/gpt/swap0          none            swap    sw              0       0
tmpfs                   /tmp            tmpfs   rw,mode=1777    0       0
 
Thanks SirDice. I got the same result as yours for gpart show -l ie swap0, and edited the fstab accordingly. But there is no /dev/gpt/ folder nor can I find any file called swap0 anywhere on the system.

Odd but creating the ZFS swap through bsdinstall works on my Virtualbox image (on another machine) but not on my physical laptop.
 
What disk devices do you actually have?
Code:
ls /dev/ada*
ls /dev/da*
Also of interest, what device is ZFS using for the pool?
Code:
zpool status
 
Edit: You have posted the devices, I just missed it as it's a very short list...
Something is amiss somewhere as the system is not picking up any of the partitions and not creating device nodes for them.

Seeing how the ZFS partition is the third on the disk, and it's using /dev/diskid/DISK-J2590054GNWMKGp3, I would hazard a guess that the swap partition should be appearing as /dev/diskid/DISK-J2590054GNWMKGp2, but this doesn't explain why you don't have ada0p1/ada0p2/ada0p3 in /dev.
 
Using /dev/diskid/DISK-J2590054GNWMKGp2 works!!! I have my 16Gbytes as swap now listed in top. You are right though as to why ada0p1 and ada0p2 are not listed under /dev nor /dev/gpt exists as SirDice expected. As I said before the install was from the DVD image/bsdinstall.

Happy to test things if you can think of any more.

For now I can live with this and move to the next problem :)
 
Just as a follow up, I had a second HP laptop and it too had the same issue. I could only get the swap to work by specifying /dev/diskid/DISK-....p2 in /etc/fstab instead of /dev/ada0p2 or /dev/gpt/swap.

I shall be sure to use whatever device is listed by zpool status in future.
 
Back
Top