Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Dec 2000 17:05:21 -0600
From:      Greg Barniskis <madizen@tds.net>
To:        freebsd-questions@freebsd.org
Subject:   added swap, fishy results
Message-ID:  <4.3.1.20001209110239.00a707b0@mail.tds.net>

next in thread | raw e-mail | index | archive | help
FreeBSD freedom.my.domain 4.1-RELEASE FreeBSD 4.1-RELEASE #2: Tue Dec  5 
18:07:27 CST 2000     goyo@freedom.my.domain:/usr/src/sys/compile/FREEDOM  i386

Using 4.1-R on a rather pitiful old 486, I ran into trouble compiling some 
larger ports and running out of swap space. Have 32M physical RAM, took 
defaults on install and got 36M swap (should've known to increase it off 
the bat, but...).

OK, found the handbook steps for increasing swap using vn driver. Sounds 
sweet & easy, but reviewed some -questions threads and decided I'd be best 
off with genuine swap space as I've been accustomed to.

Created another 36M swap partition with /stand/sysinstall's disk label tool 
using some space I'd reserved as ad0s1h, and marked its availability and 
swap assignment in /etc/fstab. Got recognized and mounted as swap fine at 
boot time and swapinfo showed it being used in equal proportion to the 
primary swap device as desired (yay!). But about an hour later during a 
heavy compile the system booted itself.

Since it had been behaving fine prior to my hacking at the swap config, I 
figured I did something wrong. But looking about, I think I did it right...

freedom# disklabel -r ad0
# /dev/ad0c:
...snip...
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
   a:   102400        0    4.2BSD        0     0     0   # (Cyl.    0 - 25*)
   b:    74880   102400      swap                        # (Cyl.   25*- 43*)
   c:  2128833        0    unused        0     0         # (Cyl.    0 - 527*)
   e:   102400   177280    4.2BSD        0     0     0   # (Cyl.   43*- 69*)
   f:  1740800   279680    4.2BSD        0     0     0   # (Cyl.   69*- 501*)
   g:    32768  2020480    4.2BSD     1024  8192    16   # (Cyl.  501*- 509*)
   h:    75585  2053248      swap                        # (Cyl.  509*- 527*)

freedom# cat /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad0s1b             none            swap    sw              0       0
/dev/ad0s1h             none            swap    sw              0       0
/dev/ad0s1a             /               ufs     rw              1       1
/dev/ad0s1g             /extra          ufs     rw              2       2
/dev/ad0s1f             /usr            ufs     rw              2       2
/dev/ad0s1e             /var            ufs     rw              2       2
/dev/acd0c              /cdrom  cd9660  ro,noauto       0       0
proc                    /proc           procfs  rw              0       0

Not finding ready step-by-step documentation for the disk label method 
(which I'd done before on 2.x and 3.x machines and thought I'd completed 
satisfactorily here), I decided to comment out the fstab line for the new 
swap partition and try with the handbook instructions despite a performance 
hit warning for this method (I need the swap already, at least until I find 
more compatible SIMMs):

>Make sure your kernel was built with the line
>     pseudo-device   vn 1   #Vnode driver (turns a file into a device)
>in your config-file. The GENERIC kernel already contains this.

I had stripped down GENERIC to a bare minimum and added back what I needed 
(config appended to this message), so had to replace this entry. But, no 
apparent problems making/installing the new kernel.

>create a vn-device
>     # cd /dev
>     # sh MAKEDEV vn0
>create a swapfile (/usr/swap0)
>     # dd if=/dev/zero of=/usr/swap0 bs=1024k count=64

(in actuality, I used count=96, assuming it fair game to tweak)

>set proper permissions on (/usr/swap0)
>     # chmod 0600 /usr/swap0
>enable the swap file in /etc/rc.conf
>     swapfile="/usr/swap0"   # Set to name of swapfile if aux swapfile 
> desired.
>reboot the machine
>
>To enable the swap file immediately, type
>     # vnconfig -ce /dev/vn0c /usr/swap0 swap

OK, no problem.

freedom# ll /usr/swap0
-rw-------  1 root  wheel  98304 Dec  9 10:00 /usr/swap0

However, no matter whether I enable swap0 in rc.conf and boot, or enable it 
manually with vnconfig, I don't seem to get additional swap space. It 
reports as -32 blocks, 100% filled. What'd I break and how do I fix it?

freedom# swapinfo
Device          1K-blocks     Used    Avail Capacity  Type
/dev/ad0s1b         37312    34412     2900    92%    Interleaved
/dev/rvn0c            -32      -32        0   100%    Interleaved
Total               37280    34380     2900    92%

TIA for any advice/pointers. As you can see, compiles readily consume my 
usable swap, no RAM is on hand, and I'd like to resolve this ASAP.

Expecting maybe I slashed my kernel config too much and that you'll ask for 
it, here:
# please trim on replies...
#================================================================
# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.246.2.8 2000/07/20 02:51:02 
msmith Exp $

machine         i386
cpu             I386_CPU
cpu             I486_CPU
cpu             I586_CPU
cpu             I686_CPU
ident           FREEDOM
maxusers        64

#makeoptions    DEBUG=-g                #Build kernel with gdb(1) debug symbols

options         MATH_EMULATE            #Support for x87 emulation
options         INET                    #InterNETworking
options         INET6                   #IPv6 communications protocols
options         IPFIREWALL              #ipfw support
options         IPFIREWALL_VERBOSE      #log them bad boys, grrrls, and d00dz
options         IPFIREWALL_FORWARD      #enable transparent proxy support
options         IPFIREWALL_VERBOSE_LIMIT=100    #limit verbosity
options         IPDIVERT                #ipfw->natd support
options         FFS                     #Berkeley Fast Filesystem
options         FFS_ROOT                #FFS usable as root device [keep this!]
options         SOFTUPDATES             #Enable FFS soft updates support
options         MFS                     #Memory Filesystem
options         MD_ROOT                 #MD is a potential root device
options         NFS                     #Network Filesystem
options         NFS_ROOT                #NFS usable as root device, NFS 
required
options         MSDOSFS                 #MSDOS Filesystem
options         CD9660                  #ISO 9660 Filesystem
options         CD9660_ROOT             #CD-ROM usable as root, CD9660 required
options         PROCFS                  #Process filesystem
options         COMPAT_43               #Compatible with BSD 4.3 [KEEP THIS!]
options         SCSI_DELAY=15000        #Delay (in ms) before probing SCSI
options         UCONSOLE                #Allow users to grab the console
options         USERCONFIG              #boot -c editor
options         VISUAL_USERCONFIG       #visual boot -c editor
options         KTRACE                  #ktrace(1) support
options         SYSVSHM                 #SYSV-style shared memory
options         SYSVMSG                 #SYSV-style message queues
options         SYSVSEM                 #SYSV-style semaphores
options         P1003_1B                #Posix P1003_1B real-time extensions
options         _KPOSIX_PRIORITY_SCHEDULING
options         ICMP_BANDLIM            #Rate limit bad replies
options         KBD_INSTALL_CDEV        # install a CDEV entry in /dev

device          isa
device          eisa
device          pci

# Floppy drives
device          fdc0    at isa? port IO_FD1 irq 6 drq 2
device          fd0     at fdc0 drive 0

# ATA and ATAPI devices
device          ata0    at isa? port IO_WD1 irq 14
device          ata1    at isa? port IO_WD2 irq 15
device          ata
device          atadisk                 # ATA disk drives
device          atapicd                 # ATAPI CDROM drives
device          atapifd                 # ATAPI floppy drives
device          atapist                 # ATAPI tape drives
options         ATA_STATIC_ID           #Static device numbering
#options        ATA_ENABLE_ATAPI_DMA    #Enable DMA on ATAPI devices

# SCSI Controllers
device          ahb             # EISA AHA1742 family
device          ahc             # AHA2940 and onboard AIC7xxx devices

device          adv0    at isa?
device          adw
device          bt0     at isa?
device          aha0    at isa?
device          aic0    at isa?

# SCSI peripherals
device          scbus           # SCSI bus (required)
device          da              # Direct Access (disks)
device          sa              # Sequential Access (tape etc)
device          cd              # CD
device          pass            # Passthrough device (direct SCSI access)

# atkbdc0 controls both the keyboard and the PS/2 mouse
device          atkbdc0 at isa? port IO_KBD
device          atkbd0  at atkbdc? irq 1 flags 0x1
device          psm0    at atkbdc? irq 12

device          vga0    at isa?

# splash screen/screen saver
pseudo-device   splash

# syscons is the default console driver, resembling an SCO console
device          sc0     at isa? flags 0x100

# Floating point support - do not disable.
device          npx0    at nexus? port IO_NPX irq 13

# Power management support (see LINT for more options)
device          apm0    at nexus? disable flags 0x20 # Advanced Power 
Management

# Serial (COM) ports
device          sio0    at isa? port IO_COM1 flags 0x10 irq 4
device          sio1    at isa? port IO_COM2 irq 3

# Parallel port
device          ppc0    at isa? irq 7
device          ppbus           # Parallel port bus (required)
device          lpt             # Printer
device          plip            # TCP/IP over parallel
device          ppi             # Parallel port interface device
device          vpo             # Requires scbus and da

#
# Network interfaces: `cx', `ed', `el', `ep', `ie', `is', `le', `lnc'
#
device cs0 at isa? port 0x300
device ed0 at isa? port 0x280 irq 5 iomem 0xd8000
device el0 at isa? port 0x300 irq 9
device ex
device fe0 at isa? port 0x300
device ie0 at isa? port 0x300 irq 5 iomem 0xd0000
device ie1 at isa? port 0x360 irq 7 iomem 0xd0000
device le0 at isa? port 0x300 irq 5 iomem 0xd0000
device lnc0 at isa? port 0x280 irq 10 drq 0
device rdp0 at isa? port 0x378 irq 7 flags 2
device sn0 at isa? port 0x300 irq 10
options         WLCACHE         # enables the signal-strength cache
options         WLDEBUG         # enables verbose debugging output
device wl0 at isa? port 0x300

# PCI Ethernet NICs.
device          de              # DEC/Intel DC21x4x (``Tulip'')
device          fxp             # Intel EtherExpress PRO/100B (82557, 82558)
device          tx              # SMC 9432TX (83c170 ``EPIC'')
device          vx              # 3Com 3c590, 3c595 (``Vortex'')
device          wx              # Intel Gigabit Ethernet Card (``Wiseman'')

# ISA Ethernet NICs.
device          ed1     at isa? port 0x280 irq 10 iomem 0xd8000
device          ep
# The probe order of these is presently determined by i386/isa/isa_compat.c.
device          ie2     at isa? port 0x300 irq 10 iomem 0xd0000

# Pseudo devices - the number indicates how many units to allocated.
pseudo-device   loop            # Network loopback
pseudo-device   ether           # Ethernet support
pseudo-device   sl      1       # Kernel SLIP
pseudo-device   ppp     1       # Kernel PPP
pseudo-device   tun             # Packet tunnel.
pseudo-device   pty             # Pseudo-ttys (telnet etc)
pseudo-device   md              # Memory "disks"
pseudo-device   gif     4       # IPv6 and IPv4 tunneling
pseudo-device   faith   1       # IPv6-to-IPv4 relaying (translation)

# The `bpf' pseudo-device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
pseudo-device   bpf             #Berkeley packet filter

# pseudo-device vn for adding swap file within /usr as per handbook
pseudo-device   vn      1       #Vnode driver (turns a file into a device)



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4.3.1.20001209110239.00a707b0>