genfstab
Write fstab entries for what is mounted under <root>.
genfstab [-f <filter>] [-L|-U|-t <tag>] [-p|-P] <root>
genfstab prints the entries; append them to the new system's /etc/fstab
yourself.
Options
| Option | Description |
|---|---|
-U | UUID= for sources |
-L | LABEL= for sources |
-t <tag> | <tag>= for sources: UUID, LABEL, PARTUUID, PARTLABEL |
-f <filter> | Only mountpoints starting with <filter> |
-p | Leave pseudo filesystems out (the default) |
-P | Keep pseudo filesystems |
-h, --help | Show help |
-V, --version | Show the version |
Without -U, -L or -t, sources are device paths such as /dev/sda1, with
the UUID and label in a comment above each entry. With a tag, it's the other
way round: the tag is the source and the device goes in the comment.
tip
Use -U. Device names can change between boots; UUIDs don't.
Example
genfstab -U /mnt >> /mnt/etc/fstab