Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[FAQF] UN3: mounting Windows partitions (FAT, NTFS)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
davidblumberg
n00b
n00b


Joined: 23 Jul 2002
Posts: 9
Location: Sweden

PostPosted: Tue Jul 30, 2002 11:54 am    Post subject: [FAQF] UN3: mounting Windows partitions (FAT, NTFS) Reply with quote

EDIT: renamed (was "Mounting Windows partitions (volunteer wanted)")

Please see the FAQ entry here and post comments to this thread.

--Bloody Bastard


EDIT: A very common question that needs a FAQ. Anyone that deals with fat, vfat and NTFS partitions willing to give it a go?

-- kanuslupus

Old title: User can mount Ntfs but not enter directory. Why?







A normal user can mount my Ntfs partition but it cannot be entered. I can only enter it when I'm root.
This is my /etc/fstab:
[...]
/dev/hda1 /mnt/win2k ntfs auto,ro,user 0 0

I have also changed the directory permission of /mnt/win2k but they always change back to the default - only root can read/enter. I have deleted the dir. and made a new one, same problem.
Suggestions?
_________________
Regards David.
Back to top
View user's profile Send private message
nitro322
Guru
Guru


Joined: 24 Jul 2002
Posts: 594
Location: USA

PostPosted: Tue Jul 30, 2002 12:41 pm    Post subject: Reply with quote

This is my fstab entry for an NTFS partition:
Code:
/dev/hda2  /mnt/c  ntfs  owner,uid=1000,gid=1000,async,ro  0 0

It still creates it so that only the owner can read it, but since I set my user account as the owner, I'm good to go.

Alternatively, you could write a shell script to mount the drive and change permissions all at once:
Code:
#!/bin/sh
mount -t ntfs -o owner,async,ro /dev/hda2 /mnt/c
chmod 555 /mnt/c

I personally prefer to not have it world readable, but to each his own.
Back to top
View user's profile Send private message
davidblumberg
n00b
n00b


Joined: 23 Jul 2002
Posts: 9
Location: Sweden

PostPosted: Tue Jul 30, 2002 8:15 pm    Post subject: Reply with quote

Thank you. Normal user can now enter my Ntfs parition.
_________________
Regards David.
Back to top
View user's profile Send private message
clubbabyseals
n00b
n00b


Joined: 22 Jul 2002
Posts: 21

PostPosted: Wed Jul 31, 2002 3:20 pm    Post subject: Reply with quote

excellent... the answer to my problem right when i needed it...
thanks.
Back to top
View user's profile Send private message
Mandr4ke
Apprentice
Apprentice


Joined: 25 Jul 2002
Posts: 214
Location: Chicago, IL

PostPosted: Sun Aug 04, 2002 5:39 pm    Post subject: Reply with quote

Alternatively, you could write a shell script to mount the drive and change permissions all at once:
Code:
#!/bin/sh
mount -t ntfs -o owner,async,ro /dev/hda2 /mnt/c
chmod 555 /mnt/c

[/quote]

hmm i tried this in a shell after doing su.. but after i leave root i can't access the mount.. i'm lost on this myself.. when i login as my regular user i'm trying to get to my NTFS partition which has mp3's and movies,, but from my desktop i can't access them.. only from a shell as root.. which doesn't help with mplayer.. any ideas??
Back to top
View user's profile Send private message
nitro322
Guru
Guru


Joined: 24 Jul 2002
Posts: 594
Location: USA

PostPosted: Sun Aug 04, 2002 6:20 pm    Post subject: Reply with quote

Mandr4ke wrote:
hmm i tried this in a shell after doing su.. but after i leave root i can't access the mount.. i'm lost on this myself.. when i login as my regular user i'm trying to get to my NTFS partition which has mp3's and movies, but from my desktop i can't access them.. only from a shell as root.. which doesn't help with mplayer.. any ideas??

That seems pretty strange. Hmm... What are the permissions of the directory when you're trying to enter it as a user? Is it still dr-xr-xr-x, or has it changed for some reason? Also, can you maybe enter the root directory (in my case, that'd be /mnt/c) and not any subdirectories? If that's the case changind 'chmod 555 /mnt/c' to 'chmod -R 555 /mnt/c' might help. Of course, if you're only going to be accesing it as one user (and root), you can always just change your mount statement to have it owned by that user.
Back to top
View user's profile Send private message
Mandr4ke
Apprentice
Apprentice


Joined: 25 Jul 2002
Posts: 214
Location: Chicago, IL

PostPosted: Sun Aug 04, 2002 7:33 pm    Post subject: Hmm Reply with quote

Thanks for your help in this.. I've been reading a million posts but i'm still very lost.. and noob.. which doesn't help muh.. Let me see if i can make this as simple as possiable...

All i want to do is be able to login and access my NTFS partition from my desktop with my user not root.

at the moment.. my fstab looks like this.

Code:

/dev/hdh1               /mnt/mov        ntfs            noauto,ro,user,umask=0  0 0


I tried a million different combinations in my fstab.. most of them just didn't mount what so ever.. With this i get no error.. but nothing is getting even mount at all..

My user 'reign' uid '1001' is in all groups except root in the user editor..
when i mount at the shell.. i have to do 'su' or i can't even use the mount.
Which is probably normal.

I've tried this code in my fstab as well
Code:

/dev/hdh1  /mnt/mov  ntfs  owner,uid=1000,gid=1000,async,ro  0 0


but when it boots up it says it's unmountable.. or probablem mounting..

then i tried this at the shell
Code:

mount -t ntfs -o owner,async,ro /dev/hda2 /mnt/c
chmod 555 /mnt/c


this mounts it.. but once i exit out of 'su' i get permission denied when i tried to get into the /mnt/mov directory with my user 'reign'

So starting from scratch for this simple newbie.. How can i mount this NTFS partition, then not under 'su' or 'root' get access to it with my normal user.. Do i have to have it in fstab.. or can i just use a since command line in the shell to mount to correctly.. and what command line should i use.. i'm only using 1 user other then root on my system 'reign'
Any help would be apprecieated.. Thanks!!
Back to top
View user's profile Send private message
nitro322
Guru
Guru


Joined: 24 Jul 2002
Posts: 594
Location: USA

PostPosted: Sun Aug 04, 2002 8:32 pm    Post subject: Reply with quote

I think I might know what your problem is (well, one relating to my suggestion). Check your /etc/passwd and /etc/group files and make sure that both your UID and GID are both 1000. By default, I think Gentoo will assign a user's GID to 100 (the users group). If that's the case, try changing
Code:
/dev/hdh1  /mnt/mov  ntfs  owner,uid=1000,gid=1000,async,ro  0 0
to
Code:
/dev/hdh1  /mnt/mov  ntfs  owner,uid=1000,gid=100,async,ro  0 0

I created a new group for myself for added security/privacy. Does that help?
Back to top
View user's profile Send private message
Mandr4ke
Apprentice
Apprentice


Joined: 25 Jul 2002
Posts: 214
Location: Chicago, IL

PostPosted: Mon Aug 19, 2002 7:46 pm    Post subject: Reply with quote

nitro322 wrote:
I think I might know what your problem is (well, one relating to my suggestion). Check your /etc/passwd and /etc/group files and make sure that both your UID and GID are both 1000. By default, I think Gentoo will assign a user's GID to 100 (the users group). If that's the case, try changing
Code:
/dev/hdh1  /mnt/mov  ntfs  owner,uid=1000,gid=1000,async,ro  0 0
to
Code:
/dev/hdh1  /mnt/mov  ntfs  owner,uid=1000,gid=100,async,ro  0 0

I created a new group for myself for added security/privacy. Does that help?


Ahh works perfectly now.. thanks for much for the help... Although i did notice one thing that is very wacky...

I have NTFS compiled into the Kernel.. and with those added lines in the fstab my NTFS partition are mounted correctly and all the users have the correct access to them... But.. during the bootup.. it does a mod probe and said can't find a certain nls-iso#### module and it fails.. but the NTFS is still loaded and the partitions work perfect.. i just wonder why i'm getting this.. not at my box right now so i can't gie the exact failure.. but i don't see why it's mod probing it...

Wondering why i'm getting this and how can i turn it off.. i only get this with the NTFS partition in the fstab..
Back to top
View user's profile Send private message
felysium
n00b
n00b


Joined: 27 May 2002
Posts: 43
Location: Netherlands

PostPosted: Tue Sep 10, 2002 7:25 pm    Post subject: Reply with quote

compile the right nls kernel module. You can find it under: File Systems --> Native Language Support -->.

Usually the NLS ISO 8859-1 is the one to choose.
Back to top
View user's profile Send private message
vers_iq
Apprentice
Apprentice


Joined: 18 May 2002
Posts: 264

PostPosted: Wed Sep 11, 2002 7:43 pm    Post subject: Reply with quote

Code:
shelt@localsystem default $ cat /etc/fstab
/dev/hda1       /boot           ext3    defaults                1 1

/dev/sdd1       /               ext3    defaults                1 1
/dev/sdd5       /home           ext3    defaults                1 2
/dev/sdd6       /root           ext3    defaults                1 1
/dev/sdd7       /xtra           ext3    defaults                1 2

/dev/sdc5       /usr            ext3    defaults                1 1

none            /proc           proc    defaults                0 0
/dev/sdd2       swap            swap    defaults                0 0

/dev/hdc        /mnt/hdc        iso9660 noauto,ro,user          0 0
/dev/sr0        /mnt/scd        iso9660 noauto,ro,user          0 0

/dev/fd0        /mnt/floppy     auto    noauto,user             0 0

#none           /dev/pts        devpts  gid=5,mode=620          0 0

/dev/sda1       /mnt/int        ntfs    umask=0,ro,user,noauto  0 0
/dev/sdb1       /mnt/ext        ntfs    umask=0,ro,user         0 0
Back to top
View user's profile Send private message
TheEternalVortex
Apprentice
Apprentice


Joined: 15 Oct 2002
Posts: 207
Location: San Jose, CA

PostPosted: Sat Oct 19, 2002 10:43 pm    Post subject: Reply with quote

Hmm, when I try chmoding the mounted file system, I get:
# chmod 555 /mnt/ntfs
chmod: changing permissions of `/mnt/ntfs': Read-only file system

I'd like to be able to have users other than the owner access it, is there any way to do that?
Back to top
View user's profile Send private message
TheEternalVortex
Apprentice
Apprentice


Joined: 15 Oct 2002
Posts: 207
Location: San Jose, CA

PostPosted: Sat Oct 19, 2002 10:48 pm    Post subject: Reply with quote

Oh, actually I did get it to work with a umask=000. Yay.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20053

PostPosted: Wed Jan 01, 2003 7:47 pm    Post subject: Reply with quote

See the first post, I've edited it. Basically, this is a FAQ in need of writing. I've not had anyone mention this thread not covering the necessities, but the information needs to be consolidated into a FAQ. Anyone familiar with the topic willing to write a FAQ? Please post it in this thread.

Thanks.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Matje
l33t
l33t


Joined: 29 Oct 2002
Posts: 619
Location: Hasselt, Belgium

PostPosted: Thu Jan 02, 2003 9:32 am    Post subject: Reply with quote

/dev/hda1 /mnt/fat vfat umask=0007,user,auto,rw,gid=411 0 0
/dev/hdb5 /mp3 vfat umask=0007,user,auto,rw,gid=411 0 0

This is in my fstab. Maybe if I have time I'll write a FAQ but for the time being you'll have to do it with this :). Basically, this enables any user to mount the partitions, it is mounted in read/write mode, the group-id is 411 (a seperate group I created just for fat-partitions) and the umask is 0007, meaning that the person who created the mount (root with automount) and everyone in the group 411 has rwx-access
_________________
Life is like a box of chocolates... Before you know it, it's empty...
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Tue Jan 07, 2003 7:01 pm    Post subject: Reply with quote

I am writting a candidate with all the information from this thread. Hold your breath 8)

EDIT- - Done here
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
tom
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jun 2002
Posts: 83
Location: Guildford, UK

PostPosted: Tue Feb 25, 2003 11:12 pm    Post subject: Reply with quote

You the man, 'Bastard! :P

Seriously, this stuff should be incorporated into the x86 installation guide. I reckon a significant number of those who really NEED the installation guide are dual-booting.

I've been searching for an answer to this problem for AGES now. I can't believe I haven't spotted it in the FAQ before.

tom.
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Wed Feb 26, 2003 11:27 am    Post subject: Reply with quote

Thanks :)

I don't think it is necessary in the install guide, but maybe we could ask to insert a link from the Install Guide to the FAQ (if it hasn' t been done yet).


tom wrote:
You the man, 'Bastard! :P

Seriously, this stuff should be incorporated into the x86 installation guide. I reckon a significant number of those who really NEED the installation guide are dual-booting.

I've been searching for an answer to this problem for AGES now. I can't believe I haven't spotted it in the FAQ before.

tom.

_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
Serengeti
n00b
n00b


Joined: 13 Apr 2003
Posts: 10
Location: Lublin, Poland

PostPosted: Wed Apr 23, 2003 5:29 pm    Post subject: Reply with quote

I think it could be useful for international users to mention the utf8 option. afaik Win 2000 and XP store file names in Unicode to make handling all those strange characters that we Slavs are so proud of 8) easy. On my system it works great, in Nautilus I can see all the Polish names I gave to my Windows files.
_________________
'No, no! Sam, you old ass!' said Frodo.
Back to top
View user's profile Send private message
genesiss
n00b
n00b


Joined: 05 Jul 2003
Posts: 15

PostPosted: Sun Jul 13, 2003 10:14 pm    Post subject: i tried whats on the FAQ Reply with quote

and here is my fstab:
/dev/hda1 /boot ext2 noauto,noatime 1 1
/dev/hda3 / xfs noatime 0 0
/dev/hda2 none swap sw 0 0
/dev/hdc5 /mnt/d vfat defaults,umask=000 0 0
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,owner,ro 0 0
/dev/cdroms/cdrom1 /mnt/cdrom1 iso9660 noauto,owner,ro 0 0

but when i try to mount d it says that it does not exist, i should tell you that hdc5 is an extended partition, which is hdc2
thanks :roll:
Back to top
View user's profile Send private message
gdc34
n00b
n00b


Joined: 29 Mar 2003
Posts: 12
Location: London, UK

PostPosted: Fri Sep 05, 2003 4:07 pm    Post subject: Reply with quote

Probably a bit late, but I think you need to:
cd /mnt
mkdir d

Maybe the fact that you need to create mountpoints should be put into the FAQ?
Back to top
View user's profile Send private message
RedPingüim
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2003
Posts: 82
Location: São Paulo - SP

PostPosted: Mon Sep 08, 2003 5:29 pm    Post subject: Reply with quote

Humm...

This thread is very useful.. :)

I really can't to mount NTFS partitions in non root mode..:-(

But now I'll compile all the tips here and try all them... 8)

Thank you..
_________________
Carlos Vendramini
opera 9 build 1635 (gentoo 2006.0; gentoo-sources-2.6.15-r7, gnome 2.12.2) - Linux user #293485 - Opera Fórum em Português
Back to top
View user's profile Send private message
undrwater
Guru
Guru


Joined: 28 Jan 2003
Posts: 312
Location: Caucasia

PostPosted: Fri Sep 19, 2003 4:43 am    Post subject: Reply with quote

Well...i've gone through all the tips you ppl have given...and i still can't seem to mount and enter vfat partition as a user.

here's my fstab
Code:

/dev/hdc1               /boot           ext3            noauto,noatime          1$
/dev/hdc6               /               ext3            noatime                 0$
/dev/hdc5               none            swap            sw                      0$
/dev/cdroms/cdrom0      /mnt/cdrom      udf,iso9660     noauto,users,ro         0$
/dev/cdroms/cdrom1      /mnt/cdrw       udf,iso9660     noauto,users,ro         0$
/dev/hda1               /mnt/winnt      vfat            umask=000,user,auto,rw  0$
/dev/hda6               /mnt/windows    vfat            umask=000,user,auto,rw  0$


i can mount and enter as root...but not as user.

Another question...after making changes to the fstab...what's the best way to try out the changes?
umount /mnt/winnt mount /mnt/winnt ?

thanks

EDIT
It seems that this did work...but only after a reboot. Strange.
_________________
Open-mindedness is painful...
Back to top
View user's profile Send private message
Will_Angel
n00b
n00b


Joined: 19 Sep 2003
Posts: 61

PostPosted: Wed Sep 24, 2003 10:55 pm    Post subject: Reply with quote

in the faq it says to go to the kernel config and then go to file -> sytem and so on..... how do i get to the kernel config window..????

sorry if its a newb question but i hav no idea.... (trying to enable NTFS)
Back to top
View user's profile Send private message
undrwater
Guru
Guru


Joined: 28 Jan 2003
Posts: 312
Location: Caucasia

PostPosted: Thu Sep 25, 2003 2:37 pm    Post subject: Reply with quote

as root type
Code:
make menuconfig


that'll bring up the menu to configure your menu. save it, then run
Code:
make clean && make bzImage make modules modules_install


then copy your bzImage to your boot directory...hmmm...this has gotten a bit off topic...if you're still unclear, search google for "kernel howto"
_________________
Open-mindedness is painful...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum