DEV Community

Asif Zubayer Palak
Asif Zubayer Palak

Posted on

How to mount a drive at boot in Arch Linux

If you have a removable drive and you don't want to manually mount every time you boot your PC, you can easily set it up to automatically mount every time your PC boots up.

Gathering the required info

In order to set up the auto mount, you need to know several things such as:

  • the drive partition directory
  • mount point
  • UUID
  • File System or FS
  1. To find these information, run
lsblk -f
Enter fullscreen mode Exit fullscreen mode

on your terminal.

You will get something like this:
Image description

  1. Look for your desired partition directory such as sdc1 or sdb1 and take note of the FSTYPE and copy the UUID.

  2. Next, you will need to create a mount point by running this command:

sudo mkdir /run/media/user/directory_name
Enter fullscreen mode Exit fullscreen mode

where user is your username and directory_name is what you want the partition to be called.

  1. Once done, use vim/nano or any other text editor to open /etc/ftsab

  2. It will look something like this:

Image description

  1. Create a new line and add the following entry
# /dev/your_partition_directory

UUID=(copied UUID here)  mount_point(eg: /run/media/user/partition) filetype(eg: ntfs or ext4) rw,relatime
Enter fullscreen mode Exit fullscreen mode
  1. Match the format with the example image above and then save and exit.

  2. Reboot your pc and check if the partitions are automatically mounted.

Top comments (0)