From owner-freebsd-questions@FreeBSD.ORG Sat Dec 6 00:02:44 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 C25643A1 for ; Sat, 6 Dec 2014 00:02:44 +0000 (UTC) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82D8DC8E for ; Sat, 6 Dec 2014 00:02:44 +0000 (UTC) Received: from r56.edvax.de (port-92-195-18-117.dynamic.qsc.de [92.195.18.117]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id C19633CDC8; Sat, 6 Dec 2014 01:02:35 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id sB602Zlm002704; Sat, 6 Dec 2014 01:02:35 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 6 Dec 2014 01:02:35 +0100 From: Polytropon To: Christian Baer Subject: Re: Mounting swap without device name Message-Id: <20141206010235.331c3212.freebsd@edvax.de> In-Reply-To: References: Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org 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: Sat, 06 Dec 2014 00:02:44 -0000 On Sat, 06 Dec 2014 00:50:50 +0100, Christian Baer wrote: > Changing device IDs can be a pain. Adding a hard drive to my system results > in the system not booting anymore because the device name for / changes > after the second drive is detected. I have overcome this by having an fstab > like this: > > # Device Mountpoint FStype Options Dump Pass# > /dev/ufs/root / ufs rw 1 1 > /dev/ada0s3b none swap sw 0 0 > /dev/ufs/var /var ufs rw 2 2 > /dev/ufs/usr /usr ufs rw 2 2 > proc /proc procfs rw 0 0 > > As is plain to see, my machine boots from an MBR drive (in this case an > SSD). Note the swap drive however. I have not found a way so far to label > the swap partition in a way that I can make the system find it at boot time. > > Is there a way to do this and if so, then how? With "glabel label" - you cannot use a UFS label (like for the partitions shown in your /etc/fstab) because swap does not have a file system, but you can use gpart to attach a label to the partition itself. It could be "/dev/label/swap" (note: not "/dev/ufs/swap" for mentioned reasons). More information here: http://www.wonkity.com/~wblock/docs/html/disksetup.html#_the_old_standard_mbr -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...