LinuxQuestions.org
Visit the LQ Articles and Editorials section
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
 
Search this Thread
Old 11-20-2009, 07:43 AM   #1
bluesmanu
Member
 
Registered: May 2005
Location: Geneve
Distribution: Fedora 12
Posts: 48

Rep: Reputation: 15
Unhappy Messed up usb key


Hi all,

it seems I screwed up my usb key while trying to make it bootable. I think i copied a .img file to /dev/sdb instead of /dev/sdb1 and now I cannot access or format the key.
When I plug it in I get
Code:
[  129.088311] usb 2-3: new high speed USB device using ehci_hcd and address 3
[  129.221235] usb 2-3: configuration #1 chosen from 1 choice
[  129.324495] Initializing USB Mass Storage driver...
[  129.325056] scsi6 : SCSI emulation for USB Mass Storage devices
[  129.325448] usbcore: registered new interface driver usb-storage
[  129.325452] USB Mass Storage support registered.
[  129.325454] usb-storage: device found at 3
[  129.325456] usb-storage: waiting for device to settle before scanning
[  134.325717] usb-storage: device scan complete
[  134.326425] scsi 6:0:0:0: Direct-Access     USBest   USB2FlashStorage 0.00 PQ: 0 ANSI: 2
[  134.327266] sd 6:0:0:0: Attached scsi generic sg2 type 0
[  134.328820] sd 6:0:0:0: [sdb] Attached SCSI removable disk
The disk used to be recognized as "Ut165 USB2FlashStorage" and now it's "USBest USB2FlashStorage"

Here's also what i get :

Code:
[root]$ fdisk /dev/sdb
Unable to open /dev/sdb
[root]$ sfdisk /dev/sdb
/dev/sdb: No medium found
sfdisk: cannot open /dev/sdb read-write
Please help!
Thx!

Last edited by bluesmanu; 11-20-2009 at 07:44 AM.
 
Old 11-20-2009, 07:52 AM   #2
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,084

Rep: Reputation: 336Reputation: 336Reputation: 336Reputation: 336
Try dd'ing the usb, and recreating the partition table with Gparted

plug in USB and open a root terminal

Code:
dd if=/dev/zero of=/dev/sdb bs=512 count=1
make sure you dont dd your hd!
the above will wipe the usb completely
make sure usb is sdb

after dd'ing it
remove usb, wait ten sec
reinsert usb and open gparted
you can open gparted on the usb from root terminal

Code:
gparted /dev/sdb
then right-click on usb line and select
"new" and it will say it needs to make a msdos table
do that
then format and set boot flag of usb

thats how I fix my usb(s) when something really goes bad
 
Old 11-20-2009, 08:29 AM   #3
bluesmanu
Member
 
Registered: May 2005
Location: Geneve
Distribution: Fedora 12
Posts: 48

Original Poster
Rep: Reputation: 15
Thank you for your reply. I tried dd :
Code:
[root]$ dd if=/dev/zero of=/dev/sdb bs=512 count=1
dd: opening `/dev/sdb': No medium found
I am almost certain the key is sdb since in dmesg I see :
Code:
[ 4547.595645] sd 10:0:0:0: [sdb] Attached SCSI removable disk
 
Old 11-20-2009, 08:34 AM   #4
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,084

Rep: Reputation: 336Reputation: 336Reputation: 336Reputation: 336
what does

fdisk -l

show ?
 
Old 11-20-2009, 08:45 AM   #5
bluesmanu
Member
 
Registered: May 2005
Location: Geneve
Distribution: Fedora 12
Posts: 48

Original Poster
Rep: Reputation: 15
It does not show the sdb device
Code:
[root]$ fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x68000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3647    29294496   83  Linux
/dev/sda2            3648       19457   126993825    5  Extended
/dev/sda5            3648        3890     1951866   82  Linux swap / Solaris
/dev/sda6            3891       19457   125041896   83  Linux
 
Old 11-20-2009, 09:10 AM   #6
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,084

Rep: Reputation: 336Reputation: 336Reputation: 336Reputation: 336
you know I think its already been dd'd and thats why it cant see it?

can Gparted see the usb?
 
Old 11-20-2009, 09:34 AM   #7
bluesmanu
Member
 
Registered: May 2005
Location: Geneve
Distribution: Fedora 12
Posts: 48

Original Poster
Rep: Reputation: 15
no it does not :
Code:
gparted /dev/sdb
======================
libparted : 1.8.8.1.159-1e0e
======================
Error opening /dev/sdb: No medium found
 
Old 07-24-2011, 11:10 PM   #8
dimitrisdad
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Rep: Reputation: Disabled
stack of messed up usb keys

I've now got three USB keys with the same problem as the original poster.

They all have the same history. I originally used dd to put an install live image on the stick. This worked, and I installed linux on a few machines from the usb. In all cases the image was much smaller than the capacity of the stick. I then wanted to use the stick at greater capacity for data again, so I ran mke2fs /dev/sdb1 and put a file system on it. In each case this appeared to work, until the stick was placed in another machine. Then there was the dreaded "no medium found"

For example, for this disk, mount, fdisk, gpart, and dd all give the message "medium not found". However lsusb shows the drive device, as does the tail of /var/log/messages. ls /dev/disk/by-id shows the drive "usb-USBest_USB2FlashStorage-0:0" but when I mount or fdisk /dev/disk/by-id/usb-USBest_USB2FlashStorage-0:0" it says medium not found.

Yes, a new USB stick does work fine on the same computer. .. I suppose until I use it to install a system again ...
 
Old 04-18-2012, 05:34 PM   #9
ptdsign
LQ Newbie
 
Registered: May 2009
Location: Melbourne
Posts: 3

Rep: Reputation: 0
Have you tried the utility testdisk? It fixed one of my sticks after breaking it by dd-ing to the device and its hfs partition with boot flag...
 
Old 04-19-2012, 12:32 AM   #10
dimitrisdad
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Rep: Reputation: Disabled
testdisk

# testdisk /dev/disk/by-id/usb-USBest_USB2FlashStorage-0:0
TestDisk 6.13, Data Recovery Utility, November 2011
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Unable to open file or device /dev/disk/by-id/usb-USBest_USB2FlashStorage-0:0
 
  


Reply

Tags
format, key, usb


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bootable USB key messed up permissions on key.. VipX1 Linux - Newbie 4 09-21-2009 04:26 AM
messed up my usb disk PlancksCnst Linux - Hardware 2 05-04-2008 07:39 AM
I messed up my usb external disk auto-mounting alek66 Ubuntu 14 05-28-2007 12:11 PM
USB HDD majorly messed up! landfill Linux - Hardware 4 10-25-2005 10:42 PM
USB LexarMedia 32MB Data-Key + KDE 3.2=USB/HD Access problems that_guy Slackware 0 02-03-2005 09:27 AM


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

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