From owner-freebsd-questions@freebsd.org Tue Feb 27 19:16:11 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CCD4F4127F for ; Tue, 27 Feb 2018 19:16:11 +0000 (UTC) (envelope-from johnl@iecc.com) Received: from gal.iecc.com (gal.iecc.com [IPv6:2001:470:1f07:1126:0:43:6f73:7461]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gal.iecc.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 898406A424 for ; Tue, 27 Feb 2018 19:16:10 +0000 (UTC) (envelope-from johnl@iecc.com) Received: (qmail 69558 invoked from network); 27 Feb 2018 19:16:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=iecc.com; h=date:message-id:from:to:subject:mime-version:content-type:user-agent; s=10fb4.5a95ae79.k1802; bh=5ZT8fCKFfuL5KgdY8qgSVh9FDtIakFSYWWhsGj5IVek=; b=Ux4fdE9gPJuCTT4GKPErxTrNWmSmz30GdRXQnPm1qjlrWNbtEOAJc9D1U25DbzFL16y1aVddS+OtKyXXm9/ZvaP8fXmC0mtMsxEBjV5OnZ0csXfPjFq1prPk0vmKV7ARmi7l3GUfC1L6LKO2k8nWkrq42N2qrw2fQmMrKOPwA3nAksaxRXyicV/vdLgbJIajDISS0E7PCERSjHEMK3zThIYDVKMPL2qky94qQ01zAB0OqL3Q6Y5PeXR8cwG4oIC7 Received: from localhost ([IPv6:2001:470:1f07:1126::78:696d:6170]) by imap.iecc.com ([IPv6:2001:470:1f07:1126::78:696d:6170]) with ESMTPS (TLS1.2/X.509/AEAD) via TCP6; 27 Feb 2018 19:16:09 -0000 Date: 27 Feb 2018 14:16:08 -0500 Message-ID: From: "John R. Levine" To: freebsd-questions@freebsd.org Subject: Re: Compiling Swap space User-Agent: Alpine 2.21 (OSX 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 19:16:11 -0000 > You don't need mdconfig, just make a large file and use swapon like this: > ># dd if=/dev/zero of=swapfile bs=1m count=1024 ># swapon swapfile Nope. Try it. You need a block device. # dd if=/dev/zero of=/var/swap bs=1m count=100 100+0 records in 100+0 records out # swapon /var/swap swapon: /var/swap: Block device required # mdconfig -f /var/swap md0 # swapon /dev/md0 # Assuming you want your swap space to come back after a reboot, put a line into /etc/fstab and it'll do the mdconfig and mount at boot time: # Device Mountpoint FStype Options Dump Pass# /dev/vtbd1 none swap sw 0 0 /dev/vtbd0s1a / ufs rw 1 1 md99 none swap sw,file=/var/swap,late 0 0 -- Regards, John Levine, johnl@iecc.com, Primary Perpetrator of "The Internet for Dummies", Please consider the environment before reading this e-mail. https://jl.ly