LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-05-2007, 04:13 PM   #1
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Rep: Reputation: 15
Mounting FAT fs on usb stick


'mount -t vfat /dev/sda1 /mnt/usbstick' is not working.

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

how do i get my usb flash mounted as fat fs?
 
Old 05-05-2007, 04:21 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Flash storage doesn't usually have a partition table, so try mounting the entire device:

mount -t vfat /dev/sda /mnt/usbstick
 
Old 05-05-2007, 04:22 PM   #3
manwichmakesameal
Member
 
Registered: Aug 2006
Distribution: Slackware
Posts: 804

Rep: Reputation: 110Reputation: 110
You have to make sure you have support for FAT filesystem enabled in the kernel. Which kernel are you using? If it's a 2.6 the you should have something like:
Code:
/dev/sdf1        /mnt/sandisk     vfat        noauto,user,rw   0   0
in your /etc/fstab if you don't want to have to manually mount it every time. And the directory you are mounting it at has to exist.
 
Old 05-05-2007, 04:22 PM   #4
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
the same error
 
Old 05-05-2007, 04:28 PM   #5
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by manwichmakesameal
Which kernel are you using?
Where can i see that?
 
Old 05-05-2007, 05:00 PM   #6
LazyP
Member
 
Registered: Jun 2005
Location: Athens GR
Distribution: Slackware 10.2
Posts: 43

Rep: Reputation: 15
You can see your kernel release by issuing the command: uname -r. You can "man uname" for more info.
 
Old 05-05-2007, 05:05 PM   #7
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
kernel version: 2.4.33.3
 
Old 05-05-2007, 05:17 PM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
It could be the case that the filesystem on the pendrive is bad.

Code:
# file -s /dev/sdb1
/dev/sdb1: x86 boot sector, Microsoft DOS Bootloader, code offset 0x3c, OEM-ID "!CQ+GIHC", sectors/cluster 32, root entries 512, Media descriptor 0xf8, sectors/FAT 123, heads 16, hidden sectors 233, sectors 999703 (volumes > 32 MB) , serial number 0x3b691afd, unlabeled, FAT (16 bit)
hpamd64:~ # fdisk -l /dev/sdb

Disk /dev/sdb: 512 MB, 512483328 bytes
16 heads, 63 sectors/track, 993 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         992      499851+   6  FAT16
 
# udevinfo  -q env -n /dev/sdb1
ID_VENDOR=SanDisk
ID_MODEL=Cruzer_Mini
ID_REVISION=0.1
ID_SERIAL=SanDisk_Cruzer_Mini_SNDK4F87642EAA601103
ID_TYPE=disk
ID_BUS=usb
ID_PATH=pci-0000:00:02.2-usb-0:2:1.0-scsi-0:0:0:0
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT16
ID_FS_UUID=3B69-1AFD
ID_FS_LABEL=
ID_FS_LABEL_SAFE=

# fsck.vfat /dev/sdb1
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
/dev/sdb1: 1388 files, 2116/31232 clusters
hpamd64:~ # cat /etc/fstab
...
/home/openSUSE-10.2-GM-DVD-x86_64.iso /SUSE102             iso9660    ro,unhide,loop=/dev/loop1,user 0 0
/dev/hda1       /windows                ntfs    rw,noauto,user,nls=utf8,uid=jschiwal,gid=jschiwal,user  0 0
UUID=b545812a-57af-43e8-bbd8-f9b43dd25fc8       /mnt/nd2                xfs     defaults,user,noauto            0 0
UUID=3B69-1AFD  /media/Cruzer vfat rw,noauto,nosuid,nodev,noatime,uid=1000,utf8,shortname=lower,user 0 0
You may not have hal support on your system. On my 2.6 system, I find using the uuid number instead of the device to be better because the next time you insert the usb pendrive, it could have a different device number, depending on the other devices plugged in, the order they are plugged in and the port used.

I would change the above advice to:
Code:
/dev/sdf1        /mnt/sandisk     vfat        noauto,user,uid=<yourusername>,gid=<yourgroupname>,fmask=0117,dmask=0007,noatime,rw   0   0
The "user" option will allow the user who matches the "uid=" value to mount the drive as a normal user. The "uid=" value will make the user the owner of the partition when mounting.

Using "users" will allow any user to mount the device. So the choice is yours.

Last edited by jschiwal; 05-05-2007 at 05:32 PM.
 
Old 05-05-2007, 05:18 PM   #9
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
i can mount flash by making it's fs to ext3 or ext2, but it's not working with vfat
 
Old 05-05-2007, 05:25 PM   #10
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
i have ext3 fs on flash, how can i change it to fat16(as yours)?
 
Old 05-05-2007, 05:40 PM   #11
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
Code:
root@localhost:~# file -s /dev/sda1
/dev/sda1: Linux rev 1.0 ext3 filesystem data
root@localhost:~# fdisk -l /dev/sda

Disk /dev/sda: 132 MB, 132120576 bytes
5 heads, 51 sectors/track, 1011 cylinders
Units = cylinders of 255 * 512 = 130560 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1011      128877    6  FAT16
I guess there is a problem?
 
Old 05-05-2007, 07:51 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Did you format the pendrive yourself, or is it as it was when you purchased it?

If it is the later, it probably has the the fat16 filesystem, but the partition type byte may have been altered somehow. You could use fdisk to change the type from 83 to 6.
 
Old 05-05-2007, 08:09 PM   #13
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
flash drive has been changed. i used dd to wipe all to zeros, and then reformated flash to fat, but it's not working anymore.

I changed partition type to 6.
Now i can mount drive using:
Code:
mount /dev/sda1 /mnt/usbstick
But the code
Code:
mount -t vfat /dev/sda1 /mnt/usbstick
returns error message

Last edited by K05T9; 05-05-2007 at 08:34 PM.
 
Old 05-05-2007, 09:03 PM   #14
K05T9
Member
 
Registered: Nov 2006
Location: Latvia
Distribution: Slackware 11.0
Posts: 49

Original Poster
Rep: Reputation: 15
there are some other problems:
1) i can't see any files by opening flash drive from explorer
2) i can write just about 110mb in the flash(not 128, as it used to be)
3) why is it still blinking, when i use 'safely remove hardware'?

Last edited by K05T9; 05-05-2007 at 09:11 PM.
 
Old 05-05-2007, 10:59 PM   #15
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I may have missed one of your posts. If you can mount it, then you have the filesystem. Sometimes using "auto" for the filetype, the right one is selected. If you can see files in it, run "mount" by itself and see what filesystem was used.

Code:
/dev/hda5 on /boot type ext3 (rw,acl,user_xattr,debug,acl,user_xattr)
Then you could check the filesystem after umount'ing it.
In this case, I would use "sudo /sbin/fsck.ext3 /dev/hda5". If it said vfat, I would use the fsck.vfat program instead.

Since you are having problems with the device, it probably would be best if you backed up all of the files to your hard drive first. And since you will be doing that, reformatting the filesystem and copying back the files may be the best option.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting FAT fs on usb stick K05T9 Slackware 8 05-06-2007 06:26 AM
Mounting a usb stick oookiezooo Linux - Newbie 15 04-13-2005 12:09 PM
mounting a USB stick.. kurrupt Linux - Hardware 2 01-01-2005 01:13 AM
Mount my USB stick (FAT) hyllplan Linux - Hardware 3 11-05-2004 03:09 AM
mounting usb a stick sethgeekx86 Slackware 1 05-19-2004 06:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration