DEV Community

Kamran Khan
Kamran Khan

Posted on

🔧 How to Auto-Mount Partitions Without Password in Fedora and Access Them in File Manager

On Fedora, accessing additional disk partitions (like a separate storage or workspace) often requires entering your password. This guide explains how to auto-mount partitions at boot without a password, and have them appear in the GNOME Files app, similar to how drives show in Windows.

We’ll cover two methods:

  • Mounting under /mnt (clean layout, requires shortcut for GUI visibility)
  • Mounting under /media (auto-visible in GNOME Files sidebar)

🧭 Step 1: Identify Your Partition

In a terminal, run:

lsblk -f
Enter fullscreen mode Exit fullscreen mode

or:

sudo blkid
Enter fullscreen mode Exit fullscreen mode

Look for entries like:

/dev/sdXn: LABEL="YourLabel" UUID="XXXX-XXXX" TYPE="ext4"
Enter fullscreen mode Exit fullscreen mode

Take note of:

  • UUID
  • LABEL (optional)
  • Filesystem type (e.g. ext4, ntfs, btrfs)

🛠️ Step 2: Choose Your Mount Method

✅ Option 1: Mount Under /mnt (Clean System Layout)

This method is clean and system-friendly but requires a shortcut to access from the GUI.

1. Create Mount Point

sudo mkdir -p /mnt/YourMountPoint
Enter fullscreen mode Exit fullscreen mode

Replace YourMountPoint with a name like workspace or storage.

2. Edit /etc/fstab

Open the file:

sudo nano /etc/fstab
Enter fullscreen mode Exit fullscreen mode

Add a line like this:

UUID=XXXX-XXXX  /mnt/YourMountPoint  ext4  defaults  0  2
Enter fullscreen mode Exit fullscreen mode

Replace:

  • UUID=XXXX-XXXX with your actual UUID
  • ext4 with your actual filesystem type
  • YourMountPoint with your chosen name

3. Mount Immediately

sudo mount -a
Enter fullscreen mode Exit fullscreen mode

4. Add GUI Shortcut (Optional)

ln -s /mnt/YourMountPoint ~/YourMountPoint
Enter fullscreen mode Exit fullscreen mode

This creates a visible folder shortcut in your home directory.


✅ Option 2: Mount Under /media (Visible in GNOME Files Sidebar)

This method makes partitions show up automatically in the Files app.

1. Create Mount Point

sudo mkdir -p /media/YourMountPoint
Enter fullscreen mode Exit fullscreen mode

2. Edit /etc/fstab

sudo nano /etc/fstab
Enter fullscreen mode Exit fullscreen mode

Add a line like:

UUID=XXXX-XXXX  /media/YourMountPoint  ext4  defaults  0  2
Enter fullscreen mode Exit fullscreen mode

3. Mount:

sudo mount -a
Enter fullscreen mode Exit fullscreen mode

Open Files app — you’ll now see the partition in the left sidebar.


🔑 Step 3: Set Permissions (Optional)

To ensure you have read/write access:

sudo chown -R $USER:$USER /mnt/YourMountPoint
Enter fullscreen mode Exit fullscreen mode

or if using /media:

sudo chown -R $USER:$USER /media/YourMountPoint
Enter fullscreen mode Exit fullscreen mode

✨ Optional: Change Partition Label

To customize the name that appears in the GUI:

sudo e2label /dev/sdXn NewLabel
Enter fullscreen mode Exit fullscreen mode

Replace sdXn with your device (like sda3) and NewLabel with your desired label.


🧹 To Undo or Remove

  • Delete or comment the corresponding line in /etc/fstab
  • Unmount the partition:
  sudo umount /mnt/YourMountPoint
Enter fullscreen mode Exit fullscreen mode
  • Remove mount point or symlink as needed

✅ Summary

Feature /mnt Method /media Method
Auto-mount on boot ✅ Yes ✅ Yes
GUI (Files) visibility ❌ Needs symlink ✅ Sidebar visibility
Password prompt ❌ No ❌ No
Use case Clean setup, scripting Windows-style file access

💡 Pro Tip

Always back up your /etc/fstab before editing:

sudo cp /etc/fstab /etc/fstab.bak
Enter fullscreen mode Exit fullscreen mode

Top comments (0)