Date: Fri, 6 Apr 2012 10:27:39 +0000 From: Alexander Best <arundel@freebsd.org> To: Warren Block <wblock@wonkity.com> Cc: freebsd-questions@freebsd.org Subject: Re: question regarding geom labels Message-ID: <20120406102739.GA9704@freebsd.org> In-Reply-To: <alpine.BSF.2.00.1203300836580.57460@wonkity.com> References: <20120330130051.GA62102@freebsd.org> <alpine.BSF.2.00.1203300836580.57460@wonkity.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri Mar 30 12, Warren Block wrote: > On Fri, 30 Mar 2012, Alexander Best wrote: > > >i have a question regarding a label for a swap partition. when should i do > >the > >labeling? after or before creating the partition scheme? > > > >when i label before creating the partition scheme, likes this: > > > >glabel label -v swap /dev/da0 > >gpart create -s GPT /dev/da0 > > > >i get the following warning: > > > >GEOM: da1: the secondary GPT header is not in the last LBA. > > > >which is obvious, because the label is being written into the last LBA and > >thus > >the backup GPT header gets written into the last-1 LBA. > > Right. Don't do that, the GPT backup header needs to be at the end of > the physical device. If you're using that whole disk for swap, there's > no need for a partition anyway. > > >if i create the partitioning scheme before labeling the device, like this: > > > >gpart create -s GPT /dev/da0 > >glabel label -v swap /dev/da0 > > > >or > > > >gpart create -s GPT /dev/da0 > >gpart add -t freebsd-swap /dev/da0 > >glabel label -v swap /dev/da0p1 > > > >the label gets written into da0 or da0p1 and is at constant risk of being > >overwritten by userdata. > > No. The swap device entered in /etc/fstab would be /dev/label/swap, > which is one block smaller than da0p1. That's the last-block metadata, > it's safe. thanks for the info. :) > > But if the whole disk is for swap, skip the partitioning entirely.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120406102739.GA9704>