LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-09-2012, 06:00 PM   #1
ilesterg
Member
 
Registered: Jul 2012
Location: Philippines
Distribution: CentOS, Oracle Linux, AIX
Posts: 354

Rep: Reputation: 46
Mint mount ntfs partition for all users


Hey guys,

I have this partition which I use for storing my files, which was formatted as ntfs back when I was using XP. I found out that NTFS partitions should be mounted manually, and I found no entries of it in fstab.
Code:
guest@ilesterg ~ $ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc	/proc	proc	defaults	0	0
# /dev/sda1
UUID=3f8a4646-b4f4-4b22-a435-043206ebc65a	swap	swap	sw	0	0
# /dev/sda3
UUID=423b09d9-fdea-4870-9f58-659809b9c0b1	/	ext4	rw,errors=remount-ro	0	1
guest@ilesterg ~ $
Currently, I mount it by opening up the file manager in Linux Mint Debian, and clicking on "Data" (partition name) on the places menu.

I found out that when I mount this partition, only 1 user could access the mounted partition. Here's the output from another user:
Code:
worldwide@ilesterg ~ $ ls -l /media/ | grep Data_
drwx------ 1 guest guest 28672 Jul 30 23:32 Data_
worldwide@ilesterg ~ $ su
Password: 
ilesterg worldwide # chmod 666 /media/Data_
ilesterg worldwide # exit
exit
worldwide@ilesterg ~ $ ls -l /media/ | grep Data_
drwx------ 1 guest guest 28672 Jul 30 23:32 Data_
worldwide@ilesterg ~ $
I want this partition to be mounted once, and be used by all users logged on to my system. I tried changing the permission, but as I found out, that's not how things work.

Here is my mtab:
Code:
guest@ilesterg ~ $ cat /etc/mtab | grep Data_
/dev/sda2 /media/Data_ fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0
guest@ilesterg ~ $
 
Old 08-10-2012, 12:16 PM   #2
Vegan
Member
 
Registered: Aug 2010
Location: Idaho
Distribution: Arch, Ubuntu, Fedora
Posts: 113
Blog Entries: 2

Rep: Reputation: 10
Add an entry to your fstab for the NTFS partition


/dev/sda2 /media ntfs defaults 0 0


Then you will want to make sure permissions are setup correctly

It will auto mount from there on
 
Old 08-11-2012, 10:39 AM   #3
ilesterg
Member
 
Registered: Jul 2012
Location: Philippines
Distribution: CentOS, Oracle Linux, AIX
Posts: 354

Original Poster
Rep: Reputation: 46
I'm sorry, I forgot to mention I even tried that, but it didn't work.

Code:
/dev/sda2 /media/Data ntfs defaults 0 0
 
Old 08-11-2012, 10:41 AM   #4
ilesterg
Member
 
Registered: Jul 2012
Location: Philippines
Distribution: CentOS, Oracle Linux, AIX
Posts: 354

Original Poster
Rep: Reputation: 46
I'm not sure if this would help, but here's the permissions for the mount point I created:

Code:
ilesterg@ilesterg ~ $ ls -l /media/ | grep Data
drwxr--r-- 2 root     root     4096 Aug  7 17:01 Data
 
Old 08-11-2012, 10:49 AM   #5
Vegan
Member
 
Registered: Aug 2010
Location: Idaho
Distribution: Arch, Ubuntu, Fedora
Posts: 113
Blog Entries: 2

Rep: Reputation: 10
Is that before or after the drive was mounted?
And did you reboot the computer after editing the fstab?
 
Old 08-11-2012, 05:21 PM   #6
ilesterg
Member
 
Registered: Jul 2012
Location: Philippines
Distribution: CentOS, Oracle Linux, AIX
Posts: 354

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by Vegan View Post
Is that before or after the drive was mounted?
And did you reboot the computer after editing the fstab?
That was the mount point I created, which the partition is supposed to be mounted on, and yes I rebooted after editing fstab. When manually mounting, as I described on my first post, the mount point is /dev/Data_
 
Old 08-11-2012, 05:57 PM   #7
yancek
Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 5,076

Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
In some places you refer to your partition as "Data" and in other places as "Data_", the second with an underscore (_). Which is it? In one of your previous posts, you show the owner:group for Data as root:root so only root and members of the root group would have access. Change the user group to users or something more appropriate.
 
Old 08-11-2012, 10:59 PM   #8
ilesterg
Member
 
Registered: Jul 2012
Location: Philippines
Distribution: CentOS, Oracle Linux, AIX
Posts: 354

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by yancek View Post
In some places you refer to your partition as "Data" and in other places as "Data_", the second with an underscore (_). Which is it?
Okay, sorry for the confusion.

I created a mount point /media/Data where the device /dev/sda2 would be mounted on on boot time, by adding an entry of that device on /etc/fstab.
Code:
/dev/sda2 /media/Data ntfs defaults 0 0
The permissions:
Code:
ilesterg@ilesterg ~ $ ls -l /media/ | grep Data
drwxr--r-- 2 root     root     4096 Aug  7 17:01 Data
Since it failed, I use the file manager on Mint to mount the device. Clicking on the partition name "Data" would mount it to /media/Data_ (perhaps since /media/Data already exists).

I mentioned earlier that I found out NTFS partitions should be mounted manually, but it seems like you're all ignoring it, so I guess I'm wrong about that. So, I can't see why it's not automatically mounted.

I want to automounting issue to be solved, but my greater concern here actually is to set up permissions on the mount so all users could use it. Again, since /media/Data_ is dynamically generated, I planned to create /media/Data then setup necessary permission later. Since the mount failed, I didn't set the necessary permission yet.
 
Old 08-11-2012, 11:01 PM   #9
ilesterg
Member
 
Registered: Jul 2012
Location: Philippines
Distribution: CentOS, Oracle Linux, AIX
Posts: 354

Original Poster
Rep: Reputation: 46
Could it be that the automounting failed because the user and group owner of /media/Data is root?
 
Old 08-11-2012, 11:11 PM   #10
ilesterg
Member
 
Registered: Jul 2012
Location: Philippines
Distribution: CentOS, Oracle Linux, AIX
Posts: 354

Original Poster
Rep: Reputation: 46
I thought the automounting fails because the user owner and group is root, so I did the following, rebooted, but to no avail.
Code:
ilesterg@ilesterg ~ $ ls -l /media | grep Data
drwxr--r-- 2 root     root     4096 Aug  7 17:01 Data
ilesterg@ilesterg ~ $ sudo chown -v ilesterg:ilesterg /media/Data
[sudo] password for ilesterg: 
changed ownership of `/media/Data' from root:root to ilesterg:ilesterg
ilesterg@ilesterg ~ $ ls -l /media | grep Data
drwxr--r-- 2 ilesterg ilesterg 4096 Aug  7 17:01 Data
ilesterg@ilesterg ~ $ sudo chmod 777 /media/Data
ilesterg@ilesterg ~ $ ls -l /media | grep Data
drwxrwxrwx 2 ilesterg ilesterg 4096 Aug  7 17:01 Data
ilesterg@ilesterg ~ $
 
Old 08-11-2012, 11:32 PM   #11
yancek
Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 5,076

Rep: Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804Reputation: 804
Quote:
Could it be that the automounting failed because the user and group owner of /media/Data is root?
I'd agree that's not the problem. I ran your command on my windows partition and this is the output:

# ls -l /mnt/ | grep win_7
drwxrwxrwx 1 root root 8192 Jul 6 08:16 win_7/

Looks similar but in mine everyone has read/write. I don't know if that's what you want. My fstab entry for windows is below. I would expect that you would need user but you may want to change the umask number to limit write permissions, 002 perhaps.
.
Quote:
/dev/sda2 /mnt/win_7 ntfs-3g auto,user,rw,umask=000 0 0
The link below gives a brief explanation of umask:

http://www.cyberciti.biz/tips/unders...lue-usage.html

Last edited by yancek; 08-11-2012 at 11:34 PM.
 
Old 08-12-2012, 06:48 AM   #12
linuxxer
Member
 
Registered: Apr 2011
Location: I have my own planet
Distribution: SlackwareŽ
Posts: 72
Blog Entries: 1

Rep: Reputation: Disabled
Try this:

Code:
LABEL=Data   /media/Data    auto,rw,ntfs-3g,allow_other    0 0
[/QUOTE]
 
Old 08-12-2012, 11:05 PM   #13
ilesterg
Member
 
Registered: Jul 2012
Location: Philippines
Distribution: CentOS, Oracle Linux, AIX
Posts: 354

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by linuxxer View Post
Try this:

Code:
LABEL=Data   /media/Data    auto,rw,ntfs-3g,allow_other    0 0
[/QUOTE]

I'll try this later, thanks..
 
Old 08-15-2012, 12:56 PM   #14
ilesterg
Member
 
Registered: Jul 2012
Location: Philippines
Distribution: CentOS, Oracle Linux, AIX
Posts: 354

Original Poster
Rep: Reputation: 46
The following code worked for me:
Code:
/dev/sda2 /media/Data ntfs-3g defaults 0 0
Thanks all!
 
  


Reply

Tags
mounting, ntfs


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how mount mount ntfs partition of windows xp kashif2131971 Linux - Newbie 3 07-07-2009 07:34 PM
how to mount NTFS partition sunlinux Linux - Software 1 07-21-2006 12:30 AM
How do you mount an NTFS partition? karaite Suse/Novell 5 11-01-2004 01:18 PM
HOW-TO mount NTFS partition? xperts Linux - Newbie 5 02-03-2004 02:21 PM
Mounting NTFS Partition for all users? Seph64 Slackware 3 02-27-2003 09:58 AM


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

Main Menu
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