Mounting swap without device name

Christian Baer christian.baer at uni-dortmund.de
Fri Dec 5 23:51:11 UTC 2014


Good evening, dear readers! :-)

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?

Best regards,
Chris



More information about the freebsd-questions mailing list