LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-01-2009, 11:17 AM   #1
tom4everitt
Member
 
Registered: Jan 2009
Location: Stockholm
Distribution: Fedora, Ubuntu, Mac OS X
Posts: 78

Rep: Reputation: 23
Unable to erase USB-stick. Mounts as read-only


Hello,

I'm trying to dd an arch linux .img file onto my usb, but it won't let me do it. It tells me:

Code:
dd: opening `/dev/sdb': Read-only file system
I get the same error when I try to do any modifications to it in fdisk or gparted:

Code:
mount: block device /dev/sdb1 is write-protected, mounting read-only
When mounted I can't see any of the files on it. The file system is fat-something I believe (16 according to gparted).

The boot flag was set (by rEFIt I think). Perhaps that's causing the problem?
 
Old 12-01-2009, 12:24 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
  • dd if=<img> of=/devsda1
If it fails, suggest : format sda1 with gparted.
.....

EDIT EDIT : Better not do the above, ref. @jschiwal, post # 3.
.....

Last edited by knudfl; 12-01-2009 at 01:11 PM.
 
Old 12-01-2009, 12:38 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
knudfl: Your post if typed correctly would cause the OP to erase his operating system.
 
Old 12-01-2009, 12:49 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Is the image for a hard drive filesystem, e.g. contains boot loader & partitions, or of a single partition.

What command did you use, and did you perform it as root. Normally the /dev/sdb device doesn't contain a file system. Is this a U3 drive? If so it may have a rom portion (or electronics that deny writes to the partition table) that presents itself as a CDROM device.

From a Wikipedia entry:
Quote:
Originally Posted by http://en.wikipedia.org/wiki/U3#APIs
Removal

Reformatting the drive will remove some of the software, but not all of it. The virtual CD-ROM drive cannot be removed by reformatting because it is presented to the host system as a physical device attached to a USB hub[6]; the official U3 Launchpad Removal Software, available on the manufacturer's website, disables the virtual CD drive device, leaving only the USB mass storage device active on the U3 USB hub controller, at which point the remaining software is removed by a subsequent format, performed by the removal software itself.

Last edited by jschiwal; 12-01-2009 at 12:50 PM.
 
Old 12-01-2009, 01:09 PM   #5
tom4everitt
Member
 
Registered: Jan 2009
Location: Stockholm
Distribution: Fedora, Ubuntu, Mac OS X
Posts: 78

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by jschiwal View Post
Is the image for a hard drive filesystem, e.g. contains boot loader & partitions, or of a single partition.

What command did you use, and did you perform it as root. Normally the /dev/sdb device doesn't contain a file system. Is this a U3 drive? If so it may have a rom portion (or electronics that deny writes to the partition table) that presents itself as a CDROM device.

From a Wikipedia entry:
Well, the image is supposed to go to /dev/sdb (rather than /dev/sdb1) according to the page from which it is downloaded.

I performed it as root, the command was

dd if=imagename.img of=/dev/sdb

How would I know if it's a U3 drive? It seems to contain a file system, there is a /dev/sdb1 partition on it at least. It presents itself as a usb flash drive.
 
Old 12-01-2009, 02:07 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
Well, the image is supposed to go to /dev/sdb
Fine. That indicates that it is an image file for a disk. E.G. for /dev/sdb and not /dev/sdb1.
You can use "file imagefile.img" to check. That isn't the problem at hand. I just wanted to make certain that you had the right kind of image to proceed.

You could run "sudo tail -f /var/log/messages" and then plug in the device. That should tell you what the kernel knows about the device, which device it is, and how many devices are detected.
 
1 members found this post helpful.
Old 12-01-2009, 02:28 PM   #7
tom4everitt
Member
 
Registered: Jan 2009
Location: Stockholm
Distribution: Fedora, Ubuntu, Mac OS X
Posts: 78

Original Poster
Rep: Reputation: 23
Ooh, cool tips. Not that I managed to solve a lot from it but.

The tail command gave this output, couldn't extract much useful info from it (but i'm definitely gonna remember the command for another time):

Code:
Dec  1 21:18:00 macbookpro kernel: usb 1-1: new high speed USB device using ehci_hcd and address 10
Dec  1 21:18:00 macbookpro kernel: usb 1-1: New USB device found, idVendor=0204, idProduct=6025
Dec  1 21:18:00 macbookpro kernel: usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Dec  1 21:18:00 macbookpro kernel: usb 1-1: configuration #1 chosen from 1 choice
Dec  1 21:18:00 macbookpro kernel: scsi7 : SCSI emulation for USB Mass Storage devices
Dec  1 21:18:05 macbookpro kernel: scsi 7:0:0:0: Direct-Access     ChipsBnk Flash Disk       2.00 PQ: 0 ANSI: 2
Dec  1 21:18:05 macbookpro kernel: sd 7:0:0:0: Attached scsi generic sg2 type 0
Dec  1 21:18:05 macbookpro kernel: sd 7:0:0:0: [sdb] 517375 512-byte hardware sectors: (264 MB/252 MiB)
Dec  1 21:18:05 macbookpro kernel: sd 7:0:0:0: [sdb] Write Protect is on
Dec  1 21:18:05 macbookpro kernel: sd 7:0:0:0: [sdb] Assuming drive cache: write through
Dec  1 21:18:05 macbookpro kernel: sd 7:0:0:0: [sdb] Assuming drive cache: write through
Dec  1 21:18:05 macbookpro kernel: sdb: sdb1
Dec  1 21:18:05 macbookpro kernel: sd 7:0:0:0: [sdb] Attached SCSI removable disk

fdisk found this, I don't know if it could be related at all.
Code:
Partition 1 has different physical/logical endings:
     phys=(1023, 15, 32) logical=(1010, 7, 31)
Partitions 1: cylinder 1024 greater than maximum 1010
Partition 1: previous sectors 517374 disagrees with total 524287
31 unallocated 512-byte sectors
 
Old 12-01-2009, 08:28 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
Looks like we are trying to access it with a Mac OS.

See this. http://www.diamond-memory.com/Manual...AD%20GUIDE.pdf Seems to indicate a very odd flash drive.
 
Old 12-02-2009, 03:28 AM   #9
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,296

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
With respect to previous posters, Any time I had that problem (Read only) there was a small switch on the usb key which write protected it. That would get switched, and I would stop tearing my hair out. Does it have a switch? Switch it!
 
1 members found this post helpful.
Old 12-02-2009, 07:00 AM   #10
tom4everitt
Member
 
Registered: Jan 2009
Location: Stockholm
Distribution: Fedora, Ubuntu, Mac OS X
Posts: 78

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by business_kid View Post
With respect to previous posters, Any time I had that problem (Read only) there was a small switch on the usb key which write protected it. That would get switched, and I would stop tearing my hair out. Does it have a switch? Switch it!
BRILLIANT! It wasn't harder than that :P Works perfectly now...

Thanks to everyone, and you especially!
 
  


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
Unable to read/write usb 256mb memory stick Aju Linux - Hardware 13 03-09-2009 03:24 AM
USB HardDrive mounts read-only. Is there anyway to make it read-write? Fritz_Katz Linux - Hardware 7 09-13-2007 06:50 PM
usb stick mounts, but fstab entry not right allelopath Linux - Hardware 3 05-08-2006 01:57 PM
ext. usb HDD mounts read only for non root accounts logname Linux - Hardware 14 02-27-2006 04:17 PM
Lexar USB Jump drive mounts read only qaball Linux - Hardware 7 02-06-2004 07:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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