Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
UN2: Mounting MS Windows partitions (FAT,NTFS)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Frequently Asked Questions
View previous topic :: View next topic  
Author Message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7731
Location: Underworld

PostPosted: Tue Jan 07, 2003 8:00 pm    Post subject: UN2: Mounting MS Windows partitions (FAT,NTFS) Reply with quote

Navigation: [Uncategorized] [Table of Contents]


Symptoms:

Cannot mount a Windows (tm) partition, or just root can access a mounted partition.

Solution:

Step 1 Build a kernel with support to your Windows (tm) file systems

There are two main types of Windows (tm) partitions: NTFS and FAT-based. The first step is to compile the file system support for these in your kernel or as modules.

In the kernel configuration menus, go to File Systems and enable:

Code:

...
<*> DOS FAT fs support
<*> MSDOS fs support
...
<*> VFAT (Windows-95) fs support
...
<*> NTFS file system support (read only)
...


Compile also the Native Language Support (usually ISO 8859-1) in Native Language Support.


It is very important not enabling write support for NTFS, as it is DANGEROUS. These are recommended settings, if you are sure you do not need some of these, feel free not to select them. You can also build them as modules. Compile and install your new kernel and modules, reboot your computer and you are ready for the next step.


Step 2 Setting your /etc/fstab

Considering that your Windows (tm) partition is on /dev/hda1 and it is a FAT32 partition, the basic configuration for your /etc/fstab should be:

Code:

/dev/hda1   /mnt/c   vfat   defaults   0 0


where /dev/hda1 is the partition, /mnt/c the mountpoint where the partition will be available after mounting, vfat is the file system type, defaults is the option to be passed to mount, and 0 0 is related to file system integrity test (no test with 0 0). This will allow only root to enter, read or write /mnt/c or its contents. If you want to allow only a given user/group to access it, use the options uid and gid:

Code:

/dev/hda1   /mnt/c   vfat   defaults,uid=510,gid=610 0 0


will mount /mnt/c for the user with user id 510, and will set the group id for 610. But the default group permission is read-only, so users of the same group cannot enter the directory (because it is not set executable).

:!: Options like "defaults,uid=510,..." are only separed by ",". A space or a tab will give a message like:

Quote:

[mntent]: line 16 in /etc/fstab is bad
mount: can't find /mnt/c in /etc/fstab or /etc/mtab


You can change permissions using the parameter umask. But be aware that it must be the bitmask of permissions that are not present for the mountpoint. It is an octal number, formed like this:

:arrow: first digit: permissions for everybody
:arrow: second digit: group permissions
:arrow: third digit: user permissions

The modes are as follows (the first column is the mode octal number):

Quote:

M | R W X
--------------------
0 | * * *
1 | * * -
2 | * - *
3 | * - -
4 | - * *
5 | - - *
6 | - * -
7 | - - -


For example, if you want that everybody be able to read, write, and execute every file in your /mnt/c, you should specify the mask 000:


Code:

/dev/hda1   /mnt/c   vfat   defaults,umask=000    0 0


If you want that only users from group 610 be able to read, write, and execute:

Code:

/dev/hda1   /mnt/c   vfat   defaults,gid=610,umask=707    0 0


If you want that only users from group 610 be able to read, and execute (not write):

Code:

/dev/hda1   /mnt/c   vfat   defaults,gid=610,umask=727    0 0


If you have a NTFS partition, change vfat to ntfs and add ro (read-only) to the option line:

Code:

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

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


Joined: 07 Aug 2002
Posts: 7731
Location: Underworld

PostPosted: Wed Jan 08, 2003 6:54 pm    Post subject: Reply with quote

Please forward comments to this thread.
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Frequently Asked Questions All times are GMT
Page 1 of 1

 
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