Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Dec 2014 01:02:35 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Christian Baer <christian.baer@uni-dortmund.de>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Mounting swap without device name
Message-ID:  <20141206010235.331c3212.freebsd@edvax.de>
In-Reply-To: <m5tgcq$f9i$1@ger.gmane.org>
References:  <m5tgcq$f9i$1@ger.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141206010235.331c3212.freebsd>