LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 04-09-2011, 08:14 AM   #1
PatDB
LQ Newbie
 
Registered: Apr 2011
Posts: 3

Rep: Reputation: 0
How r/w mount external USB with NTFS automatically within GNOME on CentOS 5.6


Hello everyone,

I would like to mount an external USB drive containing a NTFS filesystem automatically within GNOME as soon as I plug the drive into the computer.

I have the following system:

Code:
rpm -q centos-release
centos-release-5-6.el5.centos.1

uname -a
Linux pat 2.6.18-238.5.1.el5.centos.plus #1 SMP Mon Apr 4 18:19:56 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
I installed ntfs-3g and can manually read/write mount the drive using:

Code:
mount /dev/sdb1 /media/MyUSBDrive
mount
/dev/sdb1 on /media/MyUSBDrive type fuseblk (rw,allow_other,blksize=4096)
touch /media/MyUSBDrive/testfile01.txt
If I run GNOME and plug in the drive then some automount procedure mounts the drive. However I can only read and cannot write as "normal" user:

Code:
touch /media/MyUSBDrive/testfile02.txt
touch: cannot touch /media/MyUSBDrive/testfile02.txt: Permission denied
Root can do it:

Code:
sudo touch /media/MyUSBDrive/testfile02.txt
Is there any way how I can set the automount procedure within GNOME so that it automatically mounts the drive rw for "normal" users?

I do not want a fixed destination mount point, that is I do not want to enter something like:

Code:
/dev/sdb1  /media/MyUSBDrive  ntfs-3g  rw,umask=0000,defaults 0 0
into /etc/fstab as I want to be able to plug in several USB drives named after their filesystem label (I want for example /media/PatsDrive /media/MyUSBDrive /media/SomeOtherDrive ...).

Can anyone help me? Thank you!

Pat
 
Old 04-09-2011, 10:22 AM   #2
bluebox
Member
 
Registered: Jun 2004
Posts: 71

Rep: Reputation: 6
I suppose it's not gnome that auto-mounts your drive but "udev". Gnome just gets notified about your (new) drive and reacts.

udev is powerful enough to use custom moutpoints and custom access rights. The drawback is that most likely you'll have to write some custom udev rules by hand.
 
1 members found this post helpful.
Old 04-09-2011, 12:56 PM   #3
PatDB
LQ Newbie
 
Registered: Apr 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you for your answer. The hint with "udev" helped so that I could find the solution (see http://www.linuxquestions.org/questi...5/#post4277867)

I had to create the file /usr/share/hal/fdi/policy/10osvendor/20-ntfs-3g-policy.fdi with the following content:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="volume.fstype" string="ntfs">
      <match key="@block.storage_device:storage.hotpluggable" bool="true">
        <merge key="volume.fstype" type="string">ntfs-3g</merge>
        <merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge>
        <merge key="storage.policy.should_mount" type="bool">true</merge>
        <append key="volume.mount.valid_options" type="strlist">locale=</append>
        <append key="volume.mount.valid_options" type="strlist">exec</append>
      </match>
    </match>
  </device>
</deviceinfo>
It seems to me as if udev did not use the ntfs-3g driver previously.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mount an external ntfs usb hard disk dmpop Mandriva 5 03-03-2013 11:45 AM
HAL rules to automatically mount an external usb hdd? prof Linux - General 1 11-05-2009 12:40 PM
Mount external usb-ntfs hd on ubuntu Nis2k Linux - Newbie 1 12-30-2007 10:49 PM
Help Me, automatically mount ntfs partitions on USB and Firewire drives RottenMutt Fedora 1 11-01-2006 01:27 PM
can't mount external usb ntfs harddrive etienne.navarro Mandriva 1 10-27-2005 01:54 PM


All times are GMT -5. The time now is 04:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration