# Problems with fat32 and NTFS

## tobox

I suppose this is a little dumb.

However I can't make my system rw access when mounting NTFS or fat32.

And if I read directly from a external harddisk in program say cplay.

It crashes.

Somebody who could help me, I am quite sure that I did add ntfs support in the kernel (2.6.36-r5 from gentoo-sources)

What could this problem be.

can I emerge something to help this problem ?

----------

## gerard27

It's probably your kernel config.

In menuconfig go to File System > DOS/FAT/NT Filesystems.

Enable what you need and recompile and install.

Gerard.

----------

## tobox

No possibility that it could be ntfs3g that I didn't emerge ??? 

I would really like to avoid installing a new kernel for now.

----------

## gerard27

No.

ntfs3g is only for ntfs.It won't help with fat.

If you want to mount Windows partitions you'll need it.

Read the contents of the ntfs3g ebuild:you will need "fuse" enabled in the kernel.

Gerard.

----------

## tobox

Okay so what would be the easiest way for me to build the new kernel. I would prefer something akin to genkernel  :Very Happy: 

----------

## gerard27

I 've never used genkernel but I think you can do something like

```

genkernel --menuconfig
```

Consult the docs please.

This may be a good time to dive into kernel configuring without genkernel.

The result will be a leaner kernel.

Gerard.

----------

## tobox

Yeah just I had a little problem earlier with that /boot wouldn't mount...

Besides that I am good to go, which doc is that I should at least look at for the general tricks after I have configured the kernel, I am not sure what to do so I would like to have a doc to follow at least partly...  :Very Happy: 

Besides I am just merging the mplayer and waitting for a download to finish.  :Very Happy: 

----------

## tobox

The problem is more specific that I used ext2 for the boot (It probably got a little big as I just took 1G for it, as I thought I have plenty of space.)

and now when I try to use 

mount /boot as root 

unknown filesystem type 'ext2'

so what can I do about this ?

----------

## tobox

Well 

To clarify my problem I can mount a ntfs or fat32 (I think it recognizes fat32 as ntfs and ntfs as ntfs) 

I can technically mount them to a point in /mnt and I can do /mnt/disk (if disk is where I mounted it)

and then I can ls and stuff however I can't do anything like mkdir touch or anything it says I cannot write to it, and reading from it doesn't really work either.

However my kernel has every form for ntfs support under 

file system ->

    MSDOS/Microsoft (don't recall the exact name) ->

and everything is checked and I have compiled that in the kernel.

I really can't understand that 

________

on a sitenote I should mention that my /boot is ext 2 which I have no support for in my kernel :S

Greetings

----------

## TJNII

You're going ot have to use a livecd to fix this.

Boot into the livecd, and mount your root disk.  chroot into the root disk.  You can then mount /boot and perform any other needed steps.  You do not need to bind mount /dev, /sys, and /proc for this as long as you only try and fix your kernel.

Make sure you have rebuild your kernel with ext2 support.

----------

## DONAHUE

http://en.gentoo-wiki.com/wiki/NTFS-3G while following the guide add ext2fs support in your kernel 

File systems  ---> 

 <*> Second extended fs support

[*]   Ext2 extended attributes

[*]     Ext2 POSIX Access Control Lists

[*]     Ext2 Security Labels

----------

## tobox

Yeah but I can't mount the /boot to write the new kernel to it, ???

----------

## tobox

Anyway that seems to be a project for tomorrow I am too sleepy right now...

----------

## DONAHUE

boot cd and enter the chroot as you did during the install, nominally:

```
mount /dev/sda3 /mnt/gentoo

mount /dev/sda1 /mnt/gentoo/boot

mount -t proc none /mnt/gentoo/proc

mount -o bind /dev /mnt/gentoo/dev

chroot /mnt/gentoo /bin/bash

env-update

source /etc/profile

export PS1="(chroot) $PS1"

cd /usr/src/linux

make menuconfig
```

do your edits

```
make && make modules_install

cp arch/x86/boot/bzImage /boot/<your kernel name>

exit

reboot
```

----------

## NeddySeagoon

DONAHUE,

Thats a bit long winded.  Rebuild the present kernel with ext2 as <M>

```
make modules && make modules_install
```

 will do.

```
modprobe ext2
```

Now you can mount /boot

----------

## tobox

Well the modules thing made an error in the end 

which means that no of the modules are available... 

So I can't use the module stuff.

Hmm I am gonna have to wait a little longer for the booting into the install cd and that...

Having a chess match in not so long that I have to be kind of ready for  :Very Happy: 

----------

## toralf

 *DONAHUE wrote:*   

> add ext2fs support in your kernel 

 Why is ext2 needed for ntfs-3g ?

@tobox

Take a look at the user/group/umask parameter in /etc/fstab, eg. thist works for me :

```
tfoerste@n22 ~ $ grep ntf /etc/fstab 

/dev/sda1       /mnt/C          ntfs            noauto,user,noatime,uid=tfoerste,gid=users,umask=0027,ro 

/dev/sda2       /mnt/E          ntfs-3g           auto,user,noatime,uid=tfoerste,gid=users,umask=0022,locale=en_US.utf8 
```

----------

## tobox

well the ext2 is just for the /boot partition. Not really the ntfs - however I don't see anything in the fstab that is just my dvd-drive and my internal harddisk, the ntfs ones are external ones...

That is I want to be able to do mount /dev/sdb1 /mnt/mountpoint 

without hassle and then be able to write to the file.

----------

## toralf

Ah - ok. But what's about specifying the options on the command line which should solve your problem, isn't it ?

----------

## NeddySeagoon

toralf,

By default, ext2 is off in the kernel .config but when you do your install, the liveCD has ext2 available so you can mount your ext2 /boot and install your own kernel that has ext2 support missing.

This all works until you need to update your kernel and find you can no longer mount /boot to copy the kernel over.

As well as making ext2 for the old kernel, provided the new kernel build location is on ext2/3/4 you can boot the new kernel from the kernel build location by pressing 'e' at the grub splash screen can editing the kernel line.

You can't edit grub.conf because you can't mount /boot

----------

## tobox

I suppose the two of you solve different problems. 

Toralf I have not really got anything I know of to help solve anything regarding mounting ntfs or fat I tried to do it as vfat, as I supposed it was a fat32 but that didn't work as it said that it were a ntfs volume.

__

As for how exactly do I boot the new kernel from the grub menu ? 

pressing 'e' but what do I tell to do after that ?

???

----------

## toralf

Well, from what I understood, you like to mount a NTFS and/or FAT volume, right ? Then you probably need this in your kernel :

```
CONFIG_FUSE_FS=m

...

#

# DOS/FAT/NT Filesystems

#

CONFIG_FAT_FS=m

CONFIG_VFAT_FS=m

CONFIG_FAT_DEFAULT_CODEPAGE=437

CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"

CONFIG_NTFS_FS=m
```

and probably this is good too : 

```
#

# Partition Types

#

CONFIG_MSDOS_PARTITION=y

CONFIG_NLS=m

CONFIG_NLS_DEFAULT="utf8"

CONFIG_NLS_CODEPAGE_437=m

CONFIG_NLS_CODEPAGE_850=m

CONFIG_NLS_ISO8859_1=m

CONFIG_NLS_ISO8859_15=m

CONFIG_NLS_UTF8=m

```

Furthermore sys-fs/ntfs3g and sys-fs/ntfsprogs are helpful packages.

----------

## DONAHUE

 *Quote:*   

> As for how exactly do I boot the new kernel from the grub menu ?

  If you copied the kernel to /boot with the same name, the boot process is unchanged. Down arrow to the menu choice and <Enter>.

 If you copied the kernel to /boot with a new name and changed the name to match in grub.conf, the boot process is unchanged. Down arrow to the menu choice and <Enter>.

if you copied the new kernel with a new name but did not change grub.conf; when the grub menu appears:

Down arrow to the menu item

e

down error to the kernel line

e

edit the kernel line to reflect the new name

<Enter>

b

----------

## tobox

The problem I have as to understand all of this is that I cannot mount the /boot, so I can't edit the grub.conf, but can I write a kernel image to the /boot (and why is it that I have to mount the /boot partition to edit it ???)

Well I am not clear on these things, also I am a bit tired after that chess match today.

----------

## NeddySeagoon

tobox,

At the grub splash screen press e to edit in the in memory copy of the grub.conf

Edit the kernel line, which will say something like

```
kernel /boot/2.6.37-gentoo root=/dev/md5 vga=0x317 video=vesafb:mtrr:3,ywrap
```

To fetch the kernel from the build location.

So you might want something like

```
kernel (hd0,2)/usr/src/linux/arch/x86/boot/bzImage root=/dev/md5 vga=0x317 video=vesafb:mtrr:3,ywrap
```

Put the full path to the bzImage file - including the partition in grubspeak.  Do not copy my kernel parameters - use your own, unchanged.

--- edit ---

You cannot change the content of /boot at all as your running kernel is missing ext2 support.

The cp arch/x86/boot/bzImage /boot/<kernel> runs but does not copy the kernel to the boot partition.  It goes into the /boot directory on root. Grub will not look there for the kernel.

When you get this fixed, do ls /boot with and without boot mounted. When boot is not mounted ls -l /boot should contain no files.

----------

## tobox

Nice then I can get to build that new kernel (I suppose it would have been smarter to just add the ext2 support while building the first kernel during the installation.. ?

----------

## tobox

 *toralf wrote:*   

> Well, from what I understood, you like to mount a NTFS and/or FAT volume, right ? Then you probably need this in your kernel :
> 
> ```
> CONFIG_FUSE_FS=m
> 
> ...

 

Yeah I would like to do that.

Well thanks now I can also get to use the kernel with the support  :Very Happy: 

----------

## NeddySeagoon

tobox,

If you had made ext2 support for your first kernel this mounting /boot probem would not have happened.

For FAT filesystem, FAT12, FAT16 and FAT32, you need vfat support in the the kernel.

For NTFS, the kerbel support is not complete - it does not provide NTFS write support.

Instead of the kernel NTFS, use File Systems In Userspace (FUSE) in the kernel and emerge ntfs3g

----------

## tobox

Yeah I get that much however I can't seem to make ntfs3g work probably however I got the fuse module installed now  :Very Happy: .

Now I just need to configure fuse (is that something to do with the plugdev group ???)

I don't really know this.

I should probably look for a gentoo guide for it.

----------

## tobox

Heya now it works I can write to the ntfs filesystem using ntfs-3g and I can also do that as my regular user  :Very Happy: 

Nice  :Very Happy: 

Thanks a lot now I think most of the issues has been worked out so now I am really satisfied with this gentoo stuff  :Very Happy: 

Like every distro got such nice forums for support. Ubuntu and gentoo (that would be those I used most)

and lots of people helping newb's like me  :Very Happy: 

----------

## tomk

Merged from here as it's the same problem.

----------

