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) | |
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 7b1d18a151f..ad5b38af31d 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} | |||
| 4963 | is interpreted as a partition label name; when it is @code{uuid}, | 4963 | is interpreted as a partition label name; when it is @code{uuid}, |
| 4964 | @code{device} is interpreted as a partition unique identifier (UUID). | 4964 | @code{device} is interpreted as a partition unique identifier (UUID). |
| 4965 | 4965 | ||
| 4966 | UUIDs may be converted from their string representation (as shown by the | ||
| 4967 | @command{tune2fs -l} command) using the @code{uuid} form, like this: | ||
| 4968 | |||
| 4969 | @example | ||
| 4970 | (file-system | ||
| 4971 | (mount-point "/home") | ||
| 4972 | (type "ext4") | ||
| 4973 | (title 'uuid) | ||
| 4974 | (device (uuid "4dab5feb-d176-45de-b287-9b0a6e4c01cb"))) | ||
| 4975 | @end example | ||
| 4976 | |||
| 4966 | The @code{label} and @code{uuid} options offer a way to refer to disk | 4977 | The @code{label} and @code{uuid} options offer a way to refer to disk |
| 4967 | partitions without having to hard-code their actual device name. | 4978 | partitions without having to hard-code their actual device |
| 4979 | name@footnote{Note that, while it is tempting to use | ||
| 4980 | @file{/dev/disk/by-uuid} and similar device names to achieve the same | ||
| 4981 | result, this is not recommended: These special device nodes are created | ||
| 4982 | by the udev daemon and may be unavailable at the time the device is | ||
| 4983 | mounted.}. | ||
| 4968 | 4984 | ||
| 4969 | However, when a file system's source is a mapped device (@pxref{Mapped | 4985 | However, when a file system's source is a mapped device (@pxref{Mapped |
| 4970 | Devices}), its @code{device} field @emph{must} refer to the mapped | 4986 | Devices}), its @code{device} field @emph{must} refer to the mapped |
