Skip to content

Instantly share code, notes, and snippets.

@jim-p
Created May 14, 2013 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jim-p/5579101 to your computer and use it in GitHub Desktop.
Save jim-p/5579101 to your computer and use it in GitHub Desktop.
change to ufsid format. Should be scriptable.
: cat /etc/fstab
# Device Mountpoint FStype Options Dump Pass#
/dev/ad0s1a / ufs rw 1 1
/dev/ad0s1b none swap sw 0 0
: dumpfs /dev/ad0s1a | head -n 2 | tail -n 1 | cut -f2 -d'[' | cut -f1 -d ']' | sed -e 's/[[:blank:]]//g'
51928c99a471c440
: swapoff -a
: glabel label swap /dev/ad0s1b
: sed -i'' -e 's/ad0s1a/ufsid\/51928c99a471c440/g' /etc/fstab
: sed -i'' -e 's/ad0s1b/label\/swap/g' /etc/fstab
: cat /etc/fstab
# Device Mountpoint FStype Options Dump Pass#
/dev/ufsid/51928c99a471c440 / ufs rw 1 1
/dev/label/swap none swap sw 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment