Score:0

Why does Ubuntu Make CF Cards Read Only?

aq flag

I'd like to edit some files on Cfast and CF cards in Ubuntu, but no matter what I try to do all tools available fail to allow me to write. The Cfast and CF cards are writable in Windows and there are no hardware locks on these like SD cards have. From all I read on these forums, it seems no one has ever figured this out so I doubt there is a way to get Ubuntu to allow writes because of how it's developed which is sad overall.

I should just be able to put the Cfast or CF card into the USB reader and edit the files like any other disk once it's mounted. But I can't. What conf file do I need to edit to make the default behavior read/write? I'm using version 20.04.3 LTS

Before I insert the CF card into the reader lsblk shows this.

adminx@adminx-VirtualBox:~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0     4K  1 loop /snap/bare/5
loop1    7:1    0  55.5M  1 loop /snap/core18/2253
loop2    7:2    0  54.2M  1 loop /snap/snap-store/558
loop3    7:3    0  61.9M  1 loop /snap/core20/1270
loop4    7:4    0   219M  1 loop /snap/gnome-3-34-1804/72
loop5    7:5    0  55.5M  1 loop /snap/core18/2284
loop6    7:6    0  65.1M  1 loop /snap/gtk-common-themes/1515
loop7    7:7    0   219M  1 loop /snap/gnome-3-34-1804/77
loop8    7:8    0    51M  1 loop /snap/snap-store/547
loop9    7:9    0  65.2M  1 loop /snap/gtk-common-themes/1519
loop10   7:10   0 247.9M  1 loop /snap/gnome-3-38-2004/87
loop11   7:11   0  32.3M  1 loop /snap/snapd/12704
loop12   7:12   0  43.3M  1 loop /snap/snapd/14295
sda      8:0    0    30G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0  29.5G  0 part /
sdb      8:16   0    10G  0 disk 
sr0     11:0    1  1024M  0 rom  
sr1     11:1    1  1024M  0 rom  

After I insert the CF card into the reader lsblk shows this.

adminx@adminx-VirtualBox:~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0     4K  1 loop /snap/bare/5
loop1    7:1    0  55.5M  1 loop /snap/core18/2253
loop2    7:2    0  54.2M  1 loop /snap/snap-store/558
loop3    7:3    0  61.9M  1 loop /snap/core20/1270
loop4    7:4    0   219M  1 loop /snap/gnome-3-34-1804/72
loop5    7:5    0  55.5M  1 loop /snap/core18/2284
loop6    7:6    0  65.1M  1 loop /snap/gtk-common-themes/1515
loop7    7:7    0   219M  1 loop /snap/gnome-3-34-1804/77
loop8    7:8    0    51M  1 loop /snap/snap-store/547
loop9    7:9    0  65.2M  1 loop /snap/gtk-common-themes/1519
loop10   7:10   0 247.9M  1 loop /snap/gnome-3-38-2004/87
loop11   7:11   0  32.3M  1 loop /snap/snapd/12704
loop12   7:12   0  43.3M  1 loop /snap/snapd/14295
sda      8:0    0    30G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0  29.5G  0 part /
sdb      8:16   0    10G  0 disk 
sdd      8:48   1   7.1G  0 disk 
├─sdd1   8:49   1     1G  0 part /media/adminx/1
├─sdd2   8:50   1 258.9M  0 part /media/adminx/2
└─sdd3   8:51   1   5.9G  0 part 
sr0     11:0    1  1024M  0 rom  
sr1     11:1    1  1024M  0 rom  

I've tried taking an image of the cf card or cfast card on a network share to see if it would be treated different, tried making it an ISO, IMG and VHD but all are by default treated as DVD/CD media and the support articles out here are all referencing SD cards that have hardware locks on them like the old floppy disk drives did.

When I run dmesg this is what I see

adminx@adminx-VirtualBox:~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0     4K  1 loop /snap/bare/5
loop1    7:1    0  55.5M  1 loop /snap/core18/2253
loop2    7:2    0  54.2M  1 loop /snap/snap-store/558
loop3    7:3    0  61.9M  1 loop /snap/core20/1270
loop4    7:4    0   219M  1 loop /snap/gnome-3-34-1804/72
loop5    7:5    0  55.5M  1 loop /snap/core18/2284
loop6    7:6    0  65.1M  1 loop /snap/gtk-common-themes/1515
loop7    7:7    0   219M  1 loop /snap/gnome-3-34-1804/77
loop8    7:8    0    51M  1 loop /snap/snap-store/547
loop9    7:9    0  65.2M  1 loop /snap/gtk-common-themes/1519
loop10   7:10   0 247.9M  1 loop /snap/gnome-3-38-2004/87
loop11   7:11   0  32.3M  1 loop /snap/snapd/12704
loop12   7:12   0  43.3M  1 loop /snap/snapd/14295
sda      8:0    0    30G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0  29.5G  0 part /
sdb      8:16   0    10G  0 disk 
sdd      8:48   1   7.1G  0 disk 
├─sdd1   8:49   1     1G  0 part /media/adminx/1
├─sdd2   8:50   1 258.9M  0 part /media/adminx/2
└─sdd3   8:51   1   5.9G  0 part 
sr0     11:0    1  1024M  0 rom  
sr1     11:1    1  1024M  0 rom  

All I want to do is insert these CF/Cfast cards in and go to the partition that has the XML files I need to edit and save them and that's it.

The partitions on these are all Linux, one is root, the other is system and the third one is my files which I'd like to edit and save back to the cf/cfast card. Since CF cards are getting harder to buy I'm having to now use the Cfast but none of them have hardware locks on them.

I have been asked how I mount the partitions I don't mount them as they show up already and I can browse the partitions via the Ubuntu Shell.

How can this be solved?

muru avatar
us flag
What commands do you use to mount these partitions? Once you mount these partition, what is the output of `mount`? Also what's the output of `lsblk` with the card attached to your system? Please [edit] your post to add these.
muru avatar
us flag
Also check the output of `dmesg` when connect the card or mount these partitions.
aq flag
I added in the information you asked for I don't mount its automatically showing the partitions of the cf card on the side bar and I can see all of them and right click to edit but once I try to save it says read only. I ran the two commands and edited the post
aq flag
It seems the compact flash card shows in lsblk I see on the second list sdd and under that sdd1, sdd2 and sdd3. Maybe I'm not mounting these correctly. The first thing that is confusing to me being a lifelong windows user is how to determine what is what from device to partition. Looking at the second list it appears the root of the tree references the device and presents it as sdd now syntax of how to make linux use /dev/sdd3 which is where I'd like to edit xml files is the part I might be missing. In my mind it's confusing. I'd like to mount sdd3 to enable write not read only.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.