Do you need to create a suitable fstab entry to automatically mount a drive in Linux? Find out how here.
If you have servers or desktops, running Ubuntu Linux (or a derivative), you may need to add additional drives for storage, backups, or any number of reasons . Surely you can connect that unit, open your file manager and click to mount it. But what happens if it is a headless server or if you just want to make sure that the disk is always mounted at boot (without its interaction)?
Fortunately, it is a fairly simple task to perform. But doing it correctly requires some additional steps that you may not know. I will show you the correct way to configure the automatic mounting of a drive in Linux, specifically, Pop! _OS 19.04 (a derivative of Ubuntu Desktop).
SEE: Choosing your Windows 7 exit strategy: four options (TechRepublic Premium)
What you need
For this to work, you will need the following:
- One instance Ubuntu Server (or a derivative).
- A hard drive attached to mount.
- A user account with sudo privileges.
With those things ready, get to work.
Locate the partition to mount
The first thing to do is locate the partition you want to mount. In this case, we will work with a complete disk. To do this, open a terminal window and issue the command:
sudo fdisk -l
You should see a complete list of all units connected to the system ( Figure A ).
Let's say we found that the disk we want to mount is in / dev / sdj. With that information in hand, we are ready to continue.
Locate the UUID
Next, we need to find the UUID (Universal Unique Identifier) of the unit. To do this, issue the command:
This will show each UUID associated with each storage device connected to your machine ( Figure B ).