LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Unable to mount USB-stick (http://www.linuxquestions.org/questions/linux-general-1/unable-to-mount-usb-stick-264582/)

iskrem 12-09-2004 04:28 PM

Unable to mount USB-stick
 
I have a problem mounting my Creative Muvo TX MP3-player/USB-stick. I am running udev and dmesg express that the device is probed:

Code:

  Type:  Direct-Access                      ANSI SCSI revision: 02
SCSI device sdb: 499968 512-byte hdwr sectors (256 MB)
sdb: Write Protect is off
sdb: Mode Sense: 03 00 00 00
sdb: assuming drive cache: write through
 sdb: sdb1
Attached scsi removable disk sdb at scsi4, channel 0, id 0, lun 0
Attached scsi generic sg1 at scsi4, channel 0, id 0, lun 0,  type 0
USB Mass Storage device found at 5

fdisk -l gives this output:
Code:

Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          1          31      249956+  6  FAT16

And while trying to mount it, I am getting the following problems. It really says that /dev/sdb1 doesn't exist:

Code:

# mount -t msdos /dev/sdb1 /mnt/muvo
mount: special device /dev/sdb1 does not exist

Code:

# mount /dev/sdb1 /mnt/muvo
mount: special device /dev/sdb1 does not exist

I know I have a module for fat16. I don't understand that I recieve this error message:
Code:

# mount /dev/sdb1 -t fat16 /mnt/muvo
mount: fs type fat16 not supported by kernel


I have tried reformatting, repartioning etc. Any help would be appreciated and if there is any information that is needed in order to answer this question, please let me now. There could be a very silly solution that I haven't thought of. I would be glad to hear it all.

Edit: sdaX was suppose to be sdbX

netstv 12-09-2004 05:15 PM

I'm not sure why you are trying /dev/sda instead of /dev/sdb. It seems to me that the dmesg told it as /dev/sdb.

What I would do is try sfdisk instead of fdisk. So what happens if you type:

/sbin/sfdisk -l /dev/sdb

and same for

/sbin/sfdisk -l /dev/sda

that is a -l (EL). This will just show the partitions from the device.

Post back what that puts up.

SlackerLX 12-09-2004 08:13 PM

you have been using wrong syntacsis.


Follow this :
mount -t vfat /dev/sda1 /mnt/"your directory"

iskrem 12-11-2004 04:18 AM

First of all thank for taking time to answer my question. It is greatly appreciated. :)

Quote:

Originally posted by netstv
I'm not sure why you are trying /dev/sda instead of /dev/sdb. It seems to me that the dmesg told it as /dev/sdb.

Sorry, I tried to manipulate the output from dmesg, so I could rationalize the problem. The usb stick is really at /dev/sdb1.
Maybe it wasn't a good idea to alter the output. I have corrected the output according to what it really is. So the stick is on /dev/sdb(1)

Quote:

Originally posted by netstv

What I would do is try sfdisk instead of fdisk. So what happens if you type:

/sbin/sfdisk -l /dev/sdb
/sbin/sfdisk -l /dev/sda

I have reformated the unit, so I really don't have any partitions on it anymore. So, if we start from scratch and troubleshoot my steps, I hope we can find a solution.
When I reformat the unit you can see the result of this command.

I make a partition at /dev/sdb
Code:

# fdisk /dev/sdb
Command (m for help): n
Command action
  e  extended
  p  primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1008, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-1008, default 1008): 1008

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

Listing the partitions
Code:

# sfdisk -l /dev/sdb

Disk /dev/sdb: 1008 cylinders, 8 heads, 62 sectors/track
Units = cylinders of 253952 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start    End  #cyls    #blocks  Id  System
/dev/sdb1          0+  1007    1008-    249953  83  Linux
/dev/sdb2          0      -      0          0    0  Empty
/dev/sdb3          0      -      0          0    0  Empty
/dev/sdb4          0      -      0          0    0  Empty

Trying to make a vfat file system doesn't work.
Code:

# mkfs -t vfat /dev/sdb1
mkfs.vfat 2.8 (28 Feb 2001)
/dev/sdb1: No such file or directory

Trying to mount the usb stick regardless of file system:
Code:

# mount /dev/sdb1 /mnt/flash
mount: special device /dev/sdb1 does not exist

This however works:
Code:

# mount /dev/sdb /mnt/flash
I get a listing of the usb sticks contents. However I am not able to copy files to the stick (it doesn't appear there). But I am able to write a file to disk
using ex. vim in the current /mnt/flash directory.
Code:

# cd /mnt/flash
# dir
lost+found

Trying to format usb-stick to vfat doesn't work either
Code:

# umount /mnt/flash
# mkfs.vfat /dev/sdb
mkfs.vfat 2.8 (28 Feb 2001)
mkfs.vfat: Will not try to make file system on '/dev/sdb'

Code:

# mkfs.vfat /dev/sdb1
mkfs.vfat 2.8 (28 Feb 2001)
/dev/sdb1: No such file or directory

Code:

# mount /dev/sdb /mnt/flash
# mkfs -t vfat /mnt/flash
mkfs.vfat 2.8 (28 Feb 2001)
mkfs.vfat: unable to open /mnt/flash

Strange. Again, thanks a lot for taking time to troubleshoot my issue.

iskrem 12-11-2004 10:54 AM

Not even this work:

Code:

# /sbin/sfdisk -l /dev/sdb

Disk /dev/sdb: 1008 cylinders, 8 heads, 62 sectors/track
Units = cylinders of 253952 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start    End  #cyls    #blocks  Id  System
/dev/sdb1          0+  1007    1008-    249953  83  Linux
/dev/sdb2          0      -      0          0    0  Empty
/dev/sdb3          0      -      0          0    0  Empty
/dev/sdb4          0      -      0          0    0  Empty

Code:

# mkfs -t ext3 /dev/sdb1
mke2fs 1.35 (28-Feb-2004)
Could not stat /dev/sdb1 --- No such file or directory

The device apparently does not exist; did you specify it correctly?


netstv 12-13-2004 09:54 AM

When you did mount /dev/sdb /mnt/flash did it take a really long time?

Because I have seen that, but it was primarily because my kernel was compiled for the wrong processor.

What happens when you do cat /proc/partitions ? My guess is you are going to only see sdb. You should see sdb1

oneandoneis2 12-13-2004 10:06 AM

Have you looked at the /dev directory to make sure it actually has a /dev/sdb1 and it's permissions make it accessible?

Because when I was trying to get my PDA working, I got a message saying it had attached the device to /dev/ttyUSB1 and all was well - only there was no ttyUSB1!

I created it manually using mknod, and it worked just fine after that.

steve1401 12-13-2004 11:06 AM

This is what worked for me, I've allowed for you 'sdb' device...

Plug in your memory stick and (as root);

mkdir /mnt/mem

mount -t vfat /dev/sdb1 /mnt/mem

If this works, put this into /etc/fstab;
/dev/sdb1 /mnt/mem vfat rw,users 0 0

Does this help? Normaly the devise is /dev/sda1, try this as well???

Steve

iskrem 12-13-2004 05:15 PM

I think I found a solution to the problem today. The problem was the following: /dev/sdb1 was symlinked to "win". I suspect that Wine has done this. I removed the symlink and readded /dev/sdb1 using mknod. It was however a bit tricky to know the syntax of the mknod command. After some googling I figured that the syntax could be the following:

Code:

mknod /dev/sdb b 8 16
mknod /dev/sdb1 b 8 17
mknod /dev/sdb2 b 8 18

But the USB-stick is still acting kind of buggy. Even if I have a FAT filesystem it appears as Linux. If I format it as ext3 it still appears as Linux. This might be correct, though.

Code:

sfdisk -l /dev/sdb

Disk /dev/sdb: 1008 cylinders, 8 heads, 62 sectors/track
Units = cylinders of 253952 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start    End  #cyls    #blocks  Id  System
/dev/sdb1          0+  1007    1008-    249953  83  Linux
/dev/sdb2          0      -      0          0    0  Empty
/dev/sdb3          0      -      0          0    0  Empty
/dev/sdb4          0      -      0          0    0  Empty

Thanks for all help. I hope this resolved the issue.

netstv 12-13-2004 05:23 PM

Right so your main problem is resolved. Now you need to setup the parition as a vfat or whatever DOS type partition you want. I don't know too much about the DOS partition stuff.

I have a script that runs sfdisk and tells is "L" as the third parameter which is Linux. I believe there is a DOS type. But that's all you need to do ....

-netstv

Winno 12-14-2004 09:15 AM

When you partition using *fdisk, you can set the type ID (eg fat 16, linux) of a partition. At the fdisk prompt, typing t allows you to select an ID. After entering the partition number, you can list the codes by typing L. In your case, you'd probably want 'e W95 FAT16 (LBA)', so type 'e'. If that doesn't work, try '6 FAT16'. Then try formatting with mkfs.vfat.

The thing is, there maybe some ID confusion when mounting. If a partition is ID'd as Linux, it should be an ext2/3/etc FS.

iskrem 12-17-2004 10:22 AM

Thanks a lot. I wasn't aware of this "ID" issue.
I will do some further research on that subject :)

Thanks a lot for all help!


All times are GMT -5. The time now is 03:57 AM.