Data on a computer, as you may know, is stored in binary as a series of 1s and 0s. The way these are stored on a device and their structure is called the “filesystem.” In Linux, devices are referenced in /dev. Data is not stored on a device, so you cannot access it by going into /dev; it is stored inside the filesystem on the device, so you need to access these filesystems somehow.
Accessing such filesystems is called “mounting” them, and in Linux (like any UNIX system), you can mount filesystems into any directory, that is, make the files stored in that filesystem accessible when you go into a particular directory.
In today’s tutorial, we’ll check how to mount partitions in Nitrux.
Difficulty: ★☆☆☆☆
Mounting and Unmounting Filesystems in Nitrux
First, we must identify which partition we’re going to mount. To do this, we’ll use KDE Partition Manager. For this tutorial, we will use the partition /dev/vda6
and mount it.
- 🔰 Information: Replace the partition accordingly.
As mentioned before, we need a mount point to mount a filesystem. For this tutorial, we will use a directory in our home. All we need to do is create a new directory using Index, which we’ll call “My_Mount.”
Now that we have identified which partition we’ll mount and created our mount point, we will add a Plasma widget called “Configurable Button” to the desktop. To do this, we right-click the desktop, select “Add widget,” and then search for the widget.
Now, we drag the widget to the desktop, right-click it, and select “Configure Configurable Button…” to enter its settings. Here, we can add a label for the button, define its behavior, what commands the widget will execute, and the icon for each action. We will leave the label empty for this tutorial so the icons are visible, and we’ll only add the following commands in the field “Script.”
First, the command to mount the partition:
- 🔰 Information: We’re using
pkexec
because mounting and unmounting partitions require elevated privileges andpkexec
will provide a graphical dialog to enter the user account password.
pkexec mount -t auto /dev/vda6 ~/My_Mount
Then, the command to unmount the partition:
pkexec umount ~/My_Mount
Finally, we click Apply to test our widget.
- 🔰 Information: You can optionally change the icon for either action, place the widget in the top panel or the dock, or set a keyboard shortcut to activate the widget for easier access.
We can verify that the partition was correctly mounted at the mount point using KDE Partition Manager.
When we click the widget again to unmount the partition, a new dialog will ask for the password.
That’s it; this concludes today’s tutorial.