Raspberry read only file system ошибка

I just got my Raspberry Pi and a brand new 16 GB Class 10 SD card. I am using Linux Mint and am trying to image the Raspbian Debian 7 (Wheezy) OS to the card, but whenever I try

dd bs=4M if=2013-05-25-wheezy-raspbian.img of=/dev/sdc

I get the error

dd: opening `/dev/sdc': Read-only file system

I have tried every way possible to change the permission using

chmod a=rwx /dev/sdc

and I added this line to /etc/fstab:

UUID=9016-4EF8  /media/matt/SDcard vfat user,uid=1000,gid=100,dmask=027,fmask=137  0  0

Here are some printouts from the command line:

matt-Aspire-5552 SDcard # blkid
/dev/sda1: LABEL="PQSERVICE" UUID="8806A1F106A1E104" TYPE="ntfs"
/dev/sda2: LABEL="SYSTEM RESERVED" UUID="EABAA321BAA2E971" TYPE="ntfs"
/dev/sda3: LABEL="Acer" UUID="6A5AE8025AE7C8C1" TYPE="ntfs"
/dev/sda5: UUID="a27e3081-abad-432d-8ffa-a24245684cd8" TYPE="ext4"
/dev/sdc1: UUID="9016-4EF8" TYPE="vfat"

And fdisk -l:

matt-Aspire-5552 SDcard # fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x2bd2c32a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    41945087    20971520   27  Hidden NTFS WinRE
/dev/sda2        41945088    42149887      102400    7  HPFS/NTFS/exFAT
/dev/sda3        42149888   371296943   164573528    7  HPFS/NTFS/exFAT
/dev/sda4       371298302   625141759   126921729    5  Extended
Partition 4 does not start on physical sector boundary.
/dev/sda5       371298304   625141759   126921728   83  Linux

Disk /dev/sdc: 15.8 GB, 15811477504 bytes
255 heads, 63 sectors/track, 1922 cylinders, total 30881792 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
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            8192    30881791    15436800    c  W95 FAT32 (LBA)

And I have even tried changing the permissions tab in the Properties of the SD card mount folder to be read-write, but that didn’t change anything.

All of this has been done in sudo su root.

GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

File system is read only

Edit: anyone looking for information on how to use FSCK, this question quickly changed focus. This ended up being a FSTAB issue. Still worth a read if you’re having issues with your file system being read only.

Hey,

My boot partition is locked on read only. Ik trying to force a fsck on it, but all the advice online seems outdated. anyone know how to do this?

Last edited by GarraTheWinnie on Sat Nov 05, 2022 8:21 pm, edited 3 times in total.



GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

Re: forcing fsck

Mon Oct 31, 2022 12:56 am

kerry_s wrote: ↑

Mon Oct 31, 2022 12:41 am


boot partition on what?
if sd, it usually indicates failed sd, which locks it read only.

It’s a micro sd. Typing the code below unlocks it until I reboot. So I don’t think its a hardware issue


User avatar

thagrol

Posts: 9840
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: forcing fsck

Mon Oct 31, 2022 1:24 am

GarraTheWinnie wrote: ↑

Mon Oct 31, 2022 12:56 am

kerry_s wrote: ↑

Mon Oct 31, 2022 12:41 am


boot partition on what?
if sd, it usually indicates failed sd, which locks it read only.

It’s a micro sd. Typing the code below unlocks it until I reboot. So I don’t think its a hardware issue

It shouldn’t. That will remount the root partition as rw but as it is already mounted that way it does nothing and won’t affect the boot partition.

will remount the boot partition rw but again it’s mounted that way by default.

It’s far more likely to be a permissions issue combined with you trying to write to /boot as a normal user. The default only allows root to write to /boot.

Usually if the (u)SD card has gone bad and switched to read only mode the OS will still think it has mounted rw and appear to allow writes but those writes are lost at shutdown.

Lastly, I know it’s inaccurate but around here micro SD and SD are used interchangably.

Knowledge, skills, & experience have value. If you expect to profit from someone’s you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides


GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

Re: forcing fsck

Mon Oct 31, 2022 1:58 am

thagrol wrote: ↑

Mon Oct 31, 2022 1:24 am


It shouldn’t. That will remount the root partition as rw but as it is already mounted that way it does nothing and won’t affect the boot partition.

will remount the boot partition rw but again it’s mounted that way by default.

It’s far more likely to be a permissions issue combined with you trying to write to /boot as a normal user. The default only allows root to write to /boot.

Usually if the (u)SD card has gone bad and switched to read only mode the OS will still think it has mounted rw and appear to allow writes but those writes are lost at shutdown.

The added «/boot/ just shoots out a error. don’t do anything.

I haven’t written to the /boot. until you showed me that command, I never even tried.

I really want to get fsck to run


User avatar

kerry_s

Posts: 5996
Joined: Thu Jan 30, 2020 7:14 pm

Re: forcing fsck

Mon Oct 31, 2022 4:24 am

I really want to get fsck to run

it’s already set to do that if somethings wrong.
if the sd is locked because of failer it’s not going to help.

Attachments
2022-10-30-182210_2560x720_scrot.png
2022-10-30-182210_2560x720_scrot.png (117.23 KiB) Viewed 4095 times


GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

Re: forcing fsck

Mon Oct 31, 2022 10:11 am

If the Miocrosd card is the problem, and I If I img it, then restore it to a new card ,will that in theory fix my problem, or will it transfer the problem to my new card?


User avatar

thagrol

Posts: 9840
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: forcing fsck

Mon Oct 31, 2022 12:02 pm

You sem to be confusing your partitions. boot (mounted at /boot) is the first (FAT) partition on the SD card. The root partition is the second (ext4) partition an is mounted to /.

If I interpret your posts correctly it’s the root partition you’re having problems with. By referring to it as the boot partition you’re confusing everyone including yourself.

GarraTheWinnie wrote: ↑

Mon Oct 31, 2022 10:11 am


If the Miocrosd card is the problem, and I If I img it, then restore it to a new card ,will that in theory fix my problem, or will it transfer the problem to my new card?

Impossible to say. It very much depends on the nature of the damage and the method used to copy the card. Even if the copy succeeds you may still end up with corrupted data.

What I’d do is this:

  1. Make an .img of the problem card. This is for recovery incase things go badly wrong.
  2. Flash a fresh RPiOS onto a new, clean SD card.
  3. Boot from this card
  4. Using a USBcard reader connect the problem card to the Pi.
  5. Make sure the partitions on this card are not mounted
  6. Run fsck on both partitions of this card
  7. If the fsck worrks, shutdown and reboot using the original card.
  8. If it doesn’t mount that card’s root partition and recover just the files you need/want to keep to a temporary directory on the new card.
  9. Check the recovered files for damage and merge into the new OS.

Knowledge, skills, & experience have value. If you expect to profit from someone’s you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides


GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

Re: forcing fsck

Mon Oct 31, 2022 11:48 pm

When I say my boot, I really mean my main partition where all my files are.

So my /home/ directory.

It’s completely locked unless I put in that command.

I’ll give those things a try. I have another pi thah works fine, so I’ll use FSCK on the micro-as in question, using that pi setup


User avatar

thagrol

Posts: 9840
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: forcing fsck

Tue Nov 01, 2022 12:20 am

GarraTheWinnie wrote: ↑

Mon Oct 31, 2022 11:48 pm


When I say my boot, I really mean my main partition where all my files are.

So my /home/ directory.

I’m now very confused. As I suspect are you.

A directory is not equal to a partition.

Partitions get mounted on directories.

On the default RPiOS /home is a directory on the root partition. However that may not be the case on your system as I don’t know what OS you’re using or how it has been setup.

Normal (i.e. those that are not root) users should not be able to write to /home but should be able to write to /home/their.user.name e.g. /home/pi

I’m not convinced your problem is a failed fsck followed by the root partition being mounted read only. If that had happenned significant portions of the OS would be throwing errors as they wouldn’t be able to write to log files, temporary files, etc. I’d also expect the OS to have dropped into recovery mode rather than booting fully.

On Raspberry Pi OS at least it will then prompt for a login which constantly fail as it will only allow the root user and the password for that user is deliberately unset.

I’m unsure what further help anyone can offer without more information from you and some effort on your part. Not least of which is you learning the difference between partitions and directories, the difference between the boot and root partitions, how Linux files system owner, group, and permissions work, and how to find the error message (if any) thrown during boot.

Posting the following would likey help:

  • What makes you think the partition has mounted read only? Examples of commands, their actual output, and their expected result preferred.
  • Any errors that are displayed during boot. If you have the splash screen enabled try looking in /var/log/syslog.
  • The output of the following command:
  • The contents of your /etc/fstab. Wrap it in code tags.

Knowledge, skills, & experience have value. If you expect to profit from someone’s you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides


GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

Re: forcing fsck

Tue Nov 01, 2022 1:32 am

I am likely confused, but I do know the difference between a directory and a partition. I simply didn’t explain my thought well.

What I meant is: the partition that contains the /home/ directory is the one that is write protected.

I always assumed it was the boot partition, because I
Grew up using dos, and generally the partition you start on, is the same the system booted from. Obviously that isn’t the case here.

My os is Raspian Lite.not sure what version. But I installed it within the last year or so.

I use this pi without any screen hooked up to it. I make all my changes via a SSH Connection.

I’ll type in that command and get back with what it says, as well as the contents of that file.

If this makes any difference, the last thing I did before the issue occurred; was empty a MySQL table.

Also, I noticed a day or so the drive was showing as full, which was bizarre because I don’t keep a lot on it. That was actually one of the reasons I was checking up on it


GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

Re: forcing fsck

Tue Nov 01, 2022 9:23 pm

So I was able to get that information

thagrol wrote: ↑

Tue Nov 01, 2022 12:20 am


Posting the following would likey help:

  • What makes you think the partition has mounted read only? Examples of commands, their actual output, and their expected result preferred.
  • Any errors that are displayed during boot. If you have the splash screen enabled try looking in /var/log/syslog.
  • The output of the following command:
  • The contents of your /etc/fstab. Wrap it in code tags.

1. Whenever I try to make any kind of change, I get the error: «Read-only file system», until I do the command «»sudo mount -o remount,rw /» (attacked an image)
2. as mentioned above, I don’t have a screen attached it, but I checked » /var/log/syslog» and there is no error
3.

Code: Select all

/dev/mmcblk0p2 on / type ext4 (ro,relatime)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)

4.

Code: Select all

Binary file /etc/fstab matches
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
Attachments
Screen Shot 2022-11-01 at 5.18.17 PM.png
screen shot
Screen Shot 2022-11-01 at 5.18.17 PM.png (122.66 KiB) Viewed 3894 times


User avatar

kerry_s

Posts: 5996
Joined: Thu Jan 30, 2020 7:14 pm

Re: forcing fsck

Tue Nov 01, 2022 10:08 pm

your not understanding, the remount is done in ram, not on the sd, it may look like you made it writable, but it’ll be gone on reboot.

can you post

to see the use%

Attachments
Screenshot from 2022-11-01 12-07-59.png
Screenshot from 2022-11-01 12-07-59.png (52.73 KiB) Viewed 3891 times


User avatar

thagrol

Posts: 9840
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: forcing fsck

Tue Nov 01, 2022 11:01 pm

GarraTheWinnie wrote: ↑

Tue Nov 01, 2022 9:23 pm


1. Whenever I try to make any kind of change, I get the error: «Read-only file system», until I do the command «»sudo mount -o remount,rw /» (attacked an image)
2. as mentioned above, I don’t have a screen attached it, but I checked » /var/log/syslog» and there is no error

That suggests the problem isn’t with disc damage or corruption or with fsck.

3.

Code: Select all

/dev/mmcblk0p2 on / type ext4 (ro,relatime)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)

So your root partition has been mounted read only. The question is why? I still don’t have enough information to do more than guess. And guessing wastes both our time.

4.

Code: Select all

Binary file /etc/fstab matches
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

Is that your entire fstab? I’m also unsure where «Binary file /etc/fstab matches» has come from and what help you think including it will be.

/etc/fstab should not be a binary file. It should be a text file. The default one should look similar to this:

Code: Select all

proc            /proc           proc    defaults          0       0
PARTUUID=738a4d67-01  /boot           vfat    defaults          0       2
PARTUUID=738a4d67-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

Have you edited your fstab from the default?

Have you enabled the read only root overlay via raspi-config?

Have you tried running fsck in the way I suggested earlier? fsck will not run on a mounted partition.

As for you lack of space (and this could be related to the other problem) are you using a USB drive for additional storage?

The lite builds of RPiOS do not have an automounter like the deskop builds do so if you haven’t arranged for it to be mounted during boot (usually by adding it to fstab but there are other options: systemd mount units, mount commands in cron or rc.local, …) or if the mount failed when using the nofail mount option anything that would have written to the drive will instead have written to the SD card.

I’m afraid that right now there is little more that I can add and given the obvious communication problems (or problems in terminology) I’m going to have to step back from this thread.

Knowledge, skills, & experience have value. If you expect to profit from someone’s you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides


GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

Re: forcing fsck

Tue Nov 01, 2022 11:28 pm

I posted a photo of the result of fs -l

I never touched the fstab. I have no idea why its a binary. I didn’t add that line, it was there when I got there. that was the entire contents

I don’t know how to enabled the read only root overlay via raspi-config? I wasn’t in it either, so I don’t think I enabled it by accident.

I haven’t done it yet. I needed to make an image of the sd card, and that took me a while to be in a position to do it

No, I don’t need external storage for this PI, because it only has one job, and the application isn’t big. I’ve stored everything in /home/pi

We’ll I appreciate everything you have done so far. Thanks anyway

Attachments
Screen Shot 2022-11-01 at 7.19.45 PM.png
Screen Shot 2022-11-01 at 7.19.45 PM.png (126.8 KiB) Viewed 3850 times



User avatar

jojopi

Posts: 3812
Joined: Tue Oct 11, 2011 8:38 pm

Re: forcing fsck

Wed Nov 02, 2022 5:18 am

kerry_s wrote: ↑

Wed Nov 02, 2022 2:07 am

yeah, that sd card is toast.

I see nothing to suggest dead hardware.

There is no entry for / in /etc/fstab. The boot scripts will therefore neglect to mount it rw, and the kernel default is ro as set in cmdline.txt. This will also produce errors during boot, and would normally prevent the GUI from starting, but as OP is running a Lite image headless, they will only notice that they have to manually remount / each time.

The damage to /etc/fstab cannot be explained by a hardware issue either, as hardware would not know to put the name of the file it was corrupting inside the file itself. Admittedly hardware could first put binary in the file and then software further corrupt it, but equally software could do both. Google has quite a few reports of «Binary file /etc/fstab matches» inside the file, but I do not spot the common factor. The file is not one that should be commonly rebuilt in normal use.

I would correct /etc/fstab to just the essential lines, with the true device names because using the wrong PARTUUID will not work and risks breaking headless boot:

Code: Select all

/dev/mmcblk0p1  /boot   vfat    defaults    0   2
/dev/mmcblk0p2  /       ext4    noatime     0   1

I do agree to copy off any important files first, not because I think the card is failing, but because of the precarious headless boot while trying to fix boot issues.


GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

Re: forcing fsck

Wed Nov 02, 2022 10:51 am

jojopi wrote: ↑

Wed Nov 02, 2022 5:18 am



I would correct /etc/fstab to just the essential lines, with the true device names because using the wrong PARTUUID will not work and risks breaking headless boot:

Code: Select all

/dev/mmcblk0p1  /boot   vfat    defaults    0   2
/dev/mmcblk0p2  /       ext4    noatime     0   1

I do agree to copy off any important files first, not because I think the card is failing, but because of the precarious headless boot while trying to fix boot issues.

I’ll start with that. How do I change it? At the moment everything is read-only unless I mount/unmount the partition. When I reboot, the changes I made are lost.

Would putting the micro-sd into a different machine work?


User avatar

rpdom

Posts: 22351
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: forcing fsck

Wed Nov 02, 2022 11:40 am

GarraTheWinnie wrote: ↑

Wed Nov 02, 2022 10:51 am


When I reboot, the changes I made are lost.

That is a classic symptom of a End of Life card that has gone permanently Read Only.

You can remount the FS read/write, but any changes are held in the buffers and the card ignores them.

Unreadable squiggle



GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

Re: forcing fsck

Thu Nov 03, 2022 1:11 am

So I was able to edit the fstab file. I chanced it to the code shown above. I’d did it by using another working computer. This seemed to fix the problem. I need to do some more test to see if it’s all working.

Assuming this was the problem, anyone know how this could have happened, and how I could have prevented it?

Last edited by GarraTheWinnie on Thu Nov 03, 2022 1:39 am, edited 1 time in total.


User avatar

kerry_s

Posts: 5996
Joined: Thu Jan 30, 2020 7:14 pm

Re: forcing fsck

Thu Nov 03, 2022 1:30 am

Assuming this was the problem, anyone know how this could have happened, and how I could have prevented it?

when the sd starts to die you get more and more corruption. there’s no prevention, just don’t ignore the signs.
you can google to understand sd failure.


GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

Re: forcing fsck

Thu Nov 03, 2022 1:39 am

kerry_s wrote: ↑

Thu Nov 03, 2022 1:30 am

Assuming this was the problem, anyone know how this could have happened, and how I could have prevented it?

when the sd starts to die you get more and more corruption. there’s no prevention, just don’t ignore the signs.
you can google to understand sd failure.

Do we know it’s sd-failure? Is it possible the fstab file was corrupt from the pi being shut off incorrectly, or something else?


User avatar

jojopi

Posts: 3812
Joined: Tue Oct 11, 2011 8:38 pm

Re: forcing fsck

Thu Nov 03, 2022 3:09 am

GarraTheWinnie wrote: ↑

Thu Nov 03, 2022 1:39 am

Do we know it’s sd-failure? Is it possible the fstab file was corrupt from the pi being shut off incorrectly, or something else?

It could not have been just card failure, or just unsafe shutdown. The damaged file had its own name mentioned within itself (in the form of a message from the grep command). That must have involved some faulty high-level script.

If your system is working again you can install and run debsums to verify the checkusms of system files:

Code: Select all

sudo apt update
sudo apt install debsums
sudo debsums -c

On a good system, the last command should take a few minutes but produce no output.


GarraTheWinnie

Posts: 268
Joined: Tue Jul 28, 2020 10:34 am

Re: forcing fsck

Thu Nov 03, 2022 7:25 pm

jojopi wrote: ↑

Thu Nov 03, 2022 3:09 am

GarraTheWinnie wrote: ↑

Thu Nov 03, 2022 1:39 am

Do we know it’s sd-failure? Is it possible the fstab file was corrupt from the pi being shut off incorrectly, or something else?

It could not have been just card failure, or just unsafe shutdown. The damaged file had its own name mentioned within itself (in the form of a message from the grep command). That must have involved some faulty high-level script.

If your system is working again you can install and run debsums to verify the checkusms of system files:

Code: Select all

sudo apt update
sudo apt install debsums
sudo debsums -c

On a good system, the last command should take a few minutes but produce no output.

So I did this, and it spit out a reference to the library used for my hardware clock. This Pi has a Real Time Clock, I’m pretty sure that’s the library that controls it

I’m not really sure what to make of that.

I reinstalled the package and re-ran debsums, and it didn’t show up again. So does this mean the card is probably fine?

Attachments
0DD50A9A-C030-4684-8DF0-C5E46AF9C43E.jpeg
0DD50A9A-C030-4684-8DF0-C5E46AF9C43E.jpeg (18.48 KiB) Viewed 3576 times


Return to “Beginners”

I just got my Raspberry Pi and a brand new 16 GB Class 10 SD card. I am using Linux Mint and am trying to image the Raspbian Debian 7 (Wheezy) OS to the card, but whenever I try

dd bs=4M if=2013-05-25-wheezy-raspbian.img of=/dev/sdc

I get the error

dd: opening `/dev/sdc': Read-only file system

I have tried every way possible to change the permission using

chmod a=rwx /dev/sdc

and I added this line to /etc/fstab:

UUID=9016-4EF8  /media/matt/SDcard vfat user,uid=1000,gid=100,dmask=027,fmask=137  0  0

Here are some printouts from the command line:

matt-Aspire-5552 SDcard # blkid
/dev/sda1: LABEL="PQSERVICE" UUID="8806A1F106A1E104" TYPE="ntfs"
/dev/sda2: LABEL="SYSTEM RESERVED" UUID="EABAA321BAA2E971" TYPE="ntfs"
/dev/sda3: LABEL="Acer" UUID="6A5AE8025AE7C8C1" TYPE="ntfs"
/dev/sda5: UUID="a27e3081-abad-432d-8ffa-a24245684cd8" TYPE="ext4"
/dev/sdc1: UUID="9016-4EF8" TYPE="vfat"

And fdisk -l:

matt-Aspire-5552 SDcard # fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x2bd2c32a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    41945087    20971520   27  Hidden NTFS WinRE
/dev/sda2        41945088    42149887      102400    7  HPFS/NTFS/exFAT
/dev/sda3        42149888   371296943   164573528    7  HPFS/NTFS/exFAT
/dev/sda4       371298302   625141759   126921729    5  Extended
Partition 4 does not start on physical sector boundary.
/dev/sda5       371298304   625141759   126921728   83  Linux

Disk /dev/sdc: 15.8 GB, 15811477504 bytes
255 heads, 63 sectors/track, 1922 cylinders, total 30881792 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
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            8192    30881791    15436800    c  W95 FAT32 (LBA)

And I have even tried changing the permissions tab in the Properties of the SD card mount folder to be read-write, but that didn’t change anything.

All of this has been done in sudo su root.

How do I fix the read-only file system on my Raspberry Pi?

What is going on here?!

  1. Configure the operating system to write all temporary files to the “tmpfs” file system which resides in memory.
  2. Configure additional services to also use the tempfs file system.
  3. Redirect all system log files to memory.
  4. Add some scripts to conveniently toggle read-only mode on / off (Optional)

How do I change my Raspberry Pi from read-only?

The Raspberry Pi Foundation has recently added this feature to the base Raspian OS image. You can then configure a read-only file system by going to Preferences–>Raspberry Pi Configuration–>Performance–>Overlay File System–Configure…

Can Raspberry Pi read USB?

Plug your device to a free USB port. Try to add a powered USB hub to the Raspberry Pi (check this one on Amazon for example if you don’t already have one). Your hard drive will not work without that (except if it has its power supply). Plug the hub to the Raspberry Pi and your hard drive directly on the hub.

How do I fix a read only file system?

Another way to solve read-only file system error is rebooting the system. Rebooting the system make a fresh start where prevous error are cleared which may be related libraries, configuration, temporary changes etc.

What is the default Raspberry Pi password?

By default your raspberry pi pi comes with an account ‘pi’ with the password ‘raspberry’. For security reasons it’s probably a good idea to change the password, but you may also wish to change the username as well.

How do I transfer files from Raspberry Pi to USB?

Transfer File From Raspberry Pi to PC Using USB Simply insert a formatted drive into a spare Raspberry Pi USB slot, then find it in the file manager. If you’re using an older Pi and are short of USB ports, then consider a USB hub. A standard USB hub will be fine for a USB flash device.

What format does PI use for USB?

You have two things to note (squared in red): The partition name given by Raspberry Pi OS: /dev/sda1 here. The file system type: FAT32 here.

Can Raspberry Pi read NTFS?

With the NTFS-3g package now installed to the Raspberry Pi, it is now ready to accept NTFS drives.

Why is my file system read-only?

The “Read-only file system …” is an error that is related to the file system. This error may occur in different situations for different reasons. This error simply expresses that the target file system is mounted as read-only mode and it can not be written or changed.

Can not remove read-only file system?

First, we check the mount point of the filesystem by running df X. For an ext2/ext3/ext4 filesystem, if the options did not include ro (read-only) but include errors=remount-ro, then it means the filesystem was damaged and was automatically remounted as read-only to limit the damage.

Can a Raspberry Pi go into read only mode?

Repeating this increases the risk of file system corruption. Luckily on Raspbian Buster you can force your file system into “read-only mode”. While in read-only mode the system cannot write any data to your SD card thus significantly prolonging the lifespan of your card.

Can a Raspberry Pi be moved to an external USB drive?

There is just one snag: sooner or later the SD card gets corrupted during a write operation. Moving the root file system of your Raspberry PI to an external USB drive bypasses this problem.

Can a Raspberry Pi be stored on a SD card?

Well, only during write operations. So, if we can figure out a way to not write to the SD card, the problem is solved. One solution is by storing the Raspberry PI root file system on a USB drive, instead of the SD card.

Where does the root partition go on a Raspberry Pi?

Below you can see a screenshot from the Double Commander twin panel file manager that shows both partitions: On the right side of the previous screenshot you can see the root file system partition. This is the one that gets mounted at / when the Raspberry PI boots up. It is also the one that we will move to the USB drive in this article.

HomeFixesRaspberry Pi Read-only file system Fix Solved

If you are getting “Read-only file system” on your Raspberry Pi when mounting drives there is a simple fix.

chewett@bunker-master2:/mnt/wd500$ touch test.txt
touch: cannot touch ‘test.txt’: Read-only file system

I noticed this happening when I tried to mount and work on my external hard drive. This is formatted with the NTFS filesystem.

I did some research and it turns out that by default Raspbian Jessie (as of 13/06/2017) does not include the ability to write to NTFS drives. To add this ability you can run the below command

sudo apt-get install ntfs-3g

This installs the NTFS driver which will allow you to also write to NTFS drives.

This issue will occur for anything using the underlying NTFS driver. I found this issue when I was mounting a veracrypt volume on the Raspberry Pi.

Veracrypt was installed by following my guide to install Veracrypt on the Rasperry Pi. Now I have resolved this problem I will be able to access my external drives on the Raspberry Pi.

About Author

Chewett

Понравилась статья? Поделить с друзьями:
  • Rasdial ошибка службы удаленного доступа 691
  • Rcldmwnd dllml exe ошибка приложения
  • Random count crusader kings 3 ошибка
  • Rasclient ошибка 691
  • Ranch simulator ошибка при запуске