Unlike Windows, which automatically mounts all drives, Linux requires you to do this manually in most cases. So let's find out!
Mounting drives is done using the mount utility. It is usually used together with arguments.
mount «parameters» «- File System» «File Drive» «Final Catalogue for Installation»
The following arguments are available to users:
-v — obtaining detailed information during the operation.
-h — Help output.
-V —output of the software version.
-a —use all devices specified in fstab to mount.
-F — creating an individual mount instance for each partition.
-f — «fake execution». Allows you to see indirectly what will result from the execution of the command.
-n —Don't log mount data in Mtab.
-l — Adding a drive label to the mount endpoint.
-c — use exclusively absolute paths.
-r — installation for later reading of files.
-w — installation for subsequent reading and writing of files.
-L — mount the section by the label «Label».
-U — mount partition by UUID.
-B — mount local directory.
-R — remount the local directory.
Mounting via Mount
The process of mounting drives using the Mount utility is very simple. To do this, just enter a command specifying as arguments the partition that needs to be used for mounting and the directory where this partition should be mounted.
We can get a list of all existing partitions like this:
For example, let's mount the nvme1n1p3 partition to the /mnt directory:
To dismantle we use the following command:
You can view a list of all mounted devices in a simple way:
Mounting via UUID
To obtain information about the UUID of our server sections, enter this command:
We get something like this:
Next, go to the config, which contains information about all partitions mounted when the system boots:
Then, depending on the file system, you should add a line with the appropriate parameters to this config.
Let's say if we need to mount an NTFS partition, then in this case we should use the command:
For FAT and FAT32 file systems, the following command is suitable:
Where «UUID=""» - UUID drive, which must be used.
«/mnt/...» - the location of the catalogue, where it is necessary to install.
To update the changes made (mounting drives), enter the command:
Results
Ready! We learned how to manually mount drives. The article is relevant for most Linux distributions.
Last updated