Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How To Auto-mount Partitions On Startup Using Gnome Disks
Hey Linuxers...

This keeps being asked on social. So I decided to post it here.. It's all over the net but I guess either no one knows how to search or too lazy, in any case here it is ...

Gnome Disks has many features, like S.M.A.R.T. monitoring, partition management, benchmarking, and more, including one that might not be obvious, but is very useful: it can set drives to mount automatically at startup.

Use it to auto-mount your new hard disk that uses Ext4, your Windows NTFS / exFAT partition, etc.

[Image: jsnRZUU.png]

Disks, or Gnome Disk Utility, is installed by default in many Linux distributions, including Ubuntu, Fedora, both Linux Mint Cinnamon and MATE, Xubuntu, and so on. If it's not installed, use your Linux distribution's package manager to install it - search / install gnome-disk-utility.

For each partition you set to mount automatically on startup, Gnome Disks adds an entry in your /etc/fstab file, useful for those who are not very familiar with editing /etc/fstab. That means each partition mounted on startup through Disks is available system-wide, and not just for your user.

- How to auto-mount partitions on startup using Gnome Disks

Start by launching "Disks" from your applications menu. Choose the hard disk from the left Disks sidebar, select the partition you want to auto mount on startup, then click the button with the gears icon under it, and click Edit Mount Options:

[Image: 27YPYEC.png]

In the mount options, toggle the User Session Defaults option (this may be called Automatic Mount Options on older versions) to enable the options below it, and make sure Mount at system startup is enabled. You can enter a name under Display Name. The defaults should be enough for most users, so you don't have to change anything here. After you're done, click OK :

[Image: HzloKaO.png]

To test the changes, you can reboot your system or type the following command to mount all filesystems mentioned in fstab (since Disks sets partitions to auto-mount on startup by adding them to /etc/fstab) :

sudo mount --all

Hope this answers that question....
~ XeroLinux Toolkit Maintainer ~
I do try to help where I can, when I can.
I do this on my own, so I might not have all the answers.
[Image: K7U76Mv.png]
FANTASTIC to see someone recommend this way. I always do it this way and always recommend doing it this way. Way TOO many have a proverbial cow when this is suggested. I would add the below to this.

1. Launch Dolphin, go to context menu, search for and add Rootactions.
2. Open /mnt/, rightclick in /mnt/, go to Rootactions and give ownership to active user.
3. create folders in /mnt/ for each of your secondary drives and partitions and make these your mount points.
I followed the "How to auto-mount partitions on startup using Gnome Disks" with partial success.

Not all hard drives would Auto-Mount at startup, but the 'sudo mount --all' command successfully mounted all drives and therefore confirms Gnome Disks successfully added the correct information to '/etc/fstab'.

My Solution:
After following the tutorial "How to auto-mount partitions on startup using Gnome Disks", I created a Systemd service. Systemd is a system and service manager that is used to control the startup and shutdown of services.


- Step 1:

- Step 2:
Follow tutorial "How to auto-mount partitions on startup using Gnome Disks"

- Step 3:
Created a new file in the '/etc/systemd/system' directory called "mountall.service". You can choose the name of the file.

sudo nano /etc/systemd/system/mountall.service

- Step 4:
Added the following content to the file:

Description=Mount All Devices

ExecStartPre=-/usr/bin/sudo -v
ExecStart=/usr/bin/sudo mount -a


- Step 5:

Save file and exit nano.

Write Out (Save)
Ctrl + O

Ctrl + X

- Step 6:

Enable and Start the service

systemctl enable --now mountall.service

- Step 7:

Reboot and verify the hard drives auto-mount.
Thanks for the guide, although for me Disks works without fault for all my drives and I have many with various Filesystems, from XFS, EXT4, NTFS, exFAT to APFS.. Flawless.. Still not everyone always has success.. Thanks Wink
~ XeroLinux Toolkit Maintainer ~
I do try to help where I can, when I can.
I do this on my own, so I might not have all the answers.
[Image: K7U76Mv.png]

Possibly Related Threads…
Thread Author Replies Views Last Post
  Boot with Grub via rEFInd any other partitions and iso's cristina223 0 1,660 04-19-2022, 02:10 PM
Last Post: cristina223
Exclamation Backup/Restore GNOME Settings With Dconf DarkXero 0 1,564 12-27-2021, 01:08 PM
Last Post: DarkXero

Forum Jump:

Users browsing this thread: 1 Guest(s)