Fedora Linux Support Community & Resources Center
  #1  
Old 24th February 2011, 10:24 PM
Shaggy1 Offline
Registered User
 
Join Date: Apr 2010
Posts: 32
linuxfedorafirefox
Changing the default mount directory

Hi

When I add an external device it is automatically mounted by Fedora to /media. Does anyone know if it is possible to change the default mount directory to something else (like /mnt) ?
Reply With Quote
  #2  
Old 24th February 2011, 11:30 PM
nsnbm Offline
Registered User
 
Join Date: Dec 2007
Location: Australia
Posts: 427
linuxfedorafirefox
Re: Changing the default mount directory

Hello Shaggy1,

You could try adding a new mount point in /etc/fstab such as a line like:
/dev/sr0 /mnt/cdrom auto user,rw,noauto,exec 0 0
With this particular command I mount cdroms manually, which is the effect of the "noauto" option.
Check man mount for the options you want to include. I know /mnt used to be used long ago for mounting cdroms but this has changed over time to /media, or /media/cdrom which has left the /mnt directory free to be used now to mount other devices which include the loop device. Ben.
Reply With Quote
  #3  
Old 25th February 2011, 01:51 AM
Mariusz W Offline
Registered User
 
Join Date: Nov 2007
Location: Berkeley, California
Posts: 690
windows_vistafirefox
Re: Changing the default mount directory

I suppose OP asks about changing the default mount point for automounting.

The latter is being performed by udisks (or, more properly by the udisks-daemon). I checked the manual pages for udisks(1), udisks(7), and udisks-daemon (8). Unfortunately, I wasn't able to find any configuration option controlling the default value of the mount point (not that I see any reasons to change it from /media to, say, /mnt).

You can perhaps ask the udisks author, David Zeuthen (you will find his email in any of the above mentioned man pages).

Last edited by Mariusz W; 25th February 2011 at 01:54 AM.
Reply With Quote
  #4  
Old 25th February 2011, 09:36 AM
Shaggy1 Offline
Registered User
 
Join Date: Apr 2010
Posts: 32
linuxfedorafirefox
Re: Changing the default mount directory

Hi

Thank you for your replies.

I had not heard of udisk and did not know that was the tool that did the automounting, so thank you for that information.

It does, however, seem that there is no way of altering the name of the default mount point, so until I find a way of doing this I'll try to use the fstab solution.

The reason I wanted to change this is because I have a separate partition called media in which I wish to separately keep music/videos - to be used as a data area for myth tv.
Reply With Quote
  #5  
Old 25th February 2011, 09:53 AM
flyingfsck Offline
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,845
linuxfedorafirefox
Re: Changing the default mount directory

Yeah, it is very simple:
Set the Volume Name of the external disk file system to something unique. The system will then always mount it as /media/somethingunique.

You can change the Label of a filesystem in various ways using tune2fs, mlabel, e2label and others.
Reply With Quote
  #6  
Old 25th February 2011, 01:52 PM
didier83 Offline
Registered User
 
Join Date: Nov 2010
Location: Carcès, France
Age: 60
Posts: 96
linuxfedorachrome
Re: Changing the default mount directory

Just by interest because I was also wondering how to use a mointpoint other than /media ,I've just downloaded hal-0.5.14 source code and found that /media is harcoded

Unless I've misseyd something, I see no possibilit to modify this.

A solution could be to create a symlink with /media
But this will not be a solution if you want to have /media only used by you.
Reply With Quote
  #7  
Old 25th February 2011, 04:58 PM
Mariusz W Offline
Registered User
 
Join Date: Nov 2007
Location: Berkeley, California
Posts: 690
linuxfedorafirefox
Re: Changing the default mount directory

Quote:
Originally Posted by Shaggy1 View Post
Hi

Thank you for your replies.

I had not heard of udisk and did not know that was the tool that did the automounting, so thank you for that information.
The name of the program is udisks.

Quote:
Originally Posted by Shaggy1 View Post
It does, however, seem that there is no way of altering the name of the default mount point, so until I find a way of doing this I'll try to use the fstab solution.
I advise you against doing that. Besides being a 'wrong' solution it is also pointless: each time you will be connecting to your computer any external USB disk or flash drive, the file manager will be automounting it in /media anyway: you can't create entries in /etc/fstab for every device you may ever come across in the future, and doing that correctly is not that obvious: you would need to determine the UUID of each and every device you intend to connect to your computer. Are you sure you want to do that?

Quote:
Originally Posted by Shaggy1 View Post
The reason I wanted to change this is because I have a separate partition called media in which I wish to separately keep music/videos - to be used as a data area for myth tv.
There are much better solutions:

a) choose a different name

or, even better,

b) place the directory where you intend to keep your music/videos etc not at the root of your system. It is highly advisable to keep your data in a partition separate from your system. Why not to put there the directory where you intend to keep your music/videos? And you can call it media if you wish.

Last edited by Mariusz W; 25th February 2011 at 05:17 PM.
Reply With Quote
  #8  
Old 25th February 2011, 11:56 PM
nsnbm Offline
Registered User
 
Join Date: Dec 2007
Location: Australia
Posts: 427
linuxfedorafirefox
Re: Changing the default mount directory

Hello readers,

I use /etc/fstab to mount all devices which I attach to my computer. Once they are plugged in there is no problem with finding what they are called because they appear in /proc/partitions. And of course, I can mount them wherever it suits me. Once plugged in, they also appear in /dev/disk/ where their names are given by label, path, uuid and id. Once I choose whichever device name I prefer, I make an /etc/fstab entry. I do not use gnome or kde, but a simple window manager so I work with very little that is automated. One suggestion if one wants to keep /media free for other purposes is to create a directory /cdrom in the filesystem and make a relevant /etc/fstab entry to mount the cdrom at that point. That's what I really like about fedora linux, there are so many possibilities. Ben.

Last edited by nsnbm; 26th February 2011 at 12:05 AM. Reason: clarification
Reply With Quote
  #9  
Old 14th March 2011, 04:51 PM
Shaggy1 Offline
Registered User
 
Join Date: Apr 2010
Posts: 32
windows_xp_2003firefox
Re: Changing the default mount directory

Hi

Thank you for your replies. It seems there are several options.
It looks like /media was a bad name to choose, so I think I'll look into changing the name of the partition.
Does anyone know if there is a way of doing this without recreating (and therefor overwriting) the whole partition ?

Mariusz W could I ask what you mean "It is highly advisable to keep your data in a partition separate from your system".
By this do you mean on a partition located on an external disk ? Or simply that the it should be a partition separate from the partitions containing the linux system files (which is indeed my intention).
Reply With Quote
  #10  
Old 14th March 2011, 05:57 PM
vallimar Offline
Registered User
 
Join Date: Jul 2008
Posts: 1,050
linuxchrome
Re: Changing the default mount directory

I haven't tried it, but it may be possible to make a symlink of /media to /mnt.
Really though, I don't see the big deal.. it's just a name.. media is short for
removable media and so makes just as good a sense as mnt for mount(s).
Reply With Quote
  #11  
Old 14th March 2011, 09:49 PM
Mariusz W Offline
Registered User
 
Join Date: Nov 2007
Location: Berkeley, California
Posts: 690
linuxopera
Re: Changing the default mount directory

Quote:
Originally Posted by vallimar View Post
I haven't tried it, but it may be possible to make a symlink of /media to /mnt.
Really though, I don't see the big deal.. it's just a name.. media is short for
removable media and so makes just as good a sense as mnt for mount(s).
This is not a solution, since in the current implementation of HAL /media is a default directory where mounting points for "removable media" are created and their file systems mounted.

