You are not logged in.

#1 2020-12-27 21:34:59

silberblume
Member
Registered: 2020-12-27
Posts: 5

[SOLVED] Root filesystem suddenly read only

First post: For the last three days I've been going through the arch wiki, learning new things and installing arch for the first time.

Almost done with my installation, I tried installing intel-ucode, since I have an intel CPU.

#pacman -S intel-ucode 

gave me

error: failed to init transaction (unable to lock database)
error: could not lock database: Read-only filesystem

I quickly realised that my root partition file system had become read-only.

# mkdir dir_name
mkdir: cannot create directory dir_name: Read-only file system

Which is weird, since I've been running around, creating and viming files left and right for the last few hours. 

What is more lsblk and fstab alike will assure me my root partition is not read only:



#lsblk
name    maj:min rm size   ro type mountpoint
nvme0n1p1 259:1  0  220G  0  part / 
nvme0n1p3 259:3  0  600M  0 part /boot

The second is my efi partition, which I mounted to /boot (it was previously on /efi)


#cat /etc/fstab
UUID=uuid_here   /   ext4   rw,relatime   0  1
UUID=uuid_here   /efi  vfat   rw,relatime,fmask=0022,dmas=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro   0  2

Note that fstab has not yet been updated and still thinks the efi partition is mounted on /efi. Of course,I can't update it if I can't write on the filesystem, but I don't think that has anything to do with the problem.

What do you make of this? What could have caused this?

P.S. Commands were executed from arch-chroot /mnt.
I'm still booting from my installation USB. For that reason I have been hesitant to reboot before fully completing the installation.
That said, the USB's environment is not read-only, so there's that.

Last edited by silberblume (2020-12-27 23:02:43)


There's nothing scarier, nothing more deadly than an ambulance

Offline

#2 2020-12-27 22:20:53

seth
Member
Registered: 2012-09-03
Posts: 58,797

Re: [SOLVED] Root filesystem suddenly read only

There're typos or errors in the fstab.

Can you write to the disk when not chrooting (ie. "# touch /mnt/dummy", assuming nvme0n1p1 is mounted to /mnt)?

Offline

#3 2020-12-27 22:41:10

silberblume
Member
Registered: 2020-12-27
Posts: 5

Re: [SOLVED] Root filesystem suddenly read only

You're right. I was just fixing those. Indeed I couldn't write to the disk from outside the chroot, and got some worrying SQUASHFS errors. I fixed the typos and I can now both access the filesystem from within and without the chroot, and I actually found a way to make it rw by unmounting and remounting.

I ran this from within the chroot.

  mount -n -o remount,rw / 

I think this  covers the first problem but I still don't understand why it became read-only in the first place?
Also, I still get those messages I don't really understand when cding into /mnt

 chpwd:8: read-only file system: /root/zdirs 

Also, I can't run this

  genfstab -U /mnt >> /mnt/etc/fstab 

without getting

[35741.340129] blk_update_request: I/O error, dev loop0, sector 19234 op 0x0:(READ) flags 0x800 phys_seg 72 prio class 0 

followed by half a dozen SQUASHFS errors: failed to read/block/fragment cache entry/page,block x

Some variant of this message will also periodically pop up:


[35985.261043] sd 3:0:0:0: [sdb] Assuming drive cache: write through  

Edit : I also can't vim my /etc/fstab from outside the chroot, I get SQUASHFS errors.

Last edited by silberblume (2020-12-27 22:43:28)


There's nothing scarier, nothing more deadly than an ambulance

Offline

#4 2020-12-27 22:51:06

seth
Member
Registered: 2012-09-03
Posts: 58,797

Re: [SOLVED] Root filesystem suddenly read only

SquashFS is the installation iso, which seems compromised (there should™ be an overlayfs augmenting the FS on the usb key and allow you transient writes into the iso)
How's the situation when booting the installed system?

Offline

#5 2020-12-27 22:57:26

silberblume
Member
Registered: 2020-12-27
Posts: 5

Re: [SOLVED] Root filesystem suddenly read only

I rebooted and removed the installation media. Booting just gives me GRUB, but since I still haven't read up on those things, I don't know whether that's what's supposed to happen.


There's nothing scarier, nothing more deadly than an ambulance

Offline

#6 2020-12-27 22:58:19

seth
Member
Registered: 2012-09-03
Posts: 58,797

Re: [SOLVED] Root filesystem suddenly read only

GRUB is the bootloader and should™ allow you to boot arch.

Offline

#7 2020-12-27 23:01:43

silberblume
Member
Registered: 2020-12-27
Posts: 5

Re: [SOLVED] Root filesystem suddenly read only

Hmmmmmmmmmmmmmmmmm

I am not getting a menu, so I'll make sure my grub.cfg is okay, try to add some menu commands my eye caught on the wiki GRUB page and see where it goes. The initial problem is fixed, though, so I guess I'll mark this as solved

Edit: Rebooting into my install medium did resolve all of the aforementioned problems too, no SQUASH errors now. I think it might have had something to do with my USB briefly/partially disconnecting, leading to corruption, if that makes sense.

Last edited by silberblume (2020-12-27 23:06:52)


There's nothing scarier, nothing more deadly than an ambulance

Offline

Board footer

Powered by FluxBB