2.3 KiB
mounting
"Mounting" is the process of adding a file system in the existing directory structure. This mounting is necessary to be able to access files of a file system with usual programs. File systems are mounted by means of the mount program. It is possible to mount file systems temporarily until the next reboot of the system, as well as to anchor the mounts permanently in the system. Temporary mounts are made using the mount command, permanent mounts are entered in the fstab file.
There are varying things you can mount. The most prominent option to mount a hard-disk or a folder. To mount a hard-disk you first have to locate the drive you want to mount. This can be done via command line with the tool lsblk (list blocks). To do that you only have to type the command into the command line:
lsblk
The output of this command shows the disks that are mounted or ready to mount. As an example the output of server-w0 with the additional hard-disk sda1 mounted to the file system at /run/media/smad
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 465,8G 0 disk
└─sda1 8:1 0 465,8G 0 part /run/media/smad
nvme0n1 259:0 0 931,5G 0 disk
├─nvme0n1p1 259:1 0 300M 0 part /boot/efi
└─nvme0n1p2 259:2 0 931,2G 0 part /
If the Disk you want to mount is not listed in the output of the lsblk command, then either the drive is not connected or encrypted. If you found your drive and want to mount it to a specific folder, the folder has first to be created, othrtwise the input will be refused. To do that type with sudo: sudo(optional) mkdir <path/to/folder/foldername> in the shell. If that did succesfully create the folder mount the device with the mount command:
sudo mount /dev/<name-of-device> /path/to/mountpoint
You can choose any location for the mountpoint tho it is in most cases done in the /run/media/ or the /mount directory. If needed you can change the owner of the directory you created if you had to do so as root.