Quote:
Originally Posted by Shaggy1 View Post
Thank you for your replies. It seems there are several options.
It looks like /media was a bad name to choose, so I think I'll look into changing the name of the partition.
Does anyone know if there is a way of doing this without recreating (and therefor overwriting) the whole partition ?
So, you created a partition which is mounted at /media, if I understood you correctly. A disk partition and a point where it is being mounted are 2 different things. Just change the mount point for that partition: if you created an entry in /etc/fstab, change the corresponding mount point there; if the partition is mounted by some script at boot time, change the mount point in that script; if, finally, it is automounted when, e.g., you click on the partition icon in a window manager like Nautilus, then leave it to udisks to mount it--it will mount it in /media/<somename>, and if you don't like <somename>, assign a suggestive sounding label to the partition using, e.g., a partition manager like gparted or, if the partition has a FAT32 or NTFS file system, assign the label using Windows.

Quote:
Originally Posted by Shaggy1 View Post
Mariusz W could I ask what you mean "It is highly advisable to keep your data in a partition separate from your system".
By this do you mean on a partition located on an external disk ? Or simply that the it should be a partition separate from the partitions containing the linux system files (which is indeed my intention).
I mean a separate partition: it may reside on the same physical disk as the Linux sytem partitions(s), or may be on another physical disk, if you have more than one internal disk.

Last edited by Mariusz W; 16th March 2011 at 02:35 AM.
Reply With Quote
  #12  
Old 14th March 2011, 10:20 PM
vallimar Offline
Registered User
 
Join Date: Jul 2008
Posts: 1,050
linuxchrome
Re: Changing the default mount directory

Quote:
Originally Posted by Mariusz W View Post
This is not a solution, since /media is a default directory where "removable media" are being mounted in the current implementation of HAL.
They are mounted as a subdirectory under /media, which is created and removed automatically. It does not mount them as /media itself. Crucial difference.
Reply With Quote
  #13  
Old 14th March 2011, 10:34 PM
Mariusz W Offline
Registered User
 
Join Date: Nov 2007
Location: Berkeley, California
Posts: 690
linuxopera
Re: Changing the default mount directory

Quote:
Originally Posted by vallimar View Post
They are mounted as a subdirectory under /media, which is created and removed automatically. It does not mount them as /media itself. Crucial difference.
Of course I know that (as the rest of my post testifies to). The OP said that /media is the mounting point for the partition he created. I don't see how what you propose can help him.
Reply With Quote
  #14  
Old 15th March 2011, 05:23 PM
vallimar Offline
Registered User
 
Join Date: Jul 2008
Posts: 1,050
windows_xp_2003chrome
Re: Changing the default mount directory

Ahh, I missed that part. He only has two solutions in that case, mount his stuff elsewhere,
even if just as a sub under /media, or recompile hal/udisks to change the hardcoded mount
point, but that may break other things that rely on that location.

I guess the short, realistic answer to his original question is simply "it isn't".
Reply With Quote
  #15  
Old 18th March 2011, 08:25 AM
Shaggy1 Offline
Registered User
 
Join Date: Apr 2010
Posts: 32
linuxfedorafirefox
Re: Changing the default mount directory

Hi

Thank you again for your informative replies.

Mariusz W writes:
"So, you created a partition which is mounted at /media,if I understood you correctly"
Yes you have understood this correctly, for which I am grateful because I hadn't. It seems I made a mistake in my understanding of my '/media' partition. I created the partition and spceified the mount point at the same time using gparted and for some reason had it in my head that I has set 'media' up as the id of the partition.

I have changed the name of the mount point to something else so the partition is not on the same mount point as the automounted devices.

As to the changing the default automounting point I guess I can conclude that this is not possible (or only possible by re-compiling udisks).
Reply With Quote
Reply

Tags
changing, default, directory, mount

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Directory Color Matt1776 Using Fedora 16 18th December 2011 03:00 AM
How can I mount a directory out of the root directory kanbowei Using Fedora 7 13th November 2007 03:40 PM
Changing the Default Apache Directory matt0509 Servers & Networking 7 8th June 2007 07:47 AM
changing directory question masionas Using Fedora 4 9th June 2005 04:10 PM


Current GMT-time: 01:53 (Tuesday, 02-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat