# [FAQF] UN3: mounting Windows partitions (FAT, NTFS)

## davidblumberg

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?

----------

## nitro322

This is my fstab entry for an NTFS partition:

```
/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:

```
#!/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.

----------

## davidblumberg

Thank you. Normal user can now enter my Ntfs parition.

----------

## clubbabyseals

excellent... the answer to my problem right when i needed it... 

thanks.

----------

## Mandr4ke

Alternatively, you could write a shell script to mount the drive and change permissions all at once:

```
#!/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??

----------

## nitro322

 *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.

----------

## Mandr4ke

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.

```

/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

```

/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

```

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!!

----------

## nitro322

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 

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

 to 

```
/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?

----------

## Mandr4ke

 *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 
> 
> ```
> /dev/hdh1  /mnt/mov  ntfs  owner,uid=1000,gid=1000,async,ro  0 0
> ```
> ...

 

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..

----------

## felysium

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.

----------

## vers_iq

```
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

```

----------

## TheEternalVortex

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?

----------

## TheEternalVortex

Oh, actually I did get it to work with a umask=000. Yay.

----------

## pjp

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.

----------

## Matje

/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  :Smile: . 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

----------

## pilla

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

EDIT- - Done here

----------

## tom

You the man, 'Bastard!   :Razz: 

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.

----------

## pilla

Thanks  :Smile: 

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!  
> 
> 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.
> ...

 

----------

## Serengeti

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  :Cool:  easy. On my system it works great, in Nautilus I can see all the Polish names I gave to my Windows files.

----------

## genesiss

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  :Rolling Eyes: 

----------

## gdc34

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?

----------

## RedPingüim

Humm...

This thread is very useful..  :Smile: 

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

But now I'll compile all the tips here and try all them...  :Cool: 

Thank you..

----------

## undrwater

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

```

/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.

----------

## Will_Angel

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)

----------

## undrwater

as root type

```
make menuconfig
```

that'll bring up the menu to configure your menu. save it, then run

```
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"

----------

## k:arel

Is it possible that, after recompiling my kernel with the needed modules (see the FAQ file about mounting Windows partitions) set (*),

gentoo still says that the type ntfs is not supported?

also my navite language support is set alright

my /etc/fstab file:

```

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/hda7      /boot      ext3      noauto,noatime      1 1

/dev/hda10      /      reiserfs   noatime         0 0

/dev/hda8      none      swap      sw         0 0

/dev/hda9      home      reiserfs   noatime         0 0

/dev/cdroms/cdrom0   /mnt/cdrom   iso9660      noauto,ro      0 0

#WINDOWS MOUNTS

/dev/hda1      /mnt/C      ntfs      defaults,ro      0 0

/dev/hda2      /mnt/D      ntfs      defaults,ro      0 0

/dev/hda5      /mnt/E      ntfs      defaults,ro      0 0

/dev/hda6      /mnt/F      ntfs      defaults,ro      0 0

/dev/hdb      /mnt/G      vfat      defaults      0 0

```

all the in /mnt mentioned directories exist

mounting the partitions manually gives:

```
mount: fs type ntfs not supported by kernel
```

----------

## k:arel

actually, after changing all these options in my kernel, i'm also unable to mount floppy's because "the file system type is unknown"

----------

## echo6

I've compiled ntfs and ntfs write support but I'm getting an error of "permission denied" when trying to write to a mounted ntfs partition.

OK I appreciate that ntfs write support under 2.4 is experimental,  but that's exactly what I want to do!

I've got a USB2 external hard drive with a ntfs partition and want to expeiiment some.   After enteting 

```
mount -t ntfs -o owner,uid=1000,gid=100,async,rw /dev/sda2 /mnt/ntfs
```

 I'm still getting this error.

----------

## evilTone

my  10pence worth, appears to work ok

```

/dev/hdc1               /boot           ext2            noauto,noatime          1 1

/dev/hdc3               /               ext3            noatime                 0 0

/dev/hdc2               none            swap            sw                      0 0

/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro,user          0 0

/dev/hda1               /mnt/windows    ntfs            umask=000,ro            0 0

/dev/hdc4               /mnt/win2       vfat            umask=000,ro            0 0

```

----------

## StuRReaL

i've been trying to do this, but why do i have no directories in my /mnt directory?

----------

## JusKickNit

 *StuRReaL wrote:*   

> i've been trying to do this, but why do i have no directories in my /mnt directory?

 

You have to make them with the "mkdir" command.

I have a question did the unmask and uid change for 2.6. My fat fstab line is.

/dev/hda2 /mnt/hda2 vfat auto,rw,uid=1000,unmask=1000 0 0 

All works good under the 2.4 series, but 2.6 returns this error

mount: wrong fs type,  bad option,  bad superblock on /dev/hda2

or too many mounted file systems

If I take the uid and unmask out it mount's fine.

Thanks Wes

Man I'm an idiot it's umask not unmask. Weird that it worked on 2.4 though. Im going to leave this here just incase somebody else make's the same mistake.

----------

## StuRReaL

Thats cool at least i know now  :Smile:  just a couple more questions. After having some issues with Windows and having to reinstall and me breaking my Gentoo install (oops) I decided to install mandrake to see how it does its FSTAB.

Its interesting  :Smile: 

1) auto = This is auto detect FS type correct?

2) supermount = ? what is this is this auto mounting when a CD is inserted into the drive?

----------

## JusKickNit

Mandrake uses the kernel supermount patch. Yea it's auto mount when a cd is put in. You can use that on Gentoo alot of the kernel's have patches for it.

----------

## KCat

How would I go about making my mounted partitions readable by all but only writeable by an arbitrary set of users (or at least just root/superuser)?

----------

## substance

i cant seem to get this NTFS drive to mount.... but i can get my other ntfs drive (scsi) to mount

this is my fstab (notice how my scsi drive isnt even in there but it mounts fine)

```

/dev/hde1               /boot           ext2            noauto,noatime          1 2

/dev/hde3               /               ReiserFS        noatime                 0 1

/dev/hde2               none            swap            sw                      0 0

/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro,user          0 0

/dev/hda1               /mnt/Data       ntfs            auto,rw                 0 0

```

and this is the error i get

```

bash-2.05b# mount /mnt/Data

mount: wrong fs type, bad option, bad superblock on /dev/hda1,

       or too many mounted file systems

```

ive tried every combination  of commands possible, and even without it being in fstab, but i get the same error... why cant i mount this ntfs drive but  i can mount my other?

----------

## timbo

 *JusKickNit wrote:*   

> 
> 
> I have a question did the unmask and uid change for 2.6. My fat fstab line is.
> 
> /dev/hda2 /mnt/hda2 vfat auto,rw,uid=1000,unmask=1000 0 0 
> ...

 

I'm glad someone else is having the same problem as me, I've not found a workaround yet.....

Regards

Tim

 :Cool: 

----------

## substance

i figured it out... the damn drive wasnt formated with any filesystem ahhaa

----------

## wlawee

 *undrwater wrote:*   

> as root type
> 
> ```
> make menuconfig
> ```
> ...

 

Newbie here needs some help. 

I already compiled my kernel but forgot to choose FAT32 support. I'm trying to mount a FAT32 drive. How do I recompile my kernel? I originally compiled it off my LiveCD.

----------

## deepwave

Just redo the steps that you did to compile the kernel...

make menuconfig (/usr/src/linux)

make modules && make modules_install && make install

The last does the bzImage, copys it to /boot and updates your lilo and grub entries.  :Wink: 

----------

## zoid

Hope someone can help me out with this.  I can mount and browse the partition without any problems but am unable to write to it.

Konquerer reports:

```
cannot write to /mnt/stuff/filename
```

Trying from a terminal (as myself or root) returns:

```
cp: cannot create regular file `/mnt/stuff/Progs/simpguestl.xls': Read-only file system
```

My fstab entry is as follows:

```
/dev/hda7   /mnt/stuff   vfat   defaults,umask=000,rw   0 0
```

----------

## dmitrio

I have copied this, with permission of Pilla, to gentoo-wiki.com

http://gentoo-wiki.com/HOWTO_Mount_MS_Windows_partitions_(FAT%2CNTFS)

If you see anything that should be added or changed, feel free to do so.

Thank you for a great HOWTO.

----------

## ighost

i don't want to recompile my kernel, is there a way to, say, modprobe ntfs support into it?

----------

## fdarling

I have this line in my fstab, and it works great! I have used other lines, but i dont remember what they were. They all contained "ro" for read only in the options, and "exec" for execute to enter folders, and "umask=###". they some either had "user" or "users" in the options.... but they all have "ro, exec, umask=###" i remember a few different umasks would work though. Anways hers my line:

```
/dev/hda1        /mnt/windows        ntfs        user,exec,umask=022,ro        0 0
```

^^^ that isnt the ONLY line you can use, but for sure that line will work!  :Smile: 

----------

## Igghibù ZwfanDir

Hy ppl , i cannot write in my FAT32 partition from any user (root included) even if i gave the umask=000 to my fstab line (which follow) :

/dev/hda3    /mnt/data    vfat   defaults,umask=000  0 0

the error that i get is : "reading only file  system"  (i get the same error if try to change the permissions  :Sad:  )

TIA

EDIT:  SOLVED SOLVED SOLVED SOLVED SOLVED SOLVED

take a look at this post

----------

## johnnyICON

Hi, I am having troubles with mounting my NTFS partitions. I just want to be able to access the drives, especially because it has all my music and videos on them.

My UserID is 1000 so I put this into fstab:

```
/dev/hda1               /mnt/iCore      ntfs            defaults,ro,uid=1000    0 0

/dev/hda2               /mnt/iPrograms  ntfs            defaults,ro,uid=1000    0 0

/dev/hda3               /mnt/iJunk      ntfs            defaults,ro,uid=1000    0 0

/dev/hdb1               /mnt/iDrive     ntfs            defaults,ro,uid=1000    0 0

```

I restarted X and when I try to enter it displays this error message:

Could not enter /mnt/iPrograms

Any suggestions?

----------

## jellyman

this is what worked for me:

```
/dev/hda1 /mnt/windows/c ntfs user,exec,ro,umask=000 0 0

/dev/hda2 /mnt/windows/d ntfs user,exec,ro,umask=000 0 0
```

----------

## kootenaykid

I have seen other remarks about this, but have not found a solution.  I can mount my fat32 partition as msdos, but not as vfat.  If I try vfat I get,

```
mount: wrong fs type, bad option, bad superblock on /dev/hdb7,

or too many mounted file systems
```

.

There are some hints that this might be a problem with kernel 2.6.8, but I haven't found anything decisive.  Does anyone know what is gioing on here?  I would really like to have my long file names.

----------

## kootenaykid

Once again I have missed something stupid and this was simple.  I guess thats why they call me n00b.

I was missing a kernel module:

```
File Systems ----->

     ----->Native Language Support

                 (iso8859-1) Default NLS Option

                  <M>      Codepage 437

                                     :

                                     :

                  <M>      NLS ISO 8859-1             <--this was missing
```

----------

## jose_zap

No matter why i do, i still can't mount my ntfs partition as a normal user. Here is my fstab:

```

# /etc/fstab: static file system information.

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $

#

# noatime turns off atimes for increased performance (atimes normally aren't

# needed; notail increases performance of ReiserFS (at the expense of storage

# efficiency).  It's safe to drop the noatime options if you want and to

# switch between notail and tail freely.

# <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/hda2               /boot           ext2            noauto,noatime          1 2

/dev/hda4               /               reiserfs        noatime,notail          0 1

/dev/hda3               none            swap            sw                      0 0

/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro               0 0

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

/dev/hda1               /mnt/windows    ntfs            noauto                  0 0

/dev/hdc1               /mnt/esclavo    ntfs            noauto,user,umask=000   0 0

```

By the moment I only want to acces as user the /dev/hdc1 partition. I need help PLEASE!!!   :Crying or Very sad:  [/quote]

----------

## andrewd18

 *kootenaykid wrote:*   

> Once again I have missed something stupid and this was simple. I guess thats why they call me n00b.
> 
> I was missing a kernel module: 
> 
> ```
> ...

 

YAY! That fixed my problem! Thank you!

~~ Andrew D.

----------

## Stolz

And old post, I know but What about updating this FAQ adding ntfs-3g info?

----------

