From owner-freebsd-questions@FreeBSD.ORG Thu Dec 4 17:14:55 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECA31380 for ; Thu, 4 Dec 2014 17:14:54 +0000 (UTC) Received: from bede.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AACF69D for ; Thu, 4 Dec 2014 17:14:54 +0000 (UTC) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.home.qeng-ho.org (8.14.7/8.14.7) with ESMTP id sB4HBd17077016; Thu, 4 Dec 2014 17:11:39 GMT (envelope-from freebsd@qeng-ho.org) Message-ID: <548095CB.9070804@qeng-ho.org> Date: Thu, 04 Dec 2014 17:11:39 +0000 From: Arthur Chance User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Andre Goree , Lowell Gilbert Subject: Re: Issue with swap file References: <44fvcwgzaw.fsf@lowell-desk.lan> <2a3b7da1d03fd215ba1792e6617cfdb7@drenet.net> <44wq675qya.fsf@be-well.ilk.org> <3aff40bfeeb66db5cf30286a804ea5d0@drenet.net> In-Reply-To: <3aff40bfeeb66db5cf30286a804ea5d0@drenet.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 17:14:55 -0000 On 04/12/2014 16:52, Andre Goree wrote: > On 12/04/2014 11:18 am, Lowell Gilbert wrote: >> Andre Goree writes: >> >>> On 12/03/2014 5:10 pm, Lowell Gilbert wrote: >>>> Andre Goree writes: >>>> >>>>> Several months ago, I followed the procedure here[1] for creating a >>>>> swap file. This worked great for a long time, up until my last reboot >>>>> which coincided with an update to 10.1. >>>>> >>>>> agoree@fbsd10-atl ~ % grep swap /etc/fstab >>>>> md99 none swap sw,file=/usr/swap 0 0 >>>>> agoree@fbsd10-atl ~ % sudo swapon -a >>>>> swapon: mdconfig (attach) error: md99 on file=/usr/swap >>>>> >>>>> I've also tried zero-writing the file again, to no avail. Any ideas? >>>>> >>>>> [1] https://www.freebsd.org/doc/handbook/adding-swap-space.html >>>> >>>> Strange, I haven't run into any problems. And annoying that the error >>>> message is so unhelpful. When that error message gets printed, swapon >>>> has tried to run mdconfig and gotten an error back, but has no idea >>>> what >>>> the problem was. At that point, it has already checked that the md >>>> device is available, which eliminates my best guess at a diagnosis. >>>> >>>> The way you can get more information is by running the mdconfig command >>>> by hand, just as swapon would have, and see what *it* reports to you. >>>> mdconfig -a -t vnode -n -f /usr/swap >>>> >>>> Very likely, it will tell you exactly what to fix. >>> >>> I tried creating a new one (hence the '/usr/swap0' vs. '/usr/swap' in >>> the output below) and still got the same error. Here's the >>> [disheartening] output from the command you gave: >>> >>> agoree@fbsd10-atl ~ % sudo swapon -a >>> swapon: mdconfig (attach) error: md99 on file=/usr/swap0 >>> agoree@fbsd10-atl ~ % sudo mdconfig -a -t vnode -n -f /usr/swap0 >>> 0 >> >> Okay, that means mdconfig can attach the file to an md device. That >> eliminates my next guess, which was that md support wasn't working for >> some reason (such as not being in your kernel configuration). >> >> The only difference I can see is the unit number, which I forgot to >> include in the command. Maybe if you try >> mdconfig -a -t vnode -n -f /usr/swap -u 99 >> that will fail with an informative error message. If that doesn't help, >> I'm baffled. > > Progress perhaps being made. > > agoree@fbsd10-atl ~ % sudo mdconfig -a -t vnode -n -f /usr/swap0 -u 99 > mdconfig: ioctl(/dev/mdctl): Device busy > agoree@fbsd10-atl ~ % swapinfo > Device 1K-blocks Used Avail Capacity > agoree@fbsd10-atl ~ % > > Wtf? This is the newly created file too... > Have you tried "mdconfig -l" to see what existing md devs there are? Device busy often means "we've got one already". -- Those who do not learn from computing history are doomed to GOTO 1