To get the UUID of a partition on Linux, use “blkid” with the name of the partition you want to mount. In order to add a drive to the fstab file, you first need to get the UUID of your partition. This is what we are going to configure in the next section. However, in this case, I need the “ sda1” partition to be mounted on boot. Using the blkid command, I am able to know that the “ sdb1” partition is mounted at boot time.
Given the UUID of the fstab file, this would give us $ blkid | grep b9df In order to get the partition associated with this UUID, you can use the use the “blkid” command in the following way. If you are not mounting the root device, you should set this option to “2” or “0” as “1” is reserved for the root device.Īs you can see here, besides mounting the “ sda1” partition in the previous section, only the partition with the UUID shown above would be mounted.
├─sdb1 ext4 b9df59e6-c806-4851-befa-12402bca5828 /Īlternatively, you can use the “ blkid” command in order to locate and list block devices on your system. To list partitions with filesystems types, use the “lsblk” command with the “-f” option. In order to mount drives on Linux, you have to use the “ mount” command using the following syntax $ sudo mount įirst of all, you need to check the disk partitions already created on your system that are not already mounted.
If you are not sure how to give sudo rights to users on Debian/Ubuntu or CentOS/RHEL, make sure to check our dedicated guides on the subject. User may run the following commands on schkn-ubuntu: To verify that you have sudo privileges, you can run the “ sudo” command with the “ -l” in order to list the privileges you currently own. In order to mount drives and filesystems on Linux, you need to have sudo privileges on your machine.