Automount Disks Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki

Automount Disks Guide for Beginners

Table of Contents

  1. ๐Ÿ“ What is Automounting?
  2. โš ๏ธ The Problem
  3. โšก Solution: Using GNOME Disk Utility (Recommended for Beginners)
  4. โš ๏ธ Important Notes
  1. ๐Ÿ” Advanced Method: Manual fstab Editing
  1. ๐Ÿงน Troubleshooting
  1. Summary
  2. References

๐Ÿ“ What is Automounting?

Automounting means that your additional hard drives, SSDs, or USB drives will automatically be mounted (made accessible) when your system starts up. Without automounting configured, you would need to manually mount these drives every time you boot your computer or plug them in.

Why this matters:

  • Convenience - Your drives are ready to use immediately after boot
  • Persistence - Drives stay mounted after clicking them in file managers
  • Application access - Programs like Steam can see and use your drives automatically
  • No manual mounting - You don't need to run mount commands every time

What this guide covers:

  • Understanding why drives don't stay mounted
  • Using GNOME Disk Utility (GUI method - recommended for beginners)
  • Manual fstab editing (advanced method)
  • Troubleshooting common issues

โš ๏ธ The Problem

Symptom: Additional disks do not stay mounted after clicking them in a GUI file manager (like Files/Nautilus, Dolphin, or Thunar).

What happens:

  • You click on a drive in your file manager
  • It mounts temporarily and you can access it
  • After reboot or unmounting, you have to click it again
  • The drive doesn't automatically appear in applications like Steam

Why this happens:

  • The drive is not configured in /etc/fstab (filesystem table)
  • /etc/fstab tells Linux which drives to mount automatically at boot
  • Without an entry, the drive only mounts temporarily when clicked

โšก Solution: Using GNOME Disk Utility (Recommended for Beginners)

GNOME Disk Utility (also called disks) is a graphical tool that makes configuring automounting easy. You don't need to edit configuration files manually.

Step 1: Install GNOME Disk Utility

For PikaOS 4:

pikman install gnome-disk-utility

For Debian/Ubuntu-based distributions:

sudo apt install gnome-disk-utility

For Fedora/RHEL:

sudo dnf install gnome-disk-utility

For Arch Linux (and Arch-based distributions like CachyOS):

sudo pacman -S gnome-disk-utility

Alternative installation methods:

  • Software Center - Search for "Disks" or "GNOME Disks"
  • Cosmic Store - Available in PikaOS's Cosmic Store
  • Discover - Available in KDE-based distributions

What this does:

  • Installs the GNOME Disk Utility application
  • Provides a graphical interface for managing disks and partitions
  • Allows you to configure automounting without editing text files

Step 2: Launch GNOME Disk Utility

How to launch:

  1. Open your application launcher (Activities, Application Menu, etc.)
  2. Search for "Disks" or "GNOME Disks"
  3. Click to open the application

Or from terminal:

gnome-disks

What you'll see:

  • A list of all storage devices on the left side
  • Details about the selected device in the main area
  • Information about partitions, filesystem type, and mount status

Note: Your actual device names, serial numbers, and UUIDs will be different from examples shown in this guide.

GNOME Disks - Device Selection Select the volume you wish to mount by highlighting the box associated with the drive as shown above.


Step 3: Select the Volume to Mount

What to do:

  1. In the left panel, select the storage device (hard drive, SSD, USB drive, etc.)
  2. In the main area, you'll see boxes representing different partitions on that device
  3. Click on the specific volume/partition you want to automount (highlight the box)

How to identify the right partition:

  • Look at the partition size
  • Check the filesystem type (NTFS, ext4, etc.)
  • Look at the label/name if one is set
  • Check which partition is currently mounted (if any)

Example:

  • If you have a 1TB drive with a 500GB partition, select that 500GB partition box

Step 4: Access Additional Partition Options

What to do:

  1. After selecting the volume/partition, look at the buttons/icons below it
  2. Click the second box from the left - This is labeled "Additional partition options" (looks like a gear or settings icon)

What this does:

  • Opens a menu with various partition management options
  • Includes options like: Format, Edit Filesystem, Edit Mount Options, etc.

Visual guide:

  • The buttons are usually arranged horizontally below the partition information
  • The second button from the left is the one you want
  • It may show a gear icon or three horizontal lines (hamburger menu)

GNOME Disks - Additional Partition Options Click the second box from the left under the volume which will be labeled "additional partition options".


Step 5: Edit Mount Options

What to do:

  1. From the "Additional partition options" menu, click "Edit Mount Options"

What this does:

  • Opens a dialog window with mount configuration options
  • Allows you to configure how and when the partition mounts
  • This is where you'll set up automounting

Important: You may need administrator privileges for this. If prompted, enter your password.


Step 6: Configure Automount Settings

What to do in the "Edit Mount Options" dialog:

  1. Deselect "User Session Defaults"
  • This checkbox is usually selected by default
  • Uncheck it to enable custom mount options
  • This allows you to configure automounting
  1. Select "Mount at system startup"
  • Check this box
  • This tells the system to mount the drive automatically when it boots
  • This is the key setting for automounting
  1. Enter a display name (optional but recommended)
  • In the "Display Name" field, enter a friendly name
  • Examples: "Games Drive", "Storage", "Backup Drive", "Media"
  • This name will appear in your file manager and in applications like Steam
  • Makes it easier to identify the drive
  1. Click "OK" to save
  • This applies your changes
  • The system will update /etc/fstab automatically
  • You may be prompted for your password again

What each setting does:

  • User Session Defaults (unchecked): Allows custom configuration instead of using default temporary mounting
  • Mount at system startup (checked): Creates an entry in /etc/fstab so the drive mounts automatically at boot
  • Display Name: Sets a friendly label that appears in file managers and applications

Example configuration:

โ˜ User Session Defaults
โ˜‘ Mount at system startup
Display Name: Games Drive

GNOME Disks - Edit Mount Options Deselect "User Session Defaults" as shown in the image above, then select "Mount at system startup" and enter a display name.


Step 7: Verify and Test

After clicking OK:

  1. The drive should now be configured for automounting
  2. Reboot your system to test (optional but recommended)
  3. After reboot, the drive should automatically appear in your file manager
  4. Check applications like Steam - the drive should appear in their drive lists

How to verify it worked:

  • Open your file manager after reboot
  • The drive should appear automatically (no need to click it)
  • Check /etc/fstab - you should see a new entry for your drive
  • The drive should have the display name you set

To check /etc/fstab (optional):

cat /etc/fstab

You should see a line with your drive's UUID and mount point.


โš ๏ธ Important Notes

Steam and Other Applications

If Steam was open during this configuration:

  • Close Steam completely (not just minimize)
  • Reopen Steam for the drive name to appear in your list of available drives
  • This applies to other applications that scan for drives at startup

Why this happens:

  • Applications often scan for available drives when they start
  • If the application was already running, it won't see the newly configured drive
  • Restarting the application refreshes its drive list

Understanding UUIDs

What is a UUID?

  • UUID stands for "Universally Unique Identifier"
  • It's a long string of characters that uniquely identifies your partition
  • Example: 550e8400-e29b-41d4-a716-446655440000

Why UUIDs are used:

  • More reliable than device names (like /dev/sda1)
  • Device names can change when drives are added/removed
  • UUIDs stay the same even if you move the drive to a different port

You don't need to memorize UUIDs - GNOME Disk Utility handles this automatically.


๐Ÿ” Advanced Method: Manual fstab Editing

Warning: This method is for advanced users. If you make a mistake, you could prevent your system from booting properly. Always backup /etc/fstab before editing.

When to use this method:

  • You prefer working with text files
  • You need more control over mount options
  • GNOME Disk Utility isn't available or isn't working
  • You want to understand how automounting works under the hood

Understanding /etc/fstab

What is /etc/fstab?

  • Stands for "filesystem table"
  • A configuration file that tells Linux which drives to mount at boot
  • Located at /etc/fstab
  • Each line represents one filesystem/partition

File format:

UUID=<uuid>  <mount-point>  <filesystem-type>  <options>  <dump>  <pass>

Example entry:

UUID=1234-5678  /mnt/games  ext4  defaults  0  2

What each field means:

  1. UUID - The unique identifier for the partition
  2. Mount point - Where the drive will be accessible (like /mnt/games)
  3. Filesystem type - Type of filesystem (ext4, ntfs, etc.)
  4. Options - Mount options (defaults, noauto, etc.)
  5. Dump - Backup flag (usually 0)
  6. Pass - Filesystem check order (0 = no check, 2 = check)

Finding Your Drive's UUID

Method 1: Using lsblk

lsblk -f

What this does:

  • Lists all block devices with filesystem information
  • Shows UUIDs for each partition
  • Shows mount points and filesystem types

Method 2: Using blkid

sudo blkid

What this does:

  • Shows UUIDs for all partitions
  • More detailed information
  • Requires sudo/root access

Method 3: Using GNOME Disk Utility

  • Select your partition
  • The UUID is displayed in the partition details

Creating a Mount Point

What is a mount point?

  • A directory where the drive will be accessible
  • Examples: /mnt/games, /mnt/storage, /media/backup
  • You need to create this directory first

How to create a mount point:

sudo mkdir /mnt/games

What this does:

  • Creates a directory at /mnt/games
  • This is where your drive will be accessible
  • Use a descriptive name (games, storage, backup, etc.)

Common mount point locations:

  • /mnt/ - Traditional location for temporary mounts
  • /media/ - Often used for removable media
  • /mnt/ is fine for permanent drives

Editing /etc/fstab

Step 1: Backup the file

sudo cp /etc/fstab /etc/fstab.backup

What this does:

  • Creates a backup copy
  • If something goes wrong, you can restore it
  • Always do this before editing fstab

Step 2: Open the file in an editor

sudo nano /etc/fstab

Or with vim:

sudo vim /etc/fstab

What this does:

  • Opens /etc/fstab in a text editor
  • Requires root/sudo access
  • nano is easier for beginners (use Ctrl+S to save, Ctrl+X to exit)

Step 3: Add your entry

Add a line at the end of the file. Format:

UUID=<your-uuid>  <mount-point>  <filesystem-type>  defaults  0  2

Example for ext4 filesystem:

UUID=550e8400-e29b-41d4-a716-446655440000  /mnt/games  ext4  defaults  0  2

Example for NTFS filesystem:

UUID=1234-5678-ABCD  /mnt/storage  ntfs  defaults,uid=1000,gid=1000  0  2

What each part means:

  • UUID=... - Your partition's UUID (from blkid or lsblk)
  • /mnt/games - Your mount point (directory you created)
  • ext4 or ntfs - Your filesystem type
  • defaults - Standard mount options (rw, suid, dev, exec, auto, nouser, async)
  • 0 - Dump flag (0 = don't backup with dump)
  • 2 - Pass number (2 = check filesystem after root)

For NTFS, you might need:

  • uid=1000,gid=1000 - Sets ownership to your user (replace 1000 with your user ID)
  • Find your user ID: id -u and id -g

Step 4: Save and exit

In nano:

  • Press Ctrl+S to save
  • Press Ctrl+X to exit

In vim:

  • Press Esc to enter command mode
  • Type :wq and press Enter (write and quit)

Step 5: Test the configuration

Before rebooting, test if the entry is correct:

sudo mount -a

What this does:

  • Mounts all filesystems listed in /etc/fstab
  • If there's an error, it will tell you
  • If this fails, fix the error before rebooting

If mount -a fails:

  • Check the error message
  • Verify the UUID is correct
  • Verify the mount point exists
  • Verify the filesystem type is correct
  • Restore from backup if needed: sudo cp /etc/fstab.backup /etc/fstab

Step 6: Reboot (optional)

sudo reboot

After reboot:

  • The drive should mount automatically
  • Check with: df -h or lsblk
  • The drive should appear in your file manager

๐Ÿงน Troubleshooting

Drive Doesn't Mount at Boot

Possible causes:

  1. Incorrect UUID - The UUID in fstab doesn't match the actual partition
  2. Mount point doesn't exist - The directory specified doesn't exist
  3. Wrong filesystem type - The filesystem type in fstab is incorrect
  4. Permissions issue - The mount point has wrong permissions

How to fix:

  1. Check the UUID: sudo blkid and compare with fstab
  2. Verify mount point exists: ls -la /mnt/games (replace with your mount point)
  3. Check filesystem type: lsblk -f and compare with fstab
  4. Check fstab syntax: sudo mount -a (will show errors)

Permission Denied Errors

Symptom: You can see the drive but can't write to it.

For NTFS drives:

  • Add uid=1000,gid=1000 to mount options in fstab
  • Replace 1000 with your actual user ID (id -u and id -g)

For ext4 drives:

  • Change ownership: sudo chown -R $USER:$USER /mnt/games
  • Or add user option to fstab (allows users to mount/unmount)

Drive Mounts But Doesn't Appear in Applications

For Steam:

  • Close and reopen Steam
  • Check Steam settings for library folders
  • Verify the drive is accessible: ls /mnt/games (replace with your mount point)

For other applications:

  • Restart the application
  • Check application settings for drive/library locations
  • Verify the mount point is accessible

System Won't Boot After Editing fstab

If your system won't boot:

  1. Boot from a live USB/CD
  2. Mount your root partition
  3. Edit /etc/fstab on the mounted system
  4. Or restore from backup: cp /etc/fstab.backup /etc/fstab

Prevention:

  • Always backup fstab before editing
  • Test with sudo mount -a before rebooting
  • Keep a live USB handy for emergencies

Summary

This guide covered:

  1. Understanding Automounting:
  • What automounting is and why it's useful
  • Why drives don't stay mounted without configuration
  1. GUI Method (Recommended):
  • Installing GNOME Disk Utility
  • Configuring automounting through the graphical interface
  • Setting display names for drives
  1. Advanced Method:
  • Understanding /etc/fstab
  • Finding UUIDs
  • Creating mount points
  • Manually editing fstab
  1. Troubleshooting:
  • Common issues and solutions
  • Permission problems
  • Boot issues

Key Takeaways:

  • Use GNOME Disk Utility for easiest setup
  • Always backup fstab before manual editing
  • Test with mount -a before rebooting
  • Restart applications to see newly configured drives

Next Steps:

  • Configure all your additional drives
  • Set meaningful display names
  • Test that everything works after reboot
  • Consider organizing mount points (/mnt/games, /mnt/storage, etc.)

References

  • Original PikaOS Guide: Automount Disks
  • GNOME Disk Utility Documentation: GNOME Help
  • fstab Manual: man fstab (run in terminal)

For disk space management, see the DF & DU Disk Space Guide. For filesystem information, see the Find Command Guide.

โš ๏ธ **GitHub.com Fallback** โš ๏ธ