LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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: 109

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: 193Reputation: 193
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: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
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
Moderator
 
Registered: Mar 2008
Posts: 21,982

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

Original Poster
Rep: Reputation: 4
I give up.
Hearthstone.
 
Old 05-18-2012, 12:55 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
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: Ubuntu 20.04
Posts: 235

Rep: Reputation: 14
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: 109

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 Thumbnails
Click image for larger version

Name:	memorystick-01.png
Views:	43
Size:	46.0 KB
ID:	9759  
 
Old 05-27-2012, 12:47 PM   #9
Chris.Bristol
Member
 
Registered: Jul 2011
Distribution: Ubuntu 20.04
Posts: 235

Rep: Reputation: 14
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: 109

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 Thumbnails
Click image for larger version

Name:	memorystick-02.png
Views:	51
Size:	59.0 KB
ID:	9775  
 
Old 05-30-2012, 05:46 AM   #11
hearthstone
Member
 
Registered: Dec 2005
Distribution: Debian Stable
Posts: 109

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: Ubuntu 20.04
Posts: 235

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


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 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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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