LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 09-27-2007, 02:57 PM   #1
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
Will this ruin a usb drive


I was messing around with some stuff today, working on restoring the mbr on a usb stick for BartPE. I got the one usb device to work doing dd if=pe2usb.bin of=/dev/sdb bs=512 count=1, so I was working on another one and decided to clear the mbr to test another utility.

I used dd if=/dev/null of=/dev/sdb bs=512 count=1

Now, I cannot write anything to the device, cannot use dd to write bit by bit or anything. Doing a fdisk -l says the logical and physical geometry's are off.
dmesg is stating some bad sectors.
If I try a format in windows, it states Invalid media or Track 0 bad - disk unusable.

I'm not too concerned about getting it to work (if that's even possible, which I don't think it is), just wondering if this caused the issue or if it happened to crap out when I was working on it.

I
 
Old 09-27-2007, 03:13 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
I used dd if=/dev/null of=/dev/sdb bs=512 count=1
Next time use this :
Code:
dd if=/dev/zero of=/dev/sdb bs=512 count=1
I.e. do not use the /dev/null device as input file, use /dev/zero instead. That device actually outputs data (zeroes) whereas /dev/null does not.

I don't know if it is the use of /dev/null as input which screwed your USB stick, but after reading your post I am not going to risk any of mine to verify this....
Although I find it quite strange that no further 'dd' command will write to that disk.
Did you try to use that USB stick on another computer and write to it there? Or reboot your computer and then try again?

Alternatively, try this command to re-initialize the USB stick (assuming that your distro has the sfdisk program on board):
Code:
echo ",,b;" | sfdisk /dev/sdb
Eric
 
Old 09-27-2007, 03:21 PM   #3
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by Alien Bob View Post
Next time use this :
Code:
dd if=/dev/zero of=/dev/sdb bs=512 count=1
I.e. do not use the /dev/null device as input file, use /dev/zero instead. That device actually outputs data (zeroes) whereas /dev/null does not.
Yea, I kinda thought of that afterwards "Why didn't I use /dev/zero instead of /dev/null". Don't know where I got the brilliant idea from.
 
Old 09-27-2007, 05:59 PM   #4
rsashok
Member
 
Registered: Nov 2006
Location: USA, CA
Distribution: RedHat, Debian
Posts: 202

Rep: Reputation: 31
Try to partition your USB stick with:
fdisk /dev/sdb

It will bring you to the menu, type 'm' for help.
You could try:
then 'n' - add new partition
then 'a' - add boot flag
then 'w' or 'x' (I don't remember) to write it back to
the device.

If you are successful then create file system on newly created partition
mke2fs /dev/sdb1

Good luck.

Last edited by rsashok; 09-27-2007 at 06:02 PM.
 
Old 09-27-2007, 06:52 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
It is possible that you damaged the flash memory. BTW using bs=512 wipes out the bootloader and the partition table. To zero out the bootloader just use bs=446.
 
Old 09-28-2007, 08:30 AM   #6
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by rsashok View Post
Try to partition your USB stick with:
fdisk /dev/sdb

It will bring you to the menu, type 'm' for help.
You could try:
then 'n' - add new partition
then 'a' - add boot flag
then 'w' or 'x' (I don't remember) to write it back to
the device.

If you are successful then create file system on newly created partition
mke2fs /dev/sdb1

Good luck.
I've tried repartioning it a few times, and it hasn't worked. Which is what has lead me to believe it no longer works.

Quote:
Originally Posted by michaelk
It is possible that you damaged the flash memory
That is what I was thinking, but I am wondering how that would actually damage the memory.

I'm not too concerned with fixing it, and I think it is beyond repair. I am just wondering how/why it quit working.
 
  


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
Installing Debian on USB Hard Drive/USB Jump Drive kushalkoolwal Debian 10 02-26-2009 01:46 PM
Will fixmbr ruin my Windows partition? Micro420 General 7 08-17-2006 11:10 AM
Why ruin things? The Bad Penny General 11 11-13-2004 04:17 AM
Can I ruin my monitor by using a generic driver? Dreamcast Linux - Hardware 1 08-02-2004 11:49 PM
Will FTPing a .gz to Win2K ruin it? ronald_fancher Linux - General 1 07-14-2002 09:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:47 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