DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Kernel Linux 3.6-4.slh.1-aptosid-amd64
Posts: 44
Rep:
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
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.
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.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
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.
Distribution: Kernel Linux 3.6-4.slh.1-aptosid-amd64
Posts: 44
Original Poster
Rep:
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.
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.
Distribution: Kernel Linux 3.6-4.slh.1-aptosid-amd64
Posts: 44
Original Poster
Rep:
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
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?
Distribution: Kernel Linux 3.6-4.slh.1-aptosid-amd64
Posts: 44
Original Poster
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.