2

I am having a version strange problem with a 4GB ATP Industrial Grade Compact Flash Card. I am trying to use it as the boot storage for a ALIX single board PC.

When I insert it into another Linux machine I see:

[  421.320908] scsi 3:0:0:0: Direct-Access     eUSB     Compact Flash    5.06 PQ: 0 ANSI: 2
[  421.331377] sd 3:0:0:0: Attached scsi generic sg2 type 0
[  422.670588] sd 3:0:0:0: [sdb] 7847280 512-byte logical blocks: (4.01 GB/3.74 GiB)
[  422.700420] sd 3:0:0:0: [sdb] Write Protect is on
[  422.700424] sd 3:0:0:0: [sdb] Mode Sense: 00 77 bd 6f

Then when I try any kind of write operation with it, I get:

dd: failed to open ‘/dev/sdb’: Read-only file system

Things I have tried so far:

  • There doesn't appear to be any kind of physical write-protect switch on it
  • I am able reformat it, write files, read them back on a Mac
  • I have successfully zeroed the whole card on my Mac (dd if=/dev/zero of=/dev/disk1 bs=10m)
  • I have tried using hdparm to disable read-only mode (hdparm -r0 /dev/sdb), which doesn't error but doesn't disable write-protect either.
  • I don't have any of these problems with other compact flash cards - but I want to use this one because it is much larger - and should be better because it is industrial grade.

On my main Linux machine, I am using Debian 8 (Jessie) with Linux kernel version 3.16.0-7-amd64.

It feels like there is some kind of soft write-protect lock applied to the compact flash, that only Linux seems to understand.

Does anyone have any other ideas of what to try, or what might be wrong?

6
  • 1
    What file system are you using on it? Have you tried unmounting/re-mounting as root? Commented Jan 18, 2019 at 11:20
  • I put a FAT32 file system on it using my Mac. I am able to mount/unmount that read-only. But the problem seems to be lower-level than the filesystem or even the partition table. Commented Jan 18, 2019 at 11:33
  • Ok. Have you tried other filesystems? What happens if you format it on mac, then try to set up a filesystem on it in Linux? Commented Jan 18, 2019 at 11:35
  • If I try and re-partition it on Linux I get: cfdisk /dev/sdb cfdisk: cannot open /dev/sdb: Read-only file system Commented Jan 18, 2019 at 12:31
  • 2
    maybe you can fix this with the quirks mode of the usb_storage driver for this specific device, see askubuntu.com/a/1088434 Commented Jan 18, 2019 at 12:32

1 Answer 1

1

Maybe you can fix this with the quirks mode of the usb_storage driver for this specific device, see https://askubuntu.com/a/1088434

If you have to use the quirks mode this probably means that the Compact Flash card's behavior differs from (most) other CF cards.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.