From owner-freebsd-questions@freebsd.org Fri Jan 19 07:59:54 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53D45EC94EF for ; Fri, 19 Jan 2018 07:59:54 +0000 (UTC) (envelope-from 4250.10.freebsd-questions=freebsd.org@email-od.com) Received: from bca5.email-od.com (bca5.email-od.com [207.246.239.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 210A177013 for ; Fri, 19 Jan 2018 07:59:53 +0000 (UTC) (envelope-from 4250.10.freebsd-questions=freebsd.org@email-od.com) DKIM-Signature: v=1; a=rsa-sha256; d=email-od.com;i=@email-od.com;s=dkim; c=relaxed/relaxed; q=dns/txt; t=1516348797; x=1518940797; h=x-thread-info:date:from:to:cc:subject:message-id:in-reply-to:references:mime-version:content-type:content-transfer-encoding; bh=ua0rT318+yvsu9fKi9v0DarJB3H42i+BBouyu44YDaw=; b=vifrzjwAj16kx65p7ZZyNr+TuNLkIlK4e6D+8ek6U62k0LpULFLbLvQOUy71pMyeq+1ujL8k7qR0aG7X10nvt+4b5RDiSS2vMIjTb+poFdnUikEGdf7W/fy700zjQQSZ3EyEsZOWMtAZb+LRfmq4gOCk5CQemiVwINjPCdftBks= X-Thread-Info: NDI1MC4xMi44ODAwMDAwMDBmYWJhZC5mcmVlYnNkLXF1ZXN0aW9ucz1mcmVlYnNkLm9yZw== Received: from r5.us-west-2a.aws.in.socketlabs.com (r5.us-west-2a.aws.in.socketlabs.com [52.39.5.146]) by bca2.email-od.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Fri, 19 Jan 2018 02:59:51 -0500 Received: from smtp.lan.sohara.org (EMTPY [89.127.62.20]) by r5.us-west-2a.aws.in.socketlabs.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Fri, 19 Jan 2018 02:59:46 -0500 Received: from [192.168.63.1] (helo=steve.lan.sohara.org) by smtp.lan.sohara.org with smtp (Exim 4.90 (FreeBSD)) (envelope-from ) id 1ecRaR-0005pm-A3; Fri, 19 Jan 2018 07:59:43 +0000 Date: Fri, 19 Jan 2018 07:59:43 +0000 From: Steve O'Hara-Smith To: Tim Daneliuk Cc: freebsd-questions@freebsd.org Subject: Re: gpart And VPS Disk: Disappearing swap Partition Message-Id: <20180119075943.aa44341ba798fb1b6c096670@sohara.org> In-Reply-To: <06ff73a3-1c73-3309-985f-297b7dbfa1df@tundraware.com> References: <511934e8-cbcb-75e2-b4ac-ea06e1a54196@tundraware.com> <20180118213913.b39616554429136e897334fa@sohara.org> <06ff73a3-1c73-3309-985f-297b7dbfa1df@tundraware.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd11.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Fri, 19 Jan 2018 07:59:54 -0000 On Thu, 18 Jan 2018 17:02:14 -0600 Tim Daneliuk wrote: > On 01/18/2018 03:39 PM, Steve O'Hara-Smith wrote: > > On Thu, 18 Jan 2018 15:01:56 -0600 > > Tim Daneliuk wrote: > > > >> I have Digital Ocean instance that has about 1G free on the disk. > >> I want to use this to create a second swap partition. I am able to > >> run 'gpart add -t freebsd-swap ...' successfully. That is, gpart show > >> shows that new swap partition as present and I can swap it on. > >> HOWEVER, upon reboot, that partition disappears and the space shows as > >> free again. > >> > >> What am I missing here? > > > > An entry in /etc/fstab something like this: > > > > /dev/gpt/ none swap sw 0 0 > > > > > No, that's not it. There is no /dev/gpt/label to even attempt to mount. My bad, I was assuming you gave it a gpt label, it's pretty much a reflex with me when using gpart :) > Here is what I did: > > gpart add -t freebsd-swap -i4 vtbd0 Try adding -l swap1 to that command viz: gpart add -t freebsd-swap -l swap1 -i4 vtbd0 That *should* cause a /dev/gpt/swap1 to appear and persist through reboots. > gpart modify -i4 -lswapfs2 vtbd0 > > At this point, I can see the new swap partition. However, when I reboot, > it's no longer there. Hmm - does vtbd0 exist at all after reboot ? > So, I tried to follow the above commands with: > > gpart commit vtbd0 > > And I get "Operation not permitted" Hmm interesting, by default commit is a no-op as generally there are no pending changes. > In short, I can interactively create the new partition, but it disappears > on reboot. > > I suspect that the problem has to do with not being able to commit my > changes, but I cannot seem to figure out why this is so. And yes, I've > tried this in single user mode as well. I don't think it's lack of commit, but 'operation not permitted' seems odd. I think the problem stems from vtbd0 not having a /dev/ entry but I could easily be wrong. -- Steve O'Hara-Smith | Directable Mirror Arrays C:\>WIN | A better way to focus the sun The computer obeys and wins. | licences available see You lose and Bill collects. | http://www.sohara.org/