diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-07-14 15:06:46 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-07-14 15:24:20 +0200 |
commit | 661a1d7924e174a28e0e21bf516aa1a8a44dad73 (patch) | |
tree | e794ceca18881f189fa0be3a2477cf7a9ccd0182 /doc | |
parent | 0ec5ee94861980a6957d210adf1903ea96202dd9 (diff) | |
download | guix-661a1d7924e174a28e0e21bf516aa1a8a44dad73.tar guix-661a1d7924e174a28e0e21bf516aa1a8a44dad73.tar.gz |
file-systems: Allow users to specify file system UUIDs as strings.
Fixes <http://bugs.gnu.org/19778>.
Reported by Mark H Weaver <mhw@netris.org>.
* 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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/guix.texi | 18 |
1 files changed, 17 insertions, 1 deletions
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 |