From 661a1d7924e174a28e0e21bf516aa1a8a44dad73 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 14 Jul 2015 15:06:46 +0200 Subject: file-systems: Allow users to specify file system UUIDs as strings. Fixes . Reported by Mark H Weaver . * gnu/system/file-systems.scm (%uuid-rx): New variable. (string->uuid): New procedure. (uuid): New macro. * tests/file-systems.scm: New file. * Makefile.am (SCM_TESTS): Add it. * doc/guix.texi (File Systems): Give an example of UUID. --- doc/guix.texi | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 7b1d18a151..ad5b38af31 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4963,8 +4963,24 @@ interpreted as a file name; when it is @code{label}, then @code{device} is interpreted as a partition label name; when it is @code{uuid}, @code{device} is interpreted as a partition unique identifier (UUID). +UUIDs may be converted from their string representation (as shown by the +@command{tune2fs -l} command) using the @code{uuid} form, like this: + +@example +(file-system + (mount-point "/home") + (type "ext4") + (title 'uuid) + (device (uuid "4dab5feb-d176-45de-b287-9b0a6e4c01cb"))) +@end example + The @code{label} and @code{uuid} options offer a way to refer to disk -partitions without having to hard-code their actual device name. +partitions without having to hard-code their actual device +name@footnote{Note that, while it is tempting to use +@file{/dev/disk/by-uuid} and similar device names to achieve the same +result, this is not recommended: These special device nodes are created +by the udev daemon and may be unavailable at the time the device is +mounted.}. However, when a file system's source is a mapped device (@pxref{Mapped Devices}), its @code{device} field @emph{must} refer to the mapped -- cgit v1.2.3