LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices



Reply
 
Search this Thread
Old 11-03-2012, 12:54 AM   #1
jbs1136
Member
 
Registered: Dec 2008
Location: Spanaway, Wa
Distribution: Kernel Linux 3.6-4.slh.1-aptosid-amd64
Posts: 44

Rep: Reputation: 20
SOLVED - format a usb drive


I just bought a used netbook, Acer Aspire One, kind of old, atom, single core 32 bit with 8g ssd hdd with windows xp installed. bought a 16 gig usb drive and inserted. downloaded to windows the debian installer. ran the installer and rebooted when told. Everything seemed to be going fine until I got to the partioner. Thought about using LVM and let it partion to that. Didn't like the way it looked so tried to go back and redo manual partioning. For some reason the usb drive is now in read-only mode. I have tried it on two different linux computers and one windows and they all say read only.

Did I screw the drive up totally or is there a way to fix it? I have tried gparted, fdisk, cfdisk and none of them will let me reformat. Everytime I stick it in it automatically mounts in media as read-only. The drive is really small and doesn't have a switch for lock/unlock. I checked that too and even read the manual (of sorts) that came with the drive.

Any help appreciated.

john

Last edited by jbs1136; 11-11-2012 at 10:50 AM. Reason: SOLVED
 
Old 11-03-2012, 05:24 AM   #2
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Posts: 1,431
Blog Entries: 4

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
Quote:
Originally Posted by jbs1136 View Post
I have tried gparted, fdisk, cfdisk and none of them will let me reformat. Everytime I stick it in it automatically mounts in media as read-only.
When you try gparted, do you unmount the drive after inserting it?
 
Old 11-03-2012, 05:35 AM   #3
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbang
Posts: 693
Blog Entries: 1

Rep: Reputation: 145Reputation: 145
Have you tried using shred on that flash drive?
make sure you identify the drive correctly (on my machines it would usually come up as /dev/sdb)
then just type:
Code:
shred /dev/sdb
Replace /dev/sdb with the correct path for your flash drive. Warning, shred will make any data on the target drive unrecoverable.
After doing that, you should be able to format the drive normally.
 
Old 11-03-2012, 08:27 AM   #4
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Linux Mint, Ubuntu
Posts: 1,275

Rep: Reputation: 258Reputation: 258Reputation: 258
I think Randicus has it right - after you insert the drive, but before trying to do anything to it, unmount it.

I've run a number of distros on my AOA150 (1st generation Aspire One netbook with a 120GB HDD). My current favorite is Fedora 17 LXDE. At the time, the AOA110 (8GB SSD instead of the 120GB HDD) came with Linpus Lite, a Fedora 8 derivative running kernel 2.6.18. The Linpus folks included a kernel module subsequently rejected for inclusion into the mainline kernel that allows the multicard reader to read xD cards.
 
Old 11-03-2012, 10:24 AM   #5
jbs1136
Member
 
Registered: Dec 2008
Location: Spanaway, Wa
Distribution: Kernel Linux 3.6-4.slh.1-aptosid-amd64
Posts: 44

Original Poster
Rep: Reputation: 20
I have tried gparted with the drive both mounted and unmounted, still says read-only. I tried shred the same way and same answer.

Thanks for the help,

john
 
Old 11-03-2012, 07:21 PM   #6
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Linux Mint, Ubuntu
Posts: 1,275

Rep: Reputation: 258Reputation: 258Reputation: 258
Random thought of possible relevance:
Does the USB drive have a physical switch to make it read-only?
 
Old 11-03-2012, 07:24 PM   #7
jbs1136
Member
 
Registered: Dec 2008
Location: Spanaway, Wa
Distribution: Kernel Linux 3.6-4.slh.1-aptosid-amd64
Posts: 44

Original Poster
Rep: Reputation: 20
Good thought and that was one of the first things I checked. Thanks

John
 
Old 11-03-2012, 09:04 PM   #8
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,593

Rep: Reputation: 188Reputation: 188
I've seen U3 do this. to get rid of U3, write zeroes to the drive. I believe shred works within a file system, not on the hardware level. The dd command works well on virtual file systems, such as /dev.

dd if=/dev/zero of=/dev/sdc bs=1m count=500

That command line will destroy U3, and all partitions on the drive, destroying all data on the drive. So, then you can use the entire drive, without inconsistent behavior. After the command completes the first time, hit the up arrow, let it complete again, and then do it again. Remove the drive, wait three seconds or more, reinsert it, partition and format, and it should do what you want. If you write an iso9660 or some hybrid of it, there is no write support, because CDs and DVDs aren't random-access writable, so their file systems aren't writable either.

If you want to put a bootable .iso file on a USB flash drive, you have to write is as directories and files, and then install syslinux or some other boot loader. Hope this helps. I have confidence in you! Just don't give up! Quitters never win, and winners never quit.
 
Old 11-04-2012, 10:40 AM   #9
jbs1136
Member
 
Registered: Dec 2008
Location: Spanaway, Wa
Distribution: Kernel Linux 3.6-4.slh.1-aptosid-amd64
Posts: 44

Original Poster
Rep: Reputation: 20
Thanks for the suggestion. Honestly I had never heard of u3-tools. Pretty neat, gotta remember that one. Unfortunately it didn't work. The biggest problem is that the drive is mounted read-only. Because of that nothing else is working. When inserted it shows 2 mounted partitions which are mounted ro. I even tried adding them to /etc/fstab as rw but that wouldn't work either.

Thanks for all of the suggestions,

john
 
Old 11-04-2012, 11:59 AM   #10
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbang
Posts: 693
Blog Entries: 1

Rep: Reputation: 145Reputation: 145
Try connecting the drive before you turn on the computer. (make sure you've removed the lines you added to /etc/fstab)
That way, the drive shouldn't be mounted. dd and shred won't work properly on /dev/sdb or whichever device it is when it's mounted.
As far as I know, shred uses dd internally and I've used it at device level before. But either method should work as long as the drive is not mounted.
You may need to use sudo in front of these commands to override whatever has set the drive to read only.
 
Old 11-04-2012, 03:02 PM   #11
jbs1136
Member
 
Registered: Dec 2008
Location: Spanaway, Wa
Distribution: Kernel Linux 3.6-4.slh.1-aptosid-amd64
Posts: 44

Original Poster
Rep: Reputation: 20
I double checked fstab, inserted drive, rebooted. When I got to log in window i did ctrl-alt-f1, logged in as root. went to /dev/ to check to make sure of the drive letter. This time it was sdd with sdd1-4 listed. Tried shred and was told it was read-only. Tried testdisk and got the same response. No luck with dd either. This was the response from testdisk "This media may be physically write-protected, check the jumpers." This is a link to the drive from Staples that I bought - http://www.staples.com/Staples-micro...product_368052

Thanks for the suggestions,

john
 
Old 11-05-2012, 10:40 AM   #12
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Linux Mint, Ubuntu
Posts: 1,275

Rep: Reputation: 258Reputation: 258Reputation: 258
If I understand the above post correctly, it looks like /dev/sdd has 4 partitions on it (sdd1, sdd2, sdd3, sdd4). Have you unmounted all of them before attempting to reformat the usb drive?
 
Old 11-05-2012, 10:44 AM   #13
jbs1136
Member
 
Registered: Dec 2008
Location: Spanaway, Wa
Distribution: Kernel Linux 3.6-4.slh.1-aptosid-amd64
Posts: 44

Original Poster
Rep: Reputation: 20
I have tried both mount and unmounted.

john
 
Old 11-11-2012, 10:46 AM   #14
fatmac
Member
 
Registered: Sep 2011
Location: Surrey/Hants Border, UK
Distribution: AntiX, TinyCore, (& SliTaz)
Posts: 554

Rep: Reputation: Disabled
Possible solution if you don't want anything on the disk.

Boot your computer, insert your usb hdd, as root, check the drive number (i.e. /dev/sd?), unmount it, & then do:-

dd if=/dev/zero of=/dev/sd? bs=512 count=1

This will zero out the partition table completely & you should then be able to remove & re insert it, then reformat.

HTH
 
Old 11-11-2012, 10:48 AM   #15
jbs1136
Member
 
Registered: Dec 2008
Location: Spanaway, Wa
Distribution: Kernel Linux 3.6-4.slh.1-aptosid-amd64
Posts: 44

Original Poster
Rep: Reputation: 20
Thanks for the suggestion. I finally tried staples support and they had no suggestions. They did however give me a case number and told me to use it to exchange the drive for a new one.

Thanks to all who offered suggestions and help.

john
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] USB pen drive format jjonas Linux - Hardware 3 01-15-2012 02:25 PM
Label and Format USB Drive carlosinfl Linux - General 3 06-16-2010 04:36 PM
How to format a USB drive? JeffC1 Linux - Newbie 6 02-25-2009 01:15 PM
How to format a USB flash drive? Erik_the_Red Linux - Hardware 4 08-29-2005 01:47 PM
USB Drive Format and Image aeuzent Linux - Newbie 2 06-25-2005 01:39 AM


All times are GMT -5. The time now is 02:19 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration