Mount a Disk Automatically on Linux
- Open Terminal.
- Login as root:
su -- List all disks and note the UUID of the one you want to mount:
blkidExample output:
/dev/sda5: LABEL="File" UUID="01CCCE1FC7BA38C0" TYPE="ntfs"- Open
/etc/fstabin your favorite editor:
vi /etc/fstab- Add a line for your disk to mount automatically at boot. Replace
[UUID]and[MountFolder]with your values:
/dev/disk/by-uuid/[UUID] /mnt/[MountFolder] auto nosuid,nodev,nofail,x-gvfs-show 0 0Example using the output above:
/dev/disk/by-uuid/01CCCE1FC7BA38C0 /mnt/01CCCE1FC7BA38C0 auto nosuid,nodev,nofail,x-gvfs-show 0 0- Save and close the file.
- Make sure the mount point exists:
mkdir -p /mnt/01CCCE1FC7BA38C0- Test the mount without rebooting:
mount -aYour disk should now be accessible at /mnt/01CCCE1FC7BA38C0.
✅ Note:
nosuid,nodev,nofail,x-gvfs-showare safe modern options.- This works for NTFS, ext4, or most Linux-supported file systems.
- Always back up
/etc/fstabbefore editing:
cp /etc/fstab /etc/fstab.backup