Lesson 8 of 19 ↓
- 1.Fedora + Distrobox + Arch + AUR Setup Guide
- 2.Enabling Hibernate on Linux
- 3.A Practical Git Workflow
- 4.Useful Linux Commands & Tips
- 5.Mirroring Your Android Screen with Scrcpy
- 6.Downloading Media with Yt-dlp
- 7.Consistent C/c++ Style with Clang-format
- 8.Auto-mounting Drives at Boot
- 9.Customizing Grub
- 10.Linux Swap Files Explained
- 11.Zram: Compressed Swap in Ram
- 12.Custom App Launch Behavior Via .desktop Files
- 13.Custom Mime Icons in Gnome
- 14.Fixing Missing Dock Icons (startupwmclass)
- 15.Installing Questasim for Hdl Simulation
- 16.Building Python 2 From Source
- 17.Auto-Starting WhatsApp and Telegram (Minimized or Tray)
- 18.Custom Neovim Configuration Guide
- 19.Running Windows Applications on Linux Seamlessly with WinBoat (Docker)
1 min read
Auto-mounting Drives at Boot
Secondary drives — an NTFS Windows partition, a shared data disk — don't mount themselves on every boot unless /etc/fstab tells the kernel to do it. This walks through adding fstab entries safely, with the flags that matter for NTFS specifically.
Warning
editing
/etc/fstabincorrectly can prevent the system from booting. Back it up first:bash sudo cp /etc/fstab /etc/fstab.bak
Find the Partition's Uuid and Filesystem Type
sudo blkidThis prints each partition's UUID (e.g. 7C9EBC0D9EBBBE48) and TYPE (e.g. ntfs, ext4, exfat) — both needed for the fstab entry.
Edit /etc/fstab
sudo nvim /etc/fstabAdd the Mount Entry
General syntax:
UUID=<uuid> <mount_point> <filesystem_type> <options> <dump> <pass>For NTFS partitions specifically, these options avoid the usual permission headaches:
# Mount Local_Disk
UUID=7C9EBC0D9EBBBE48 /media/abdallah-shehawey/Local_Disk ntfs-3g defaults,nofail,x-gvfs-show,uid=1000,gid=1000,umask=0022 0 0
# Mount WinOS
UUID=01DC06CA66C0E3F0 /media/abdallah-shehawey/WinOS ntfs-3g defaults,nofail,x-gvfs-show,uid=1000,gid=1000,umask=0022 0 0Make sure the mount point directories exist first:
sudo mkdir -p /media/abdallah-shehawey/Local_DiskWhat each option does:
defaults— the standard mount options.nofail— critical for external/secondary drives: if the drive is missing or unreadable, the system still boots instead of hanging waiting for it.x-gvfs-show— makes the drive show up in a file manager's sidebar (Nautilus, etc.).uid=1000,gid=1000— makes the primary user the owner of the files, so reads/writes don't need root.umask=0022— the default permission mask for new files on the mount.
Verify Before Rebooting
Don't reboot yet — a typo in fstab can otherwise leave the system stuck at boot. Instead, mount everything fstab defines and check for errors:
sudo mount -aNo errors means the entries are correct, and the drives will mount automatically on every subsequent boot.
Comments
Loading the discussion…