LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
LinkBack Search this Thread
Old 06-28-2013, 02:49 AM   #1
hcourtice
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Rep: Reputation: Disabled
Difference between USB flash drive located at /dev/sda or /dev/sda1


Hi,

This problem is similar to another (unresolved) question:
http://www.linuxquestions.org/questi...s-vfat-413719/


I have two USB Flash drives. One is recognised by U-Boot, and the other is not. I'm trying to determine what is different between them so that I can sort out why U-Boot is not reading the "Bad" one. Both have been formatted FAT32 in windows.

For the "Good" one, I can read the usb device from U-Boot.
> fatls usb 0
4165864 jffs2.wrap
1726520 kernel.wrap
3285730 romfs_1beta.tar.gz

3 file(s), 0 dir(s)


For the "Bad" one, I get an error message from U-Boot.
> fatls usb 0
No Fat FS detected




Both are recognised in linux, but they appear differently in /dev.

I am running Linux Kernel 3.5.3 using Snapgear distribution on Atemel ARM SAM9260 processor.

The "Good" one gets:
/dev/sda
/dev/sda1
/dev/sg0

The "Bad" one gets
/dev/sda
/dev/sg0


I can mount them both. For the "Good" one, I issue " mount /dev/sda1 /mnt/usb", and it mounts OK. For the "Bad" one I issue "mount /dev/sda /mnt/usb" , and it mounts OK.

< Plug in "Good" USB drive" >
scsi 3:0:0:0: Direct-Access Verbatim STORE N GO 5.00 PQ: 0 ANSI: 0 CCS
sd 3:0:0:0: Attached scsi generic sg0 type 0
sd 3:0:0:0: [sda] 3913728 512-byte logical blocks: (2.00 GB/1.86 GiB)
sd 3:0:0:0: [sda] Write Protect is off
sd 3:0:0:0: [sda] No Caching mode page present
sd 3:0:0:0: [sda] Assuming drive cache: write through
sd 3:0:0:0: [sda] No Caching mode page present
sd 3:0:0:0: [sda] Assuming drive cache: write through
sd 3:0:0:0: [sda] No Caching mode page present
sd 3:0:0:0: [sda] Assuming drive cache: write through
sd 3:0:0:0: [sda] Attached SCSI removable disk
# mount /dev/sda /mnt/usb
mount: mounting /dev/sda on /mnt/usb failed: Invalid argument
# mount /dev/sda1 /mnt/usb
# mount
....
/dev/sda1 on /mnt/usb type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)


< Plug in "Bad" USB drive" >
scsi 5:0:0:0: Direct-Access Verbatim STORE N GO 1.00 PQ: 0 ANSI: 2
sd 5:0:0:0: [sda] 3913728 512-byte logical blocks: (2.00 GB/1.86 GiB)
sd 5:0:0:0: Attached scsi generic sg0 type 0
sd 5:0:0:0: [sda] Write Protect is off
sd 5:0:0:0: [sda] No Caching mode page present
sd 5:0:0:0: [sda] Assuming drive cache: write through
sd 5:0:0:0: [sda] No Caching mode page present
sd 5:0:0:0: [sda] Assuming drive cache: write through
sd 5:0:0:0: [sda] No Caching mode page present
sd 5:0:0:0: [sda] Assuming drive cache: write through
sd 5:0:0:0: [sda] Attached SCSI removable disk

# mount /dev/sda1 /mnt/usb
mount: mounting /dev/sda1 on /mnt/usb failed: No such file or directory
# mount /dev/sda /mnt/usb
# mount
....
/dev/sda on /mnt/usb type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)



When I look at dmesg output, I get the following output ("Good" drive first).

usb 1-1: new full-speed USB device number 9 using at91_ohci
usb 1-1: New USB device found, idVendor=13fe, idProduct=3623
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: STORE N GO
usb 1-1: Manufacturer: Verbatim
usb 1-1: SerialNumber: 07A90908151B36A7
scsi7 : usb-storage 1-1:1.0
scsi 7:0:0:0: Direct-Access Verbatim STORE N GO 5.00 PQ: 0 ANSI: 0 CCS
sd 7:0:0:0: Attached scsi generic sg0 type 0
sd 7:0:0:0: [sda] 3913728 512-byte logical blocks: (2.00 GB/1.86 GiB)
sd 7:0:0:0: [sda] Write Protect is off
sd 7:0:0:0: [sda] Mode Sense: 03 41 00 00
sd 7:0:0:0: [sda] No Caching mode page present
sd 7:0:0:0: [sda] Assuming drive cache: write through
sd 7:0:0:0: [sda] No Caching mode page present
sd 7:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sd 7:0:0:0: [sda] No Caching mode page present
sd 7:0:0:0: [sda] Assuming drive cache: write through
sd 7:0:0:0: [sda] Attached SCSI removable disk
usb 1-1: USB disconnect, device number 9
usb 1-1: new full-speed USB device number 10 using at91_ohci
usb 1-1: New USB device found, idVendor=18a5, idProduct=0302
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: STORE N GO
usb 1-1: Manufacturer: Verbatim
usb 1-1: SerialNumber: 10V13000000034F0
scsi8 : usb-storage 1-1:1.0
scsi 8:0:0:0: Direct-Access Verbatim STORE N GO 1.00 PQ: 0 ANSI: 2
sd 8:0:0:0: [sda] 3913728 512-byte logical blocks: (2.00 GB/1.86 GiB)
sd 8:0:0:0: Attached scsi generic sg0 type 0
sd 8:0:0:0: [sda] Write Protect is off
sd 8:0:0:0: [ense: 03 00 00 00
sd 8:0:0:0: [sda] No Caching mode page present
sd 8:0:0:0: [sda] Assuming drive cache: write through
sd 8:0:0:0: [sda] No Caching mode page present
sd 8:0:0:0: [sda] Assuming drive cache: write through
sda:
sd 8:0:0:0: [sda] No Caching mode page present
sd 8:0:0:0: [sda] Assuming drive cache: write through
sd 8:0:0:0: [sda] Attached SCSI removable disk



Any explanation of the difference between these two drives much appreciated. Hopefully It will get me closer to working out why U-Boot only recognises one of them.

Thanks,
 
Old 06-28-2013, 03:21 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,345

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
well "good" has a partition table on it, and (at least) 1 partition. "bad" has no partitions and the entire device is a single file system.

compare and contrast "fdisk -l /dev/sda" for each drive.

I would create a proper partition table on "bad" with fdisk or under windows. OR, if these sticks are just about the same, you could just maybe clone one to the other?

for clarity that you're doign the right devices, i'd suggest:

from "good":
dd if=/dev/sda of=/tmp/usb.img

to "bad":
dd if=/tmp/usb.img of=/dev/sda
 
Old 06-28-2013, 04:22 AM   #3
hcourtice
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the quick solution.

Ok. Thanks for quick reply.I guess my version of u-boot expects partition table, I want to allow Usb firmware upgrade, so will need to sort a way for customers to partition from win.
 
Old 06-28-2013, 04:46 AM   #4
hcourtice
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the quick solution.

Ok. Thanks for quick reply.I guess my version of u-boot expects partition table, I want to allow Usb firmware upgrade, so will need to sort a way for customers to partition from win.
 
Old 06-28-2013, 03:16 PM   #5
jefro
Guru
 
Registered: Mar 2008
Posts: 10,272

Rep: Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258Reputation: 1258
Just like windows, unix and linux os's usually need a partition. Actually all could use an unpartitioned disk but it is not normal. As acid_kewpie suggested, you are missing a partition and that would suggest also formatted drive.

As for the command dd, I want to warn you, it is very dangerous. You have to be sure that your disk sequence would be sda or sdb or such. Also dd tends to work best on exact disk to disk copies. A 16g to 8g would fail usually. Even disk structure or CHS may be an issue.


Other ways that might work may be to use Clonezilla.

For a Windows user they do have dd for windows and rawritewin. There are some other "image" programs too.
 
Old 07-04-2013, 03:26 AM   #6
hcourtice
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the info. This pointed me in the right direction. Some USB drives are partitioned as a "Super Floppy", with no Partition table. U-Boot can't read these disks. I used Windows diskpart to install a new partition table and all is good.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB drive... /dev/sda1 doesn't show unless I try mounting /dev/sda as vfat finite Linux - Hardware 8 03-10-2009 12:52 AM
Installing RIP LinuX on a USB drive - device name /dev/sdc becomes /dev/sda Mleahy Linux - Software 1 07-30-2008 08:57 PM
Help mounting USB flash drive ... When plugged in I dont have /dev/sda1 device ... ebenh Ubuntu 2 09-17-2006 09:55 PM
/dev/sda and /dev/sda1 disappeared using sii3112A striderstrahan Linux - Software 0 09-16-2004 05:00 AM
USB Compact flash card reader hotplug creates /dev/sda but no /dev/sda1 -Mandrake 9.1 bibinono Linux - Hardware 2 08-11-2003 09:37 AM


All times are GMT -5. The time now is 09:03 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration