Go Back   DaemonForums > FreeBSD > FreeBSD Installation and Upgrading

FreeBSD Installation and Upgrading Installing and upgrading FreeBSD.

Thread Tools Display Modes
  #1   (View Single Post)  
Old 15th November 2014
J65nko J65nko is offline
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,011
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
  #2   (View Single Post)  
Old 15th November 2014
J65nko J65nko is offline
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,011

The dmesg output of this virtual machine installation:
Copyright (c) 1992-2014 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014
    root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
CPU: QEMU Virtual CPU version 2.0.0 (3092.91-MHz K8-class CPU)
  Origin = "GenuineIntel"  Id = 0x663  Family = 0x6  Model = 0x6  Stepping = 3
  AMD Features=0x20100800<SYSCALL,NX,LM>
  AMD Features2=0x21<LAHF,ABM>
  VT-x: (disabled in BIOS) PAT,HLT,PAUSE,EPT,UG
real memory  = 4099932160 (3910 MB)
avail memory = 3912241152 (3731 MB)
Event timer "LAPIC" quality 400
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 4 package(s) x 1 core(s)
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
 cpu2 (AP): APIC ID:  2
 cpu3 (AP): APIC ID:  3
ioapic0 <Version 1.1> irqs 0-23 on motherboard
random: <Software, Yarrow> initialized
kbd1 at kbdmux0
acpi0: <BOCHS BXPCRSDT> on motherboard
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
cpu2: <ACPI CPU> on acpi0
cpu3: <ACPI CPU> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71,0x72-0x77 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 100000000 Hz quality 950
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
isab0: <PCI-ISA bridge> at device 1.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX3 WDMA2 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xc060-0xc06f at device 1.1 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
uhci0: <Intel 82371SB (PIIX3) USB controller> port 0xc000-0xc01f irq 11 at device 1.2 on pci0
usbus0: controller did not stop
usbus0 on uhci0
pci0: <bridge> at device 1.3 (no driver attached)
vgapci0: <VGA-compatible display> mem 0xfc000000-0xfdffffff,0xfebd4000-0xfebd4fff at device 2.0 on pci0
vgapci0: Boot video device
virtio_pci0: <VirtIO PCI Network adapter> port 0xc020-0xc03f mem 0xfebd5000-0xfebd5fff irq 11 at device 3.0 on pci0
vtnet0: <VirtIO Networking Adapter> on virtio_pci0
virtio_pci0: host features: 0x799fffe7 <EventIdx,RingIndirect,0x8000000,NotifyOnEmpty,SetMacAddress,RxModeExtra,VLanFilter,RxMode,ControlVq,Status,MrgRxBuf,TxUFO,TxTSOECN,TxTSOv6,TxTSOv4,RxUFO,RxECN,RxTSOv6,RxTSOv4,TxAllGSO,MacAddress,0x4,RxChecksum,TxChecksum>
virtio_pci0: negotiated features: 0x308fbbe3 <EventIdx,RingIndirect,SetMacAddress,VLanFilter,RxMode,ControlVq,Status,MrgRxBuf,TxTSOECN,TxTSOv6,TxTSOv4,RxECN,RxTSOv6,RxTSOv4,TxAllGSO,MacAddress,RxChecksum,TxChecksum>
vtnet0: Ethernet address: 52:54:00:f0:76:74
hdac0: <Intel 82801F HDA Controller> mem 0xfebd0000-0xfebd3fff irq 11 at device 4.0 on pci0
virtio_pci1: <VirtIO PCI Balloon adapter> port 0xc040-0xc05f irq 10 at device 5.0 on pci0
vtballoon0: <VirtIO Balloon Adapter> on virtio_pci1
virtio_pci1: host features: 0x71000002 <EventIdx,RingIndirect,NotifyOnEmpty,StatsVq>
virtio_pci1: negotiated features: 0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse Explorer, device ID 4
fdc0: <floppy drive controller> port 0x3f2-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: does not respond
device_attach: fdc0 attach returned 6
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
orm0: <ISA Option ROMs> at iomem 0xc0000-0xc8fff,0xec800-0xeffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
attimer0: <AT timer> at port 0x40 on isa0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
fdc0: No FDOUT register!
ppc0: cannot reserve I/O port range
ZFS NOTICE: Prefetch is disabled by default if less than 4GB of RAM is present;
            to enable, add "vfs.zfs.prefetch_disable=0" to /boot/loader.conf.
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
Timecounters tick every 10.000 msec
hdacc0: <Generic (0x1af40022) HDA CODEC> at cad 0 on hdac0
hdaa0: <Generic (0x1af40022) Audio Function Group> at nid 1 on hdacc0
pcm0: <Generic (0x1af40022) (Analog)> at nid 3 and 5 on hdaa0
usbus0: 12Mbps Full Speed USB v1.0
ugen0.1: <Intel> at usbus0
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ada0 at ata0 bus 0 scbus0 target 0 lun 0
ada0: <QEMU HARDDISK 2.0.0> ATA-7 device
ada0: Serial Number QM00001
ada0: 16.700MB/s transfers (WDMA2, PIO 8192bytes)
ada0: 20480MB (41943040 512 byte sectors: 16H 63S/T 16383C)
ada0: Previously was known as ad0
cd0 at ata1 bus 0 scbus1 target 0 lun 0
cd0: <QEMU QEMU DVD-ROM 2.0.> Removable CD-ROM SCSI-0 device 
cd0: Serial Number QM00003
cd0: 16.700MB/s transfers (WDMA2, ATAPI 12bytes, PIO 65534bytes)
cd0: Attempt to query device size failed: NOT READY, Medium not present
uhub0: 2 ports with 2 removable, self powered
random: unblocking device.
SMP: AP CPU #2 Launched!
SMP: AP CPU #3 Launched!
SMP: AP CPU #1 Launched!
Trying to mount root from zfs:zroot/ROOT/default []...
I configured the NIC as a vtnet0 as described in the virtio(4) man page:
# ifconfig
vtnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 52:54:00:f0:76:74
        inet netmask 0xffffff00 broadcast 
        media: Ethernet 10Gbase-T <full-duplex>
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
        inet netmask 0xff000000 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
I picked the default ZFS layout that the installer offered:

# zfs list
zroot                492M  16.8G    96K  none
zroot/ROOT           490M  16.8G    96K  none
zroot/ROOT/default   490M  16.8G   490M  /
zroot/tmp             96K  16.8G    96K  /tmp
zroot/usr            384K  16.8G    96K  /usr
zroot/usr/home        96K  16.8G    96K  /usr/home
zroot/usr/ports       96K  16.8G    96K  /usr/ports
zroot/usr/src         96K  16.8G    96K  /usr/src
zroot/var            548K  16.8G    96K  /var
zroot/var/crash       96K  16.8G    96K  /var/crash
zroot/var/log        160K  16.8G   160K  /var/log
zroot/var/mail       100K  16.8G   100K  /var/mail
zroot/var/tmp         96K  16.8G    96K  /var/tmp
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 03:04 AM.

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