Find the answer to your Linux question:
Results 1 to 5 of 5
Hi all. I've a problem mounting an USB flash drive. When I plug the flash drive, I can see on the first terminal window (CTRL+F1) the information about the pen ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2005
    Posts
    5

    Exclamation USB flash drive mapped in a wrong device


    Hi all.

    I've a problem mounting an USB flash drive. When I plug the flash drive, I can see on the first terminal window (CTRL+F1) the information about the pen drive and the device to be use on the access (sdb). But when I try to mount it I get some troubles:

    Code:
    # mount /dev/sdb /mnt/removable
    mount: you must specify the filesystem type
    So, I try with many filesystems without success (fat, vfat, fat16, fat32, nfs, ufs, usbfs, autofs)

    Code:
    # mount -t autofs /dev/sdb /mnt/removable
    mount: wrong fs type, bad option, bad superblock on /dev/sdb,
                or too many mounted dile systems
    After many days on search, I realise that the device /dev/sdb is created "on-the-fly", when I plug the USB flash drive and it is pointing to /dev/scsi/host*/bus0/target0/lun0/disc where the * is changed by a number > 2 and it depends of the times I plug and unplug it (e.g. If I plug it and unplug it 3 times, at the 3rd plug time it will point to /dev/scsi/host5/....). After some tries I saw that I can mount it manualy using the command:

    Code:
    # mount /dev/scsi/host*/bus0/target0/lun0/part1 /mnt/removable
    With this I can access all the content of the flash drive.

    Now I need to chage /dev/sdb -> /dev/scsi/host*/bus0/target0/lun0/disc to /dev/sdb -> /dev/scsi/host*/bus0/target0/lun0/part1 and I don't know how to do that.

    Any Ideas???


    More Info:
    -> Dell precision M70
    -> lsmod
    Code:
    [root@localhost ~]# lsmod
    Module                  Size  Used by
    nls_iso8859_1           3904  0
    nls_cp437               5568  0
    vfat                   12768  0
    fat                    41184  1 vfat
    autofs4                17956  0
    nfsd                  203360  8
    exportfs                5632  1 nfsd
    parport_pc             36420  0
    lp                     12296  0
    parport                34376  2 parport_pc,lp
    ipv6                  244160  8
    ipmi_si                31974  1
    ipmi_msghandler        50664  1 ipmi_si
    i810_audio             35796  0
    ac97_codec             17452  1 i810_audio
    soundcore               9312  1 i810_audio
    af_packet              21128  0
    tg3                    80644  0
    tsdev                   7456  0
    joydev                  9728  0
    evdev                   9184  0
    usbmouse                5280  0
    nvidia               4086352  14
    usbhid                 43104  0
    agpgart                33224  1 nvidia
    usb_storage            64704  0
    ehci_hcd               29572  0
    uhci_hcd               31792  0
    usbcore               114136  6 usbmouse,usbhid,usb_storage,ehci_hcd,uhci_hcd
    rtc                    11448  0
    ext3                  128840  2
    jbd                    54072  1 ext3
    sd_mod                 17360  4
    ata_piix                8644  3
    libata                 44900  1 ata_piix
    scsi_mod              123488  3 usb_storage,sd_mod,libata
    -> fdisk
    Code:
    [root@localhost ~]# fdisk -l
    
    Disk /dev/sda: 60.0 GB, 60011642880 bytes
    255 heads, 63 sectors/track, 7296 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1         892     7164958+  83  Linux
    /dev/sda2             893        7296    51440130    5  Extended
    /dev/sda5             893        1146     2040223+  82  Linux swap
    /dev/sda6            1147        7296    49399843+  83  Linux
    
    Disk /dev/sdb: 497 MB, 497549312 bytes
    16 heads, 32 sectors/track, 1898 cylinders
    Units = cylinders of 512 * 512 = 262144 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1        1898      485872    6  FAT16
    
    Disk /dev/sdc: 1 MB, 1474560 bytes
    1 heads, 3 sectors/track, 960 cylinders
    Units = cylinders of 3 * 512 = 1536 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1   ?   623257122   679486963    84344761   69  Unknown
    Partition 1 has different physical/logical beginnings (non-Linux?):
         phys=(68, 13, 10) logical=(623257121, 0, 3)
    Partition 1 has different physical/logical endings:
         phys=(288, 115, 43) logical=(679486962, 0, 1)
    Partition 1 does not end on cylinder boundary.
    /dev/sdc2   ?   567173161  1190466982   934940732+  73  Unknown
    Partition 2 has different physical/logical beginnings (non-Linux?):
         phys=(371, 114, 37) logical=(567173160, 0, 2)
    Partition 2 has different physical/logical endings:
         phys=(366, 32, 33) logical=(1190466981, 0, 3)
    Partition 2 does not end on cylinder boundary.
    /dev/sdc3   ?         858         858           0   74  Unknown
    Partition 3 has different physical/logical beginnings (non-Linux?):
         phys=(371, 114, 37) logical=(857, 0, 3)
    Partition 3 has different physical/logical endings:
         phys=(372, 97, 50) logical=(857, 0, 2)
    Partition 3 does not end on cylinder boundary.
    /dev/sdc4               1  1145037824  1717556736    0  Empty
    Partition 4 has different physical/logical beginnings (non-Linux?):
         phys=(0, 0, 0) logical=(0, 0, 1)
    Partition 4 has different physical/logical endings:
         phys=(0, 0, 0) logical=(1145037823, 0, 3)
    Partition 4 does not end on cylinder boundary.
    
    Partition table entries are not in disk order
    -> uname -a
    Code:
    [root@localhost ~]# uname -a
    Linux localhost 2.6.10 #1 Mon Feb 6 17:43:26 CET 2006 i686 unknown unknown GNU/Linux
    -> kernelversion
    Code:
    [root@localhost ~]# kernelversion
    2.6
    -> cat /etc/fstab
    Code:
    [root@localhost ~]# cat /etc/fstab
    /dev/sda1 / ext3 defaults 1 1
    /dev/sda6 /data_local ext3 defaults 1 2
    none /dev/pts devpts mode=0620 0 0
    none /mnt/hd supermount dev=/dev/scsi/host2/bus0/target0/lun0/part1,fs=ext2:vfat,--,umask=0,iocharset=iso8859-1,kudzu,codepage=850 0 0
    none /mnt/removable supermount dev=/dev/sdb,fs=auto 0 0
    dev=/dev/scsi/host6/bus0/target0/lun0/part1,fs=ext2:vfat,--,umask=0,iocharset=iso8859-1,kudzu,codepage=850 0 0
    none /proc proc defaults 0 0
    /dev/sda5 swap swap defaults 0 0

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    the problem you are having here is that you are trying to mount the device, not the partition, instead of
    Code:
    mount /dev/sdb /mnt/removable
    try
    Code:
    mount /dev/sdb1 /mnt/removable
    That will mount the first (and most likely only) partition of the pen drive to /mnt/removable
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  3. #3
    Just Joined!
    Join Date
    Jul 2005
    Posts
    5
    Hi.
    Thanks for the help, but did't work.

    When I try
    Code:
    mount /dev/sdb1 /mnt/removable
    I receive the error
    Code:
    mount: /dev/sdb1 is not a block device
    and when I make ls -ls /dev/
    I get:
    Code:
    ...
    lr-xr-xr-x  1 root root       33 May 18 10:13 sdb -> scsi/host5/bus0/target0/lun0/disc
    drwxr-xr-x  1 root root        0 May 17 19:34 sdb1/
    lr-xr-xr-x  1 root root       33 May 18 10:13 sdc -> scsi/host5/bus0/target0/lun1/disc
    ...
    So, with this information we can see that sdb1 is a directory and maybe is because of that I can't mount it.
    Now, as you can see sdb is pointing to scsi/host5/bus0/target0/lun0/disc but I think it must point to scsi/host5/bus0/target0/lun0/part1 which is the one I can mount manualy. How can change the target of sdb?

    Tks.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by hclima
    Now, as you can see sdb is pointing to scsi/host5/bus0/target0/lun0/disc but I think it must point to scsi/host5/bus0/target0/lun0/part1 which is the one I can mount manualy. How can change the target of sdb?
    You can remove the sdb symlink
    Code:
    rm /dev/sdb
    andd then to recreate it to point to the scsi/host5/bus0/target0/lun0/part1
    Code:
    ln -s /dev/scsi/host5/bus0/target0/lun0/part1 sdb
    Though what u may wanna do is link it to another device temporarily to check it works, and leave the sdb link there for now... Just link it to sdc or something like that so you know, then try mounting /dev/sdc instead of sdb
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  6. #5
    Just Joined!
    Join Date
    Jul 2005
    Posts
    5
    Code:
    rm /dev/sdb
    ln -s /dev/scsi/host5/bus0/target0/lun0/part1 sdb
    mount /dev/sdb /mnt/removable
    worked but just while when I've the usb flash pluged in, because if I unplug it and plug it again, I had the same scenary as before.
    But I've a new issue, I watch the /var/log/messages file and the output is:

    Code:
    May 18 11:42:54 localhost kernel: usb 5-5: new high speed USB device using ehci_hcd and address 8
    May 18 11:42:54 localhost modprobe: FATAL: Module scsimon not found.
    May 18 11:42:54 localhost kernel: scsi7 : SCSI emulation for USB Mass Storage devices
    May 18 11:42:59 localhost kernel:   Vendor:           Model: USB DISK Pro      Rev: PMAP
    May 18 11:42:59 localhost kernel:   Type:   Direct-Access                      ANSI SCSI revision: 00
    May 18 11:43:00 localhost kernel: SCSI device sdb: 971776 512-byte hdwr sectors (498 MB)
    May 18 11:43:00 localhost kernel: sdb: assuming Write Enabled
    May 18 11:43:00 localhost kernel: sdb: assuming drive cache: write through
    May 18 11:43:00 localhost kernel: SCSI device sdb: 971776 512-byte hdwr sectors (498 MB)
    May 18 11:43:00 localhost kernel: sdb: assuming Write Enabled
    May 18 11:43:00 localhost kernel: sdb: assuming drive cache: write through
    May 18 11:43:00 localhost kernel:  /dev/scsi/host7/bus0/target0/lun0: p1
    May 18 11:43:00 localhost kernel: Attached scsi removable disk sdb at scsi7, channel 0, id 0, lun 0
    May 18 11:43:00 localhost kernel: Attached scsi generic sg1 at scsi7, channel 0, id 0, lun 0,  type 0
    May 18 11:43:00 localhost kernel:   Vendor:           Model: USB DISK Pro      Rev: PMAP
    May 18 11:43:00 localhost kernel:   Type:   Direct-Access                      ANSI SCSI revision: 00
    May 18 11:43:00 localhost kernel: SCSI device sdc: 2880 512-byte hdwr sectors (1 MB)
    May 18 11:43:00 localhost kernel: sdc: assuming Write Enabled
    May 18 11:43:00 localhost kernel: sdc: assuming drive cache: write through
    May 18 11:43:00 localhost kernel: SCSI device sdc: 2880 512-byte hdwr sectors (1 MB)
    May 18 11:43:00 localhost kernel: sdc: assuming Write Enabled
    May 18 11:43:00 localhost kernel: sdc: assuming drive cache: write through
    May 18 11:43:00 localhost kernel:  /dev/scsi/host7/bus0/target0/lun1: unknown partition table
    May 18 11:43:00 localhost kernel: Attached scsi removable disk sdc at scsi7, channel 0, id 0, lun 1
    May 18 11:43:00 localhost kernel: Attached scsi generic sg2 at scsi7, channel 0, id 0, lun 1,  type 0
    May 18 11:43:00 localhost perl: drakupdate_fstab called with --auto --add /dev/scsi/host7/bus0/target0/lun0/part1
    May 18 11:43:00 localhost perl: suggest_mount_point: don't know what to with hd sdb1
    May 18 11:43:00 localhost scsi.agent[7192]: disk at /devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5:1.0/host7/target7:0:0/7:0:0:0
    May 18 11:43:01 localhost scsi.agent[7226]: disk at /devices/pci0000:00/0000:00:1d.7/usb5/5-5/5-5:1.0/host7/target7:0:0/7:0:0:1
    I don't know what means scsimon at the line "May 18 11:42:54 localhost modprobe: FATAL: Module scsimon not found.", I'm seaching at the net but till now, I've got nothing.
    Do you know something?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •