LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting ntfs partition (http://www.linuxquestions.org/questions/linux-newbie-8/mounting-ntfs-partition-303680/)

Gentleman_finn 03-19-2005 05:22 PM

Mounting ntfs partition
 
hello.

I am pretty new to linux, so pleace explain in details, thanks :)

Here's what I have done until now:

I have tryed the mepis distro for some time, just to try linux out, then i decitet that i wantet to try ubuntu, I installed it and here I am now :)
Now I want to mount a ntfs partition where I have my music on, it's hda 5

Enhed Opstart Start Slut Blokke Id System
/dev/hda1 1 922 7405933+ 7 HPFS/NTFS
/dev/hda2 992 6756 46307362+ f w95 udvidet (LBA)
/dev/hda3 * 6757 7297 4345582+ 83 Linux
/dev/hda5 992 6728 46082421 7 HPFS/NTFS
/dev/hda6 6729 6756 224878+ 82 Linux swap / Solaris

so i type "mount ntfs /dev/hda5 /media/hda5

and it works fine the partition gets mountet

Here's my problem:

1. I want to open the partition in Amarok, the music player, so I can play my music, but it seams that I can't :/ it just have a lock symbol on the folder, how can i change it, so amarok also have read acces to hda5??

2. I tryed writing "/dev/hda5 /media/hda5 ntfs default 0 0" in fstab so that it would auto mount on startup, how do I get it to auto mount??

visaris 03-19-2005 05:49 PM

I take it that you are mounting the NTFS partition while you are logged in (su possibly) as root, and that you are trying to access the files from a non-root account?

If what I just said is the case, this might help. Because NTFS does not contain any linux file ownership information, linux sets the owner of all files on a NTFS volume to the user who mounted the volume. This is why your normal user account cannot access the files; root mounted the drive.

From the mount manpage:
Code:

Mount options for ntfs
      ...
      uid=value, gid=value and umask=value
              Set the file permission on the filesystem.  The umask value  is
              given  in  octal.  By default, the files are owned by root and
              not readable by somebody else.

You have a few options:

1) You can specify a umask value when you mount the NTFS volume:
Code:

prompt # mount -t NTFS -o umask=644 /dev/hda5 /media/hda5
The 644 value should make it so that while the files are still owned by root, other users are allowed to read them.

2) You could use the uid= and guid= options:
Code:

prompt # mount -t NTFS -o uid=1000,gid=100 /dev/hda5 /media/hda5
This will cause the files to be owned by the specifid user and group instead of root. (uid = user id, gid = group id) If you want to find out what uid and gid values to use, you can try "echo $UID" (and $GID), but if all else fails look in your /etc/passwd and /etc/groups files.

3) Edit /etc/fstab so that the volume can be mounted by users:
Code:

/dev/hda5      /media/hda5            ntfs        noauto,ro,user          0 0
This tells the computer to not mount the volume on boot. That way a user has the ability to mount it later on. Because the user, and not root, mounts the volume, the owner of the files should be set to the user.


I prefer method 1 personally. It is more secure. Also remember that NTFS in linux is read-only currently. Don't expect to be able to write to the NTFS volume.

Gentleman_finn 03-19-2005 06:55 PM

Quote:

Originally posted by visaris

1) You can specify a umask value when you mount the NTFS volume:
Code:

prompt # mount -t NTFS -o umask=644 /dev/hda5 /media/hda5
The 644 value should make it so that while the files are still owned by root, other users are allowed to read them.
thanks thats wotking just fine, but i still don't want to write this every time i start linux..! how can i fix that?

harken 03-20-2005 01:51 AM

Use the 3rd option visaris told you about.

Gentleman_finn 03-20-2005 04:10 AM

Quote:

Originally posted by harken
Use the 3rd option visaris told you about.
I tryed the 3rd uption..! but it mounts it under root..! so I dont have any acces to it :/

harken 03-20-2005 04:14 AM

Add the 'umask=NNN' as well after 'noauto,ro,user', setting NNN to whatever it suits you.

Gentleman_finn 03-20-2005 04:28 AM

hehe =)
 
ok thanks, I am a little slow sometimes ;)

:newbie:

waldropij 04-01-2005 04:30 PM

I am having a similar problem -- I have gone over and over the fstab settings and have tried a myriad of combinations, all with no success.

Automatic mounting of a SATA drive (showing as SDA1) does not occur with the following:

/dev/sda1 /mnt/media ntfs ro,umask=000 0 0

Is there anything I can do to allieviate this problem -- I can live with it, but I'd rather not, you know?

Gentleman_finn 04-01-2005 06:48 PM

Try:

Code:

/dev/sda1        /mnt/media        ntfs      ro,umask=555,auto        0            0
Remember to use umask 555 so that you cant write to the nfts partition..! as someone wrote before :)

waldropij 04-01-2005 06:50 PM

I've tried the auto mount option -- but it still dosn't do the trick. I havn't tried that in conjunciton with the umask=677 option, so I will try that. I'll post my results after my next reboot. Thanks.

waldropij 04-01-2005 07:30 PM

nope...the umask=677 option locked all other users out of the device and the auto option still does not load the device. This is getting to be a pain in the ass, cause every time I boot I have to manually mount the partition IOT get my media libraries to rescan (since they were missing upon boot). Root dosn't mount this device, for some reason! wft??

waldropij 04-01-2005 07:32 PM

after going back, I don't know where the hell I got 677 from for the umask -- but 555, 644...heheh...666...still don't work!

Gentleman_finn 04-02-2005 05:39 AM

I don't know if anyone but me is still looking at this tread..! And I am pretty new to linux..! so :)

Try and mae a new tread so that all the hardcore helpers can see your problem..! :)

harken 04-02-2005 06:07 AM

First of all, it isn't advisable to start a new thread just because the existing one doesn't get answered. And actually, it's not about being answered to, but being patient. Some threads get a reply after 5-10 mins after creation, others after days. It depends on how many users are currently browsing the boards, their level of knowledge, their mood etc.

As for the umask setting, IIRC the values passed to it are actually "substracted" from a 777 permission set. So, try instead a 'umask=022' option.

Sergenten 07-25-2005 03:45 PM

Quote:

Originally posted by harken
As for the umask setting, IIRC the values passed to it are actually "substracted" from a 777 permission set. So, try instead a 'umask=022' option. [/B]
hi, thx for this great info.
It worked for me after using this:
mount -t ntfs -o umask=022 /dev/hda5 /media/hda5

I'm also a :newbie: in the linux world. So this problem has been annoying me for some time, but its finally solved thx too you guys

:)


All times are GMT -5. The time now is 08:44 PM.