Easily set drives to mount automatically at boot

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Locked
MintBean

Easily set drives to mount automatically at boot

Post by MintBean »

This is for people who to enable a second drive to auto-mount at system start up WITHOUT editing a system file by hand.

1. Open the application 'Disks' from the Mint menu. (It's under 'Accessories.')
2. In the left hand part of the window, click on the disk which contains the partition you wish to mount.
3. The partition layout of the selected disk will appear in the right hand portion of the window.
4. Select the partition you wish to auto-mount by clicking on it. The selected partition will be highlighted.
5. Optional - If you wish to immediately mount the disk, you can do so by pressing the triangular 'play' button that appears to the left below the partition display. This will NOT cause it to auto-mount on next boot.
You may unmount the partition if you wish by pressing the square 'stop' button that appears where the play button was.
6. Click the cog icon <additional partition options> and select 'edit mount options.'
7. Switch 'automatic mount options' to OFF.
8. Check the 'mount at startup' box.
9. Optional - choose a custom mount point - in the 'Mount point' box, enter the mount point. I always choose something in the /mnt directory. e.g. '/mnt/Mydiscname'
10. Optional - give your disk a nice display name. This is the name it will appear as on the desktop. Enter your chosen name in the 'display name' field.
11. Hit OK and close the disks application. The disk should automount on next boot.
Last edited by MintBean on Tue Oct 10, 2017 6:45 pm, edited 1 time in total.
User avatar
xenopeek
Level 25
Level 25
Posts: 29504
Joined: Wed Jul 06, 2011 3:58 am

Re: Easily set drives to mount automatically at boot

Post by xenopeek »

Good tutorial! Stickied.
MintBean wrote:11. Optional - if the disk is a solid state (SSD) you may wish to stop the system writing the time of the last file access to files when they are used. This saves on writes which add wear to the disk. To do this, edit the field that has no label but contains a bunch of options like 'nosuid,nodev,nofail,x-gvfs-show'. Leave the existing contents intact, but add ',noatime' to the end (without the quotes, with the preceding comma as indicated.)
You already wrote it as optional but I think this is dated information. The kernel uses relatime by default and that only updates the last access time when the file is modified—at which time the file's information block is written anyway to update the last modified time. When compared to relatime, noatime doesn't further reduce disk writes.
Image
MintBean

Re: Easily set drives to mount automatically at boot

Post by MintBean »

Hey, thanks for the sticky, xenopeek!
In light of your advice, I've removed the unnecessary line.
User avatar
nickname
Level 1
Level 1
Posts: 28
Joined: Sun Feb 17, 2019 11:38 am

Re: Easily set drives to mount automatically at boot

Post by nickname »

Excellent write-up. Still works in Linux Mint 19.1, xfce.

Thanks.
PaulCarry

Re: Easily set drives to mount automatically at boot

Post by PaulCarry »

nickname wrote: Tue Feb 19, 2019 10:22 am Excellent write-up. Still works in Linux Mint 19.1, xfce.

Thanks.
+1 Was just about to confirm this too.
User avatar
deanr72
Level 3
Level 3
Posts: 184
Joined: Sat Mar 24, 2018 2:00 pm
Location: Poland

Re: Easily set drives to mount automatically at boot

Post by deanr72 »

This was one of the first majorly frustrating issues I had with a Linux distro when I first switched from Windows. A very useful sticky indeed.
Buzzsaw
Level 6
Level 6
Posts: 1318
Joined: Sat Aug 23, 2014 12:53 pm

Re: Easily set drives to mount automatically at boot

Post by Buzzsaw »

xenopeek wrote: Tue Oct 10, 2017 6:41 pm Good tutorial! Stickied.
MintBean wrote:11. Optional - if the disk is a solid state (SSD) you may wish to stop the system writing the time of the last file access to files when they are used. This saves on writes which add wear to the disk. To do this, edit the field that has no label but contains a bunch of options like 'nosuid,nodev,nofail,x-gvfs-show'. Leave the existing contents intact, but add ',noatime' to the end (without the quotes, with the preceding comma as indicated.)
You already wrote it as optional but I think this is dated information. The kernel uses relatime by default and that only updates the last access time when the file is modified—at which time the file's information block is written anyway to update the last modified time. When compared to relatime, noatime doesn't further reduce disk writes.

I'm afraid that's incorrect.

From man mount:
Since Linux 2.6.30, the kernel defaults to the behavior provided by [relatime] (unless noatime was specified), and the strictatime option is required to obtain traditional semantics. In addition, since Linux 2.6.30, the file's last access time is always updated if it is more than 1 day old.
Therefore noatime significantly reduces disk writes compared to relatime.
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Easily set drives to mount automatically at boot

Post by Flemur »

MintBean wrote: Tue Oct 10, 2017 5:06 pm 10. Optional - give your disk a nice display name. This is the name it will appear as on the desktop. Enter your chosen name in the 'display name' field.
Is 'display name' the same as the LABEL value in e.g.

Code: Select all

$ blkid
/dev/sda1: LABEL="MINT" UUID="2a21...d6" TYPE="ext4" PARTUUID="stuff...1"
?
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Fires

Re: Easily set drives to mount automatically at boot

Post by Fires »

I Need some help here
is this only for linux mint ?

and this is my HDD with Linux mint on it

https://imgur.com/ECxAyNk

thank u
User avatar
Sgthawker
Level 4
Level 4
Posts: 226
Joined: Sun Apr 27, 2014 2:23 am

Re: Easily set drives to mount automatically at boot

Post by Sgthawker »

If you are referring to the highlighted drive in the image, it is the esp, it is required for booting on a UEFI computer. It is not for linux or windows in particular, it is for any OS to boot on a UEFI system.
LM21.1 KDE/LM21.1 Cin/ UEFI Tuf Gaming X570 Plus, Ryzen 7 5800X, GTX 3060, Samsung 980 Pro M.2 NVMe
LM21.1 KDE/LM21.1 Cin/ UEFI on STRIX laptop, i7700 HQ, GTX 1060, Samsung 980 Pro M.2 NVMe
User avatar
PhilAypee
Level 3
Level 3
Posts: 132
Joined: Sat Jul 30, 2016 5:14 am
Location: Bramley, Surrey, UK

Re: Easily set drives to mount automatically at boot

Post by PhilAypee »

MintBean wrote: Tue Oct 10, 2017 5:06 pm This is for people who to enable a second drive to auto-mount at system start up WITHOUT editing a system file by hand.

1. Open the application 'Disks' from the Mint menu. (It's under 'Accessories.')
2. In the left hand part of the window, click on the disk which contains the partition you wish to mount.
3. The partition layout of the selected disk will appear in the right hand portion of the window.
4. Select the partition you wish to auto-mount by clicking on it. The selected partition will be highlighted.
5. Optional - If you wish to immediately mount the disk, you can do so by pressing the triangular 'play' button that appears to the left below the partition display. This will NOT cause it to auto-mount on next boot.
You may unmount the partition if you wish by pressing the square 'stop' button that appears where the play button was.
6. Click the cog icon <additional partition options> and select 'edit mount options.'
7. Switch 'automatic mount options' to OFF.
8. Check the 'mount at startup' box.
9. Optional - choose a custom mount point - in the 'Mount point' box, enter the mount point. I always choose something in the /mnt directory. e.g. '/mnt/Mydiscname'
10. Optional - give your disk a nice display name. This is the name it will appear as on the desktop. Enter your chosen name in the 'display name' field.
11. Hit OK and close the disks application. The disk should automount on next boot.
This worked almost flawlessly for me. :)

The flaw was that Thunar removed the wastebasket option (it only allowed delete unless the file/files/directory/directories were moved to the wastebasket). To restore it I had to run the Configure Thunar program. It was easy but it might not be obvious to some people :!:
Take care,
Phil.

Minimize your therbligs until it becomes automatic;
this doubles your effective lifetime – and thereby gives time to enjoy
butterflies and kittens and rainbows.


LM 19.3 Xfce 64 bit - 4Gb RAM Dual Core Celeron N3350
🚂🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃
Armstrong
Level 4
Level 4
Posts: 244
Joined: Tue Sep 11, 2012 12:57 pm

Re: Easily set drives to mount automatically at boot

Post by Armstrong »

Absolutely brilliant!!! I have been using Linux Mint for eight years, and dealing with partitions has been the most daunting task I have encountered to date. This made the whole process effortless. I wish this tutorial had been around in 2012. Of course, I might not have found it then, but... FWIW, it works with Linux Mint 20. Slainte!
masternetra
Level 1
Level 1
Posts: 34
Joined: Fri Jan 22, 2010 12:45 pm

Re: Easily set drives to mount automatically at boot

Post by masternetra »

To add to tutorial if you want to mount with a specific user, after step 8. go down to where "nosuid,nodev,nofail,x-gvfs-show" is and after x-gvfs-show add a comma then add uid=InsertUserName (with InsertUserName being the user name you want of course).

You can also set the group by adding a comma then entering gid=InsertGroupName.
ohenriquez65

Re: Easily set drives to mount automatically at boot

Post by ohenriquez65 »

MintBean, nailed it.
The disk utility is the best way to go.
I tried it right after I opened this post and works like a charm.
juhanjaagup
Level 1
Level 1
Posts: 2
Joined: Sun May 03, 2015 7:57 am
Location: Tartu, Estonia, Europe

Re: Easily set drives to mount automatically at boot

Post by juhanjaagup »

Flemur wrote: Wed Oct 02, 2019 8:12 am
MintBean wrote: Tue Oct 10, 2017 5:06 pm 10. Optional - give your disk a nice display name. This is the name it will appear as on the desktop. Enter your chosen name in the 'display name' field.
Is 'display name' the same as the LABEL value in e.g.

Code: Select all

$ blkid
/dev/sda1: LABEL="MINT" UUID="2a21...d6" TYPE="ext4" PARTUUID="stuff...1"
?
I myself have used from the quite beginning of my Linux-era to set the Labels either during the install or aftewards with GParted; and only 16 digits/letters are allowed. For example /Ev_MiMa64_h40_s3/ (It means for me ssd Evo120GB; Mint Mate 64-bit; home 40GB; sdx3.) If the "Display name" is not set by the app Disks, then my partition can be seen on desktop or menu as I set the Label. Otherwise I see it by the UUID of partition (the long "stuff" of digits and letters), and I need to guess what it contains. Whatever Name (number of letters/digits not so limited) I had set to the certain partition with help of the GParted (or also could be done with (Gnome) Disks, I see it only in it's own window, not at desktop or elsewhere.
Now, as I also have set the "Display Name" with Disks, I can see with GParted (or with Disks: The Gears > Edit Partition/Edit Filesystem) that both the Name and Label I had set earlier have not changed. It means the given Display name has not really changed the Label, nor Name -- something that is fixed to this partition. Not possible at the moment, yet If I would connect this drive to another Linux-PC, it still gets showed on desktop by this Label (or UUID, if Label is not set). The Display name can truly have meaning only in this certain Linux install, as long as the app Disks works and Automount has been switched off (point 7. by MintBean). The Name set with GParted/Gnome Disks also has meaning only in it's window (or some other partition manager program). Although, it gets sticked to this partition, and could be seen also by other Linux install. The relativeness of the Display Name gets illustrated also by the fact that I need to give it a new one, if I switch with Gnome Disks Automount in and again off -- the given Display Name gets then wiped off.

Besides, I myself get a lot of childish pleasing setting these Labels -- like putting into order the mess of wires on my table (but this I enjoy far less -- unlike the Labels they get tomorrow a mess again!:)
Last edited by juhanjaagup on Sat Dec 26, 2020 6:10 am, edited 4 times in total.
vimes666
Level 6
Level 6
Posts: 1191
Joined: Tue Jan 19, 2016 6:08 pm

Re: Easily set drives to mount automatically at boot

Post by vimes666 »

Btw, I noticed that 7. Switch 'automatic mount options' to OFF should be rephrased as 7. Switch 'User Session Defaults' to OFF.
If you think the issue is solved, edit your original post and add the word solved to the title.
User avatar
AndyMH
Level 21
Level 21
Posts: 13563
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Easily set drives to mount automatically at boot

Post by AndyMH »

Not a fan of disks and I think it creates messy fstab entries, better to do it manually - it's not that difficult.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
johnkaperoniz
Level 1
Level 1
Posts: 10
Joined: Mon Jul 29, 2019 12:57 am

Re: Easily set drives to mount automatically at boot

Post by johnkaperoniz »

Armstrong wrote: Sat Oct 24, 2020 1:03 pm Absolutely brilliant!!! I have been using Linux Mint for eight years, and dealing with partitions has been the most daunting task I have encountered to date. This made the whole process effortless. I wish this tutorial had been around in 2012. Of course, I might not have found it then, but... FWIW, it works with Linux Mint 20. Slainte!
I agree, working with partitions has been a nightmare especially with many of them. This method helps ease things flawlessly, rep to OP. Its too bad this method wasn't made mor widely known sooner.
“There is a gigantic difference between earning a great deal of money and being rich.”
“Money is usually attracted, not pursued.”
“If we command our wealth, we shall be rich and free. If our wealth commands us, we are poor indeed.”
Meander
Level 1
Level 1
Posts: 35
Joined: Fri Mar 23, 2018 7:01 am

Re: Easily set drives to mount automatically at boot

Post by Meander »

The "Trash" feature doesn't work on mounted disks. is it because of their format "NTFS" or else?
Locked

Return to “Tutorials”