LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Mounting fat32 in debian (https://www.linuxquestions.org/questions/linux-hardware-18/mounting-fat32-in-debian-704572/)

SuperDude123 02-14-2009 01:46 AM

Mounting fat32 in debian
 
I've tried everything I could find to replace and write in my fstab, and this is what I get when I mount one of the fat32

mount: wrong fs type, bad option, bad superblock on /dev/hdb1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

Also, when I go to see what's in the other fat32, when I do an ls, I see nothing.

Any ideas?

jdkaye 02-14-2009 02:04 AM

Quote:

Originally Posted by SuperDude123 (Post 3443045)
I've tried everything I could find to replace and write in my fstab, and this is what I get when I mount one of the fat32

mount: wrong fs type, bad option, bad superblock on /dev/hdb1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

Also, when I go to see what's in the other fat32, when I do an ls, I see nothing.

Any ideas?

It might be easier to first mount the fat32 drive manually using the mount command. If this works then you can worry about the fstab entry.
Code:

sudo mount -t vfat /dev/hdb1 /mnt
I've used /mnt as the mount point but you can change that if you prefer to mount it somewhere else. If that works then it should be a piece of cake to put the correct entry in your fstab file.
Cheers,
jdk

tothzp 02-16-2009 08:54 AM

First of all, do you have FAT support in your kernel ? Try:
zcat /proc/config.gz | grep -i fat
You should see something like
Code:

...
# DOS/FAT/NT Filesystems
CONFIG_FAT_FS=m
CONFIG_VFAT_FS=m
...

I use the automounter to mount e.g. pendrives with FAT.
After installing the autofs package, put this into your /etc/auto.master:

Code:

/mnt/auto        /etc/auto.mnt        --timeout=10
and this to your /etc/auto.mnt:
Code:

fat        -fstype=vfat,rw        :/dev/hdb1
mkdir -p /mnt/auto, then restart autofs, and you should be able to access the partition under /mnt/auto/fat.

You also may run mmls /dev/hdb to see partition data.
(it's part of the sleuthkit package)

SuperDude123 02-16-2009 09:40 AM

When I do zcat /proc/config.gz | grep -i fat, I get

zcat: /proc/config.gz: No such file or directory

Could it be a different file in Debian?

jdkaye 02-16-2009 09:48 AM

Quote:

Originally Posted by SuperDude123 (Post 3445591)
When I do zcat /proc/config.gz | grep -i fat, I get

zcat: /proc/config.gz: No such file or directory

Could it be a different file in Debian?

I don't have it either (in Debian) but I can and have mounted FAT devices.
cheers,
jdk

tothzp 02-17-2009 03:45 AM

/proc/config.gz is just a handy thing to build into the kernel, thereby it's easy to get the config of the running kernel.
It just stores your .config file in the kernel image.

It can be configured under General / Kernel .config support in the kernel configuration menus.

Nevertheless, that is not necessary for the FAT support.

If your fat support is built as a kernel module, then you might find some clues on it by typing modinfo vfat.
If it's built into the kernel monolithically, then this is no way to go.

As a last resort, you can build a kernel on your own, then configure the .config support (as above) and the VFAT support under Filesystems / DOS/FAT/NT Filesystems.

SuperDude123 02-17-2009 12:43 PM

When I did

sudo modinfo vfat

I got:

filename: /lib/modules/2.6.18-6-486/kernel/fs/vfat/vfat.ko
license: GPL
description: VFAT filesystem support
author: Gordon Chaffee
vermagic: 2.6.18-6-486 mod_unload 486 REGPARM gcc-4.1
depends: fat

So how do I get the system to mount the hard drive automatically? Can automounter be installed on Debian?

tothzp 02-18-2009 03:54 AM

Well, it appears that your kernel supports VFAT.

Quote:

Originally Posted by SuperDude123 (Post 3447221)

So how do I get the system to mount the hard drive automatically? Can automounter be installed on Debian?

It's in the package autofs.
Install with apt-get install autofs.

Then write the config files as I wrote above.
If you modify auto.master, you have to restart the automounter:

cd /etc/init.d
./autofs restart

therealola 08-14-2014 07:05 AM

Write something like this in the fstab:
/dev/sda8 /media/myfat vfat user,auto 0 0

Or you can do:
UUID=abcd-1234 /media/myfat vfat user,auto 0 0
You need to replace abcd-1234 with the UUID of the partition to be mounted. You can find this by running the command blkid.

Randicus Draco Albus 08-14-2014 08:02 AM

I am sure the OP is still waiting for an solution five years later.


All times are GMT -5. The time now is 08:04 AM.