The findfs
command is used to find filesystems by their label or UUID. This command is useful when you need to locate a specific filesystem on your Linux system.
Overview
The syntax for the findfs
command is as follows:
findfs [OPTIONS] LABEL=LABEL/UUID=UUID
The LABEL
option is used to search for a filesystem by its label, while the UUID
option is used to search for a filesystem by its UUID.
Example 1: Find a filesystem by label
To find a filesystem by its label, run the following command:
findfs LABEL=mylabel
This will search for a filesystem with the label “mylabel” and return the device name.
Example 2: Find a filesystem by UUID
To find a filesystem by its UUID, run the following command:
findfs UUID=123e4567-e89b-12d3-a456-426655440000
This will search for a filesystem with the UUID “123e4567-e89b-12d3-a456-426655440000” and return the device name.
Options
The following options are available for the findfs
command:
Option | Description |
---|---|
-V |
Display version information and exit. |
-h |
Display help information and exit. |
Troubleshooting Tips
If the findfs
command does not return any results, check that the label or UUID you are searching for is correct. You can use the blkid
command to list all available filesystems and their labels/UUIDs.
Notes
- The
findfs
command is part of theutil-linux
package, which should be installed by default on most Linux distributions. - If you do not have root privileges, you may not be able to use the
findfs
command to search for filesystems.