Go Back   DaemonForums > FreeBSD > FreeBSD Installation and Upgrading

FreeBSD Installation and Upgrading Installing and upgrading FreeBSD.

Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 15th November 2014
J65nko J65nko is offline
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,610
Default FreeBSD 10.1 /etc/fstab error for swap in a KVM VM

I just installed FreeBSD 10.1 in a KVM virtual machine under Linux Mint 17 and noticed that the configured swap was not enabled because of an device naming issue in /etc/fstab.

The error message on the console:
swapon: /dev/ada0p2: No such file or directory
A quick check showed no swap was listed:
# swapctl -l
Device:       1024-blocks     Used:

# cat /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ada0p2             none    swap    sw              0       0

#  ls -l /dev/ada0p2
ls: /dev/ada0p2: No such file or directory
Checking with gpart:
#  gpart show -lp
=>      34  41942973    diskid/DISK-QM00001  GPT  (20G)
        34      1024  diskid/DISK-QM00001p1  gptboot0  (512K)
      1058   4194304  diskid/DISK-QM00001p2  swap0  (2.0G)
   4195362  37747645  diskid/DISK-QM00001p3  zfs0  (18G)
Testing to add swap with this device or diskid:
# swapctl -a /dev/diskid/DISK-QM00001p2
swapctl: adding /dev/diskid/DISK-QM00001p2 as swap device

# swapctl -l
Device:       1024-blocks     Used:
/dev/diskid/DISK-QM00001p2   2097152         0
After editing /etc/fstab:
# cat /etc/fstab
# Device                        Mountpoint      FStype  Options         Dump    Pass#
#/dev/ada0p2                    none            swap    sw              0       0
/dev/diskid/DISK-QM00001p2      none            swap    sw              0       0
Disabling and enabling swap using /etc/fstab:

# swapoff -a
swapoff: removing /dev/diskid/DISK-QM00001p2 as swap device

# swapon -a
swapon: adding /dev/diskid/DISK-QM00001p2 as swap device
After a reboot I had swap
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote

/etc/fstab, freebsd 10.1, kvm, swap, swapctl, virtual machine

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Core dump and implications on the size of the partitions /var and swap aleunix OpenBSD Installation and Upgrading 4 1st March 2012 05:19 PM
Get Kernal Swap File scull7 OpenBSD General 1 20th December 2010 10:58 PM
How to swap partitions Help revzalot OpenBSD Installation and Upgrading 2 1st September 2009 07:44 AM
swap partition lumiwa FreeBSD General 6 11th September 2008 03:57 PM
Do you still use swap? JMJ_coder Off-Topic 22 11th July 2008 01:24 AM

All times are GMT. The time now is 06:54 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick