How do I make a mount permanent?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
wayner

How do I make a mount permanent?

Post by wayner »

When using the File Browser in Mint I know how to mount a drive/folder from my Windows machines but these mounts disappear when one reboots the PC. Is there a way to make a mount permanent using the GUI, or is the only option to put the mount command in the fstab file?

If I have to put the mount into the fstab file what command to I need?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: How do I make a mount permanent?

Post by altair4 »

There are GUI's - I don't use them because they tend to make a mess of things. I suggest you look at this:

Auto Mount Partition on Boot
: http://forums.linuxmint.com/viewtopic.php?f=42&t=22093

It's presented as a series of templates. Very easy to follow.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
AndrewH

Re: How do I make a mount permanent?

Post by AndrewH »

If you want to auto mount an NTFS partition, ntfs-config in the repositories makes the process easy as cake.
wayner

Re: How do I make a mount permanent?

Post by wayner »

OK I misspecified my original question - the drive that I want to mount is actually a Windows drive on my network and is accesssed via samba. How do I mount a drive that shows up in LM as smb://server/share both temporarily with the mount command, and permanently using fstab?
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: How do I make a mount permanent?

Post by altair4 »

When using the File Browser in Mint I know how to mount a drive/folder from my Windows machines but these mounts disappear when one reboots the PC. Is there a way to make a mount permanent using the GUI, or is the only option to put the mount command in the fstab file?
Sorry, you clearly said "Windows machines" in your original post. For some reason I read that as Windows partition.

There is a way to to do that in fstab and have a link somewhere in my notes on how to do that but you might want to look at this:

Auto Mount Samba Shares on Boot ( GVFS Method ): http://forums.linuxmint.com/viewtopic.php?f=42&t=42713

It uses a different ( and in my opinion, easier ) method - in userspace to mount the share at boot. The counterpart to a manual mount using this method is:

Code: Select all

gvfs-mount smb://server/share
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
wayner

Re: How do I make a mount permanent? [solved]

Post by wayner »

altair - can you put that command in fstab or does it have to go in another startup file?

I have found a solution that works for me. Here is the line that I have added to my fstab file:

Code: Select all

//server/Photos/ /home/fred/Pictures/ServerPhotos cifs credentials=/home/fred/.smbcredentials 0 0
The /home/fred/.smbcredentials file contains:

Code: Select all

username=fred
password=flinstone
You could also put the username and password in the fstab file (as below) but that is a bit of a security risk

Code: Select all

//server/Photos/ /home/fred/Pictures/ServerPhotos cifs username=fred,password=flinstone 0 0
But now you all know my password anyhow :wink:
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: How do I make a mount permanent?

Post by altair4 »

You're using the classic method. Nothing wrong with that. The GVFS method doesn't use fstab at all. It will automount at login. Your way automounts at boot.

EDIT:
Come to think of it I really should rename my HowTo to Auto Mount Samba Shares at Login :wink:
Last edited by altair4 on Thu Mar 18, 2010 1:53 pm, edited 1 time in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
wayner

Re: How do I make a mount permanent?

Post by wayner »

So you mean if I use the GVFS command once then it will always automount after reboots? Or do I have to put the command in a file that gets executed upon the machine booting up?
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: How do I make a mount permanent?

Post by altair4 »

Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
wayner

Re: How do I make a mount permanent?

Post by wayner »

You caught me! I was looking for the old school stuff like putting it in a /etc/init.d file.
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: How do I make a mount permanent?

Post by altair4 »

For things like mounting partitions and other linux internals I tend to go old school. When it comes to samba I'm an ordained minister in the Church of Whatever Works the Easiest. :mrgreen:
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “Beginner Questions”