You are not logged in.

#1 2018-11-22 19:42:27

berniz95
Member
From: Vauréal France
Registered: 2016-02-23
Posts: 48

SD cards mount read-only

I have changed both my computer and installation and my SDHC cards all appear read-only when I insert them in the SD slot.

Of course they all mount read-write on my other BL computers.

I don't know if the SD slot worked properly before I installed BL (deuterium Helium 64bits). How can I tell if it's a hardware or a software problem ?

$ ls -ld .
drwxr-xr-x 2 bernard bernard 8192 janv.  1  1970 .

$ ls -l
total 14767520
-rw-r--r-- 1 bernard bernard 1840822741 sept. 17 12:56 impro-camera1-1.mp4
(and more)

touch and.go
touch: impossible de faire un touch 'and.go': Système de fichiers accessible en lecture seulement

Last edited by berniz95 (2018-11-23 16:59:43)

Offline

#2 2018-11-23 00:24:43

rbh
Member
From: Sweden/Vasterbotten/Rusfors
Registered: 2016-08-11
Posts: 34

Re: SD cards mount read-only

berniz95 wrote:

I have changed both my computer and installation and my SDHC cards all appear read-only when I insert them in the SD slot.

I asume the cards is fat or fat32 formated, and that you is automounting the cards. As non root you end up without rw-rights.
It is a quite common question.

I personaly dislike automount. I Disable it in thunar and pcmanfm.

You can set up an entry in fstab, that lets you mount the cards with rw(read and write) rights:
Vfat is for fat32. FaT16 mounts with flag fat.

UUID=DCDE-7FC3 /mnt/SD    vfat noauto,user,rw   0      0
UUID=DCDE-7FC4 /mnt/SD    vfat noauto,user,rw   0      0

Create the directory /mnt/SD, replace UUID with your actual UUID's (you get it in an terminal with the command

lsblk -f

If you have an integrated cardreader, so the cards allways get the same device id, (/dev/xx), replace UUID=XXX with /dev/sdb1 or actual deviceid.

Then it is easy to issue in the terminal the command for mounting or unmounting the card:

mount /dev/SD
umount /dev/SD

You can also install the cli program "pmount", that lets you mount disk devices as root.


Btw: A newly installed pc with the outdated deuterium? No good idea...

Last edited by rbh (2018-11-23 00:31:13)


// Regards rbh

Offline

#3 2018-11-23 16:58:59

berniz95
Member
From: Vauréal France
Registered: 2016-02-23
Posts: 48

Re: SD cards mount read-only

Btw: A newly installed pc with the outdated deuterium? No good idea...

Helium, not deuterium. My mistake... I've corrected my initial post.

Indeed my cards are fat32 and I use automount.

I will try your solutions as soon as possible.

Last edited by berniz95 (2018-11-23 17:02:48)

Offline

#4 2018-11-24 08:32:18

ohnonot
...again
Registered: 2015-09-29
Posts: 3,194
Website

Re: SD cards mount read-only

strange.
i'm getting the exact same permissions as in your op (on a fat32 usb stick), but can still touch.

if you decide to fix this issue instead of working around it, let's collect some info:

enter

sudo dmesg -w

in a terminal and discard everything you see by holding down the Enter key.
then insert the sdcard, and try to open it in your filemanager or make an ls on it.
show us everything new that dmesg shows now.

also:

grep /dev/sdXY /etc/mtab
sudo fdisk -l /dev/sdXY

(replace sdXY with the actual partition in question)

Last edited by ohnonot (2018-11-24 08:33:02)

Offline

#5 2018-11-24 16:47:51

berniz95
Member
From: Vauréal France
Registered: 2016-02-23
Posts: 48

Re: SD cards mount read-only

sudo dmesg -w
[91937.439555] sd 6:0:0:0: [sdb] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[91937.440545] sd 6:0:0:0: [sdb] Write Protect is off
[91937.440549] sd 6:0:0:0: [sdb] Mode Sense: 03 00 00 00

"ls" or open in file manager shows nothing more.

$ grep /dev/sdb /etc/mtab
/dev/sdb1 /media/bernard/6CE8-F633 vfat ro,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0
$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 14,9 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x78b419d0

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdb1        8192 31116287 31108096 14,9G  c W95 FAT32 (LBA)

Voilà

Last edited by berniz95 (2018-11-24 16:48:51)

Offline

#6 2018-11-25 07:53:44

ohnonot
...again
Registered: 2015-09-29
Posts: 3,194
Website

Re: SD cards mount read-only

rbh wrote:

I asume the cards is fat or fat32 formated, and that you is automounting the cards. As non root you end up without rw-rights.
It is a quite common question.

this is exactly what happens.
but why?
and why is it common? i've never seen this happen.
anyhow, i searched, there's indeed many results.
all of them seem to assume that the problem is either a physical switch on the reader, or a corrupt filesystem. none have a software solution as such.

questions:

  • can you rename or delete the .mp4 from post #1?

  • is there a switch on the sdcard to make it read only?

  • have you checked the filesystem?

  • can you remount it rw? e.g. like this:

    cd
    mkdir sdmnt
    sudo mount /dev/sdb1 sdmnt -v -o rw
    cd sdmnt
    etc...

    can you use it normally now?
    if not, what messages do you get in terminal.

Offline

#7 2018-11-25 08:46:46

berniz95
Member
From: Vauréal France
Registered: 2016-02-23
Posts: 48

Re: SD cards mount read-only

  • can you rename or delete the .mp4 from post #1?
    No I can't. It says "read-only filesystem".

  • is there a switch on the sdcard to make it read only?
    Yes. It is in read-write mode. I can write on it using other Linux PC's SD readers.

  • have you checked the filesystem?

    $ sudo fsck /dev/sdb1
    fsck from util-linux 2.29.2
    fsck.fat 4.1 (2017-01-24)
    Got 7766016 bytes instead of 7769436 at 16384
  • can you remount it rw? e.g. like this:

    cd
    mkdir sdmnt
    sudo mount /dev/sdb1 sdmnt -v -o rw
    cd sdmnt
    etc...

    can you use it normally now?
    if not, what messages do you get in terminal.

    $ sudo mount /dev/sdb1 sdmnt -v -o rw
    mount: /dev/sdb1 is write-protected, mounting read-only
    mount: /dev/sdb1 mounted on /home/bernard/sdmnt.

    N.B. it does the same with any SD card. So I suspect a hardware problem ? At work I have an adaptor I could plug the SD card on a USB port with. I'll try that tomorrow evening.

(edit) I can write on my card if it's plugged on a USB port through an SD card adaptor. So this is a problem with the SD drive isn't it ? Could it be the hardware ?

Last edited by berniz95 (2018-11-26 17:56:59)

Offline

#8 2018-11-29 16:59:42

berniz95
Member
From: Vauréal France
Registered: 2016-02-23
Posts: 48

Re: SD cards mount read-only

Mmmmhh... finally the disease had spread to memory sticks. After one reboot all the SD cards now mount RW. I'm not sure what's going on. Subject closed for now.

Offline

Board footer

Powered by FluxBB