# Can't mount my FAT16 hd rw

## Helgiks

I've tried all parameters and options, googling, reading forums, all without luck.

# fdisk -l | grep -A 5 hdb

Disk /dev/hdb: 123.5 GB, 123522416640 bytes

240 heads, 63 sectors/track, 15956 cylinders

Units = cylinders of 15120 * 512 = 7741440 bytes

Disk identifier: 0x0230bec9

   Device Boot      Start         End      Blocks   Id  System

/dev/hdb1  *            1       15955   120619768+   6  FAT16

# grep hdb1 /etc/fstab 

/dev/hdb1		/media/win_disk	auto	rw,user,noauto,utf8	0 0

# mount | grep hdb1

/dev/hdb1 on /media/win_disk type vfat (rw,noexec,nosuid,nodev,utf8,user=helgi)

# touch /media/win_disk     

touch: setting times of `/media/win_disk': Read-only file system

# touch /media/win_disk/file || mkdir /media/win_disk/folder

touch: cannot touch `/media/win_disk/file': Read-only file system

mkdir: cannot create directory `/media/win_disk/folder': Read-only file system

# ls -l /media/win_disk

dr-x------ 1 root root  4096 Mar 14  2006 Downloads

dr-x------ 1 root root  4096 Apr  1 18:20 Music

dr-x------ 1 root root  4096 Mar 31 18:26 Games

dr-x------ 1 root root  4096 Mar 31 18:32 linux

Setting the umask to 000 didn't help either. Anyone see why it shouldn't be rw?

Anything really simple I'm missing here?

----------

## yabbadabbadont

Instead of using "auto" or "vfat" for a FAT16 partition, try using filesystem type "msdos" and see if it helps.

----------

## Helgiks

That didn't work, only gave me:

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

       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so

This is really annoying, what is wrong here?

----------

## lxg

What does cat /etc/mtab say? What if you try mount -o rw,remount /dev/whatever? Can you write to the partition from Windows (assuming you have a dual-boot machine)?

----------

## Helgiks

# grep hdb1 /etc/mtab  

/dev/hdb1 /media/win_disk vfat rw,noexec,nosuid,nodev,utf8,umask=000,user=helgi 0 0

# mount -o rw,remount /dev/hdb1    

# touch /media/win_disk/

touch: setting times of `/media/win_disk/': Read-only file system

# mount | grep hdb1

/dev/hdb1 on /media/win_disk type vfat(rw,noexec,nosuid,nodev,utf8,umask=000)

I am not dualbooting windows, but I am dualbooting slackware from which I can write to that partition without problem.

----------

## lxg

- Maybe the filesystem is damaged, did you try fsck.vfat? 

- Maybe FAT16 isn't supported by your kernel?

- You might also want to check your logs: tail -n 1000 /var/log/messages | grep hdb1

- file -s /dev/hdb1 might also reveal useful information

- Maybe one of the additional mount options hurts, try remounting without them?

And, if nothing else helps, would you consider converting that partition to a different filesystem, maybe FAT32 (or a Linux FS, if you don't use other OSes)?

----------

## Helgiks

# fsck.vfat -v /dev/hdb1

dosfsck 2.11 (12 Mar 2005)

dosfsck 2.11, 12 Mar 2005, FAT32, LFN

Currently, only 1 or 2 FATs are supported, not 0.

What does that mean?

# tail -n 1000 /var/log/messages | grep hdb1 

(nothing)

# file -s /dev/hdb1

/dev/hdb1: x86 boot sector

I'm really starting to think this has something to do with the kernel, even though I did compile it with "VFAT (windows-95) fs support", there is one thing I don't get, I get the following error if I specify the filesystem as vfat or msdos when I mount, can only mount it with "auto"

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

       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so

And looking in to dmesg,

# dmesg | grep hdb1 | sort | uniq (I got that same message like a million times that's why I use uniq)

NTFS-fs warning (device hdb1): parse_options(): Option utf8 is no longer supported, using option nls=utf8. Please use option nls=utf8 in the future and make sure utf8 is compiled either as a module or into the kernel.

VFS: Can't find a valid FAT filesystem on dev hdb1.Last edited by Helgiks on Tue Jun 03, 2008 3:04 pm; edited 1 time in total

----------

## cyrillic

What permissions do you have set on the mountpoint ?

```
# umount /media/win_disk

# ls -l /media/ 
```

----------

## Helgiks

 *cyrillic wrote:*   

> What permissions do you have set on the mountpoint ?
> 
> ```
> # umount /media/win_disk
> 
> ...

 

Owner root:root, permission 755

# ls -l /media

total 8

drwxr-xr-x 4 root root 4096 Jun  1 18:56 ubntemp

drwxr-xr-x 2 root root 4096 Jun  3 02:15 win_disk

----------

## lxg

I think the utf8 warning refers to the utf8 option you provided in the fstab options for this entry. As I suggested, could you temporarily remove those extra options, and remount or reboot? Does your Slackware fstab also have these?

----------

## yabbadabbadont

Make sure that you have the following in your /usr/src/linux/.config:

```
CONFIG_FAT_FS=y

CONFIG_MSDOS_FS=y

CONFIG_VFAT_FS=y

```

----------

## Helgiks

# egrep   "CONFIG_(V?FAT|MSDOS)_FS" /usr/src/linux/.config

CONFIG_FAT_FS=y

CONFIG_MSDOS_FS=m

CONFIG_VFAT_FS=y

# grep hdb1 /etc/fstab && mount | grep hdb1             

/dev/hdb1		/media/win_disk auto		rw		0 0

/dev/hdb1 on /media/win_disk type ntfs(rw)

# touch /media/win_disk/

touch: setting times of `/media/win_disk/': Read-only file system

# ls -l /media/         

total 20

drwxr-xr-x 4 root root  4096 Jun  1 18:56 ubntemp

dr-x------ 1 root root 16384 Apr 14 20:56 win_disk

It seems to be mounted as ntfs now, is that even possible?

The reason for the utf8 option was for the special characters in some of the file names (áéúóæðþö...) and it actually did the trick even with that warning, and yes I think I have that also in slack allso..

EDIT:

Just thought I'd add this, anything relevant to the subject in /var/log, with removed time, than duplicates, some errors there concerning fat and ntfs...

# egrep -i "(hdb1?|v?fat|ntfs)" /var/log/* | sed -e "s/\b\([0-9]\+:\)\{2\}[0-9]\+\b//g" | sort | uniq

/var/log/dmesg:    ide0: BM-DMA at 0x24a0-0x24a7, BIOS settings: hda:DMA, hdb:DMA

/var/log/dmesg: hdb: hdb1

/var/log/dmesg:hdb: 241254720 sectors (123522 MB) w/7965KiB Cache, CHS=16383/255/63

/var/log/dmesg:hdb: IC35L120AVV207-1, ATA DISK drive

/var/log/dmesg:hdb: UDMA/100 mode selected

/var/log/dmesg:hdb: cache flushes supported

/var/log/dmesg:hdb: host max PIO4 wanted PIO255(auto-tune) selected PIO4

/var/log/dmesg:hdb: max request size: 512KiB

/var/log/kern.log:Jun  3  gentoo FAT: Unrecognized mount option "utf8" or missing value

/var/log/kern.log:Jun  3  gentoo FAT: bogus number of reserved sectors

/var/log/kern.log:Jun  3  gentoo NTFS volume version 3.1.

/var/log/kern.log:Jun  3  gentoo NTFS-fs warning (device hdb1): parse_options(): Option utf8 is no longer supported, using option nls=utf8. Please use option nls=utf8 in the future and make sure utf8 is compiled either as a module or into the kernel.

/var/log/kern.log:Jun  3  gentoo VFS: Can't find a valid FAT filesystem on dev hdb1.

/var/log/kern.log:Jun  4  gentoo NTFS volume version 3.1.

/var/log/kern.log:Jun  4  gentoo NTFS-fs error (device hdb1): parse_options(): Unrecognized mount option 0.

Been pulling my hair over this without getting any closer to a solution. Any more suggestions?

----------

## ksp7498

sounds to me like you're missing codepage 437 (the default codepage for vfat).  Unless you manually changed the vfat codepage in the kernel config then you need it.

File Systems ---> Native language support ---> Codepage 437 (United States, Canada)

EDIT: oh it looks like you're trying to use utf8 for it.  I don't know the specifics, but I know that utf8 is not recommended for fat partitions.  what do you have set as the default codepage and default charset for fat in your kernel config?

----------

## Helgiks

 *ksp7498 wrote:*   

> sounds to me like you're missing codepage 437 (the default codepage for vfat).  Unless you manually changed the vfat codepage in the kernel config then you need it.
> 
> File Systems ---> Native language support ---> Codepage 437 (United States, Canada)
> 
> EDIT: oh it looks like you're trying to use utf8 for it.  I don't know the specifics, but I know that utf8 is not recommended for fat partitions.  what do you have set as the default codepage and default charset for fat in your kernel config?

 

# grep -i "CONFIG_FAT" /usr/src/linux/.config

CONFIG_FAT_FS=y

CONFIG_FAT_DEFAULT_CODEPAGE=437

CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"

How could that have anything to do with me not being able to write to the drive? And also I'm not from U.S. nor Canada, I'm from Iceland, and some of the files are named with Icelandic letters which were substituted with question marks until I passed the utf8 option. Still I don't believe that to be an issue since the question mark problem was solved by it, and my problem persists without it.

----------

## ksp7498

 *Helgiks wrote:*   

>  *ksp7498 wrote:*   sounds to me like you're missing codepage 437 (the default codepage for vfat).  Unless you manually changed the vfat codepage in the kernel config then you need it.
> 
> File Systems ---> Native language support ---> Codepage 437 (United States, Canada)
> 
> EDIT: oh it looks like you're trying to use utf8 for it.  I don't know the specifics, but I know that utf8 is not recommended for fat partitions.  what do you have set as the default codepage and default charset for fat in your kernel config? 
> ...

 

alrighty I just thought I'd suggest it.  When I read the thread I remembered one time when I couldn't mount fat partitions even though the module was loaded because I had forgotten the codepage.  I guess your issue is something else.

----------

## Helgiks

Ahh, ok. Well, since I have no idea what causes this, and I haven't used windows for a few years I think I'll just change the file system as a last resort. 

Man that problem has bothered me.

If anyone has a last suggestion they will be welcome and I'll try them tomorrow, if not, than thanks to all of you for your effort trying help me  :Wink: 

----------

## baaann

I think this may be your problem

 *Quote:*   

> # grep hdb1 /etc/fstab 
> 
> /dev/hdb1 /media/win_disk auto rw,user,noauto,utf8 0 0
> 
> 

 

Your log indicates that utf8 option is invalid

 *Quote:*   

> /var/log/kern.log:Jun 3 gentoo FAT: Unrecognized mount option "utf8" or missing value 

 

From this thread the option should be

```
iocharset=utf8
```

If this doesn't work you could try changing your kernel codepage entry from 437 to 861(Icelandic) as per the Wikipedia page

----------

