LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-02-2012, 11:54 PM   #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 09:50 AM. Reason: SOLVED
 
Old 11-03-2012, 04:24 AM   #2
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
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, 04:35 AM   #3
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
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, 07:27 AM   #4
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
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, 09: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, 06:21 PM   #6
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
Random thought of possible relevance:
Does the USB drive have a physical switch to make it read-only?
 
Old 11-03-2012, 06: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, 08:04 PM   #8
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
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, 09: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, 10:59 AM   #10
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
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, 02: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, 09:40 AM   #12
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
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, 09: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, 09:46 AM   #14
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,493

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, 09: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



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 01:25 PM
Label and Format USB Drive carlosinfl Linux - General 3 06-16-2010 03:36 PM
How to format a USB drive? JeffC1 Linux - Newbie 6 02-25-2009 12:15 PM
How to format a USB flash drive? Erik_the_Red Linux - Hardware 4 08-29-2005 12:47 PM
USB Drive Format and Image aeuzent Linux - Newbie 2 06-25-2005 12:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:15 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
Open Source Consulting | Domain Registration