LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-16-2012, 08:27 AM   #1
hearthstone
Member
 
Registered: Dec 2005
Distribution: Debian Stable
Posts: 83

Rep: Reputation: 4
How to erase read-only usb memory stick?


How do I erase read-only usb memory stick?
I have an install Debian on it, but it is read-only, I can't erase it.
I tried to follow http://www.linuxquestions.org/questi...d-only-772711/ , but to no avail. gparted doesn't do it.
Thanks, Hearthtstone.

Last edited by hearthstone; 05-16-2012 at 08:28 AM. Reason: misspelling
 
Old 05-17-2012, 02:32 AM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 189Reputation: 189
Quote:
I have an install Debian on it, but it is read-only, I can't erase it.
You really need to give us some information to work with, other than "I cant do it".
Posting the command you are trying to use, and the resulting output would be most beneficial.

To erase a disk completely, and unequivocally you should be able to write zeros/random with dd. Search LQ for dd and you will find a couple of good threads that give examples on just about every possible use of dd.
You may not be able to do this as a user, you may need to be root.
 
Old 05-17-2012, 06:59 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,197
Blog Entries: 3

Rep: Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426
Lightbulb Member response

Hi,

Look at pendrivelinux: Restoring your USB Key
procedure to restore the USB flash using MS Windows or Gnu/Linux. Simple!
 
Old 05-17-2012, 10:43 AM   #4
jefro
Guru
 
Registered: Mar 2008
Posts: 11,516

Rep: Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403Reputation: 1403
Did you boot to the usb?
 
Old 05-18-2012, 12:43 PM   #5
hearthstone
Member
 
Registered: Dec 2005
Distribution: Debian Stable
Posts: 83

Original Poster
Rep: Reputation: 4
I give up.
Hearthstone.
 
Old 05-18-2012, 12:55 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,197
Blog Entries: 3

Rep: Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426
Member response

Hi,

Quote:
Originally Posted by hearthstone View Post
I give up.
Hearthstone.
You did try the pendrivelinux procedure for MS Windows or Linux? If so what happened?
 
Old 05-26-2012, 12:08 PM   #7
Chris.Bristol
Member
 
Registered: Jul 2011
Distribution: elementary OS CrunchBang
Posts: 151

Rep: Reputation: 3
Hearthstone
Perhaps you are having the same problem as me. The instructions on the Pendrivelinux site look sensible, and I think that the program "Disk Utility" will achieve the same thing, so you might want to try that.

I just get an error message "One or more partitions are busy on /dev/sdd", so maybe it's something to do with whether or not the USB drive should be mounted?

If you know how to do that you could try mounting and unmounting it first. If that works please post how you did it.

Last edited by Chris.Bristol; 05-26-2012 at 12:10 PM.
 
Old 05-27-2012, 02:53 AM   #8
hearthstone
Member
 
Registered: Dec 2005
Distribution: Debian Stable
Posts: 83

Original Poster
Rep: Reputation: 4
Please see the bellow (and the attachment)--is this what I wanted?

I want to use the stick to have a bootable, installable .iso on it AND extra space for storing files. Would that be possible?

Thanks, Hearthstone.

After I followed the instructions for Linux - http://www.pendrivelinux.com/restori...key-partition/

I got:

modelearth:~# fdisk -l

Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00028b7f

Device Boot Start End Blocks Id System
/dev/sda1 * 1 7047 56601600 83 Linux
/dev/sda2 7047 7296 2000897 5 Extended
/dev/sda5 7047 7296 2000896 82 Linux swap / Solaris

Disk /dev/sdb: 4004 MB, 4004511744 bytes
220 heads, 3 sectors/track, 11850 cylinders
Units = cylinders of 660 * 512 = 337920 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0621e424

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 606 199648 17 Hidden HPFS/NTFS
modelearth:~# fdisk /dev/sdb1

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Attached Images
File Type: png memorystick-01.png (46.0 KB, 4 views)
 
Old 05-27-2012, 12:47 PM   #9
Chris.Bristol
Member
 
Registered: Jul 2011
Distribution: elementary OS CrunchBang
Posts: 151

Rep: Reputation: 3
I've found a way to reformat the disk despite it being write-protected, which is all I want, but I think that if you did that then made it bootable it would probably become write-protected again. Maybe you need to try different packages for making bootable USB sticks - it may be that there is one doesn't make it write-protected. Alternatively that may just be the way it is with bootable memory sticks.
 
Old 05-28-2012, 10:55 PM   #10
hearthstone
Member
 
Registered: Dec 2005
Distribution: Debian Stable
Posts: 83

Original Poster
Rep: Reputation: 4
I used gparted to erase and repartition the stick, then I used:
modelearth:~# dd if=/root/firmware-6.0.1a-i386-netinst.iso of=/dev/sdb1
to get Debian Squeeze install .iso on it.
The flag checked for "boot".
Please see the attachment.
Yet it did not boot.
Thanks, Hearthstone.
Attached Images
File Type: png memorystick-02.png (59.0 KB, 2 views)
 
Old 05-30-2012, 05:46 AM   #11
hearthstone
Member
 
Registered: Dec 2005
Distribution: Debian Stable
Posts: 83

Original Poster
Rep: Reputation: 4
This, finally, worked:
I used (g)parted to erase and partition the stick.
Then I followed instructions at http://pthree.org/2010/02/21/installing-debian-via-usb/ and got me a stick that I can install a Debian Squeeze with on wireless, using debian-6.0.5-i386-netinst.iso.

Thank you all!

Hearthstone.
 
Old 05-30-2012, 10:44 AM   #12
Chris.Bristol
Member
 
Registered: Jul 2011
Distribution: elementary OS CrunchBang
Posts: 151

Rep: Reputation: 3
Thanks for posting the answer Hearthstone.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to erase USB-stick. Mounts as read-only tom4everitt Linux - Hardware 9 12-02-2009 07:00 AM
Unable to read/write usb 256mb memory stick Aju Linux - Hardware 13 03-09-2009 03:24 AM
Two USB memory devies (stick memory/jump drive) one works one not Mark_in_Hollywood Linux - Hardware 5 05-20-2008 07:35 PM
USB Memory Stick/MP3 Player (Can't read files) jasarien Linux - Hardware 12 08-27-2004 04:09 PM


All times are GMT -5. The time now is 05:11 AM.

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