How to Permanently Mount NVMe and SD Card Drives on Linux

Uttam MahataUttam Mahata
3 min read

Managing storage efficiently is a key aspect of using Linux, especially when you're working with multiple drives. If you're using an additional NTFS partition (like a "New Volume") or an SD card, you'll notice that they often don’t stay mounted after reboot. This blog will guide you through permanently mounting two such devices in your Linux system:

  • A New Volume (e.g., /dev/nvme0n1p4)

  • An SD Card (e.g., /dev/mmcblk0p1)

This is particularly useful for ensuring consistent access to data drives, development storage, or backup volumes without manually mounting them every time you start your system.


πŸ“‹ Step-by-Step Guide

πŸ” Step 1: Identify Your Devices

Run the following command to list all available drives and partitions:

sudo fdisk -l

Sample output for the devices:

  • nvme0n1p4 – likely your new volume

  • mmcblk0p1 – your SD card

Take note of the device names.


πŸ”— Step 2: Get the UUIDs of the Devices

UUIDs are persistent identifiers that Linux uses to distinguish storage devices.

sudo blkid

Example output:

/dev/nvme0n1p4: UUID="XXXX-XXXX" TYPE="ntfs"
/dev/mmcblk0p1: UUID="YYYY-YYYY" TYPE="exfat"

Copy both UUIDs. You will need them in the next step.


πŸ“ Step 3: Create Mount Points

Choose where you want to mount the drives. It's recommended to create custom folders under /mnt or /media.

sudo mkdir /mnt/new_volume
sudo mkdir /mnt/sdcard

You can name the folders as per your choice.


πŸ› οΈ Step 4: Edit the /etc/fstab File

This file tells Linux which drives to mount automatically at boot.

Open the file with a text editor:

sudo nano /etc/fstab

At the end of the file, add the following lines (replace the UUIDs and types with the actual ones from your system):

UUID=XXXX-XXXX /mnt/new_volume ntfs defaults,nofail,x-gvfs-show,uid=1000,gid=1000,umask=022 0 0
UUID=YYYY-YYYY /mnt/sdcard exfat defaults,nofail,x-gvfs-show,uid=1000,gid=1000,umask=022 0 0

Explanation:

  • defaults: Standard mount options.

  • nofail: Boot won't fail if the device is not found.

  • x-gvfs-show: Ensures it shows up in graphical file managers.

  • uid=1000, gid=1000: Ensures your user has permission (verify your UID with id).

  • umask=022: Sets default permissions (readable by all, writable by owner).


βœ… Step 5: Test the Configuration

Before rebooting, test your fstab configuration:

sudo mount -a

If no error appears, your entries are valid.


πŸ” Step 6: Reboot and Verify

Now reboot the system:

sudo reboot

After booting, check if the volumes are mounted automatically:

df -h

You should see your new_volume and sdcard mounted at /mnt/new_volume and /mnt/sdcard respectively.


🧩 Troubleshooting

  • Permission Denied? Ensure the uid=1000,gid=1000 match your user ID.

  • Wrong Filesystem? Make sure the filesystem type (ntfs, exfat, vfat, ext4, etc.) matches what’s shown in blkid.

  • Forgot to Create Folder? Ensure /mnt/new_volume and /mnt/sdcard exist, or else mounting will fail.


🧠 Conclusion

Mounting your SD card and additional volumes permanently in Linux saves time, enhances productivity, and ensures stable access to important files. Whether you're a developer, student, or Linux enthusiast, this setup brings convenience and consistency to your workflow.


0
Subscribe to my newsletter

Read articles from Uttam Mahata directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Uttam Mahata
Uttam Mahata

As an undergraduate student pursuing a Bachelor's degree in Computer Science and Technology at the Indian Institute of Engineering Science and Technology, Shibpur, I have developed a deep interest in data science, machine learning, and web development. I am actively seeking internship opportunities to gain hands-on experience and apply my skills in a formal, professional setting. Programming Languages: C/C++, Java, Python Web Development: HTML, CSS, Angular, JavaScript, TypeScript, PrimeNG, Bootstrap Technical Skills: Data Structures, Algorithms, Object-Oriented Programming, Data Science, MySQL, SpringBoot Version Control : Git Technical Interests: Data Science, Machine Learning, Web Development