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.
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:
fdisk -l

For example, let's mount the nvme1n1p3 partition to the /mnt directory:
sudo mount /dev/nvme1n1p3 /mnt/
To dismantle we use the following command:
sudo umount /mnt
You can view a list of all mounted devices in a simple way:
mount
Mounting via UUID
To obtain information about the UUID of our server sections, enter this command:
sudo blkid
We get something like this:

Next, go to the config, which contains information about all partitions mounted when the system boots:
sudo nano /etc/fstab
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:
UUID="0x0x0x0x0" /mnt/myfolder rw,nls=utf8,gid=plugdev,umask=0002 0 0
For FAT and FAT32 file systems, the following command is suitable:
UUID="0x0x0x0x0" /mnt/myflash vfat rw,exec,codepage=866,nls=utf8,gid=plugdev,umask=0002,nofail,users 0 0
To update the changes made (mounting drives), enter the command:
sudo mount -a
Results
Ready! We learned how to manually mount drives. The article is relevant for most Linux distributions.
Last updated