root is read only (Btrfs error)

Hi,

I upgraded from leap 42.1 to tumblweed last weekend. And yesterday i issued the command ‘zypper up’ and it did not completed well. And someone turned of the pc. So when i issued this command next time it doesn’t going well.


rajesh@linux-f152:~> sudo zypper up
sudo: unable to open /var/lib/sudo/ts/rajesh: Read-only file system
[sudo] password for root: 
Bad media attach point: http://download.opensuse.org/tumbleweed/repo/oss/

When i switch to command mode ‘ctrl+alt+f2’ after login into root, following error happens.

Systemd-journald ID[381]: Failed to truncate file to original size. read only

I searched on form for similar problems. https://forums.opensuse.org/showthread.php/508294-btrfs-error-read-only In this thread user solved problem by rescue cd. I only have Leap 42.1 bootable pendrive. So can this rescue my tumblweed.
In another thread user just reinstalled everything. So no help there.

I am able to use tumblweed but since no ‘sudo’ is working, ‘dolphin in super user mode’ is not working. Basically write operation are all prohibited.

Some output which may be helpful. Issued from ‘Konsole’.

rajesh@linux-f152:~> sudo lsblk -o NAME,FSTYPE,SIZE,TYPE,MOUNTPOINT
sudo: unable to open /var/lib/sudo/ts/rajesh: Read-only file system
[sudo] password for root: 
NAME   FSTYPE   SIZE TYPE MOUNTPOINT
sda           111.8G disk 
├─sda1 swap       2G part [SWAP]
├─sda2 btrfs     40G part /var/opt
└─sda3 xfs     69.8G part /home
rajesh@linux-f152:~> sudo parted -l
sudo: unable to open /var/lib/sudo/ts/rajesh: Read-only file system
[sudo] password for root: 
Model: ATA PNY CS1311 120GB (scsi)
Disk /dev/sda: 120GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  2155MB  2154MB  primary  linux-swap(v1)  type=82
 2      2155MB  45.1GB  43.0GB  primary  btrfs           boot, type=83
 3      45.1GB  120GB   74.9GB  primary  xfs             type=83

rajesh@linux-f152:~> sudo gdisk
sudo: unable to open /var/lib/sudo/ts/rajesh: Read-only file system
[sudo] password for root: 
GPT fdisk (gdisk) version 1.0.1

Type device filename, or press <Enter> to exit: /dev/sda
Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************


Command (? for help): p
Disk /dev/sda: 234441648 sectors, 111.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 1E2BECA8-5FD1-4398-8DE7-385D95349B81
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 234441614
Partitions will be aligned on 2048-sector boundaries
Total free space is 2925 sectors (1.4 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         4208639   2.0 GiB     8200  Linux swap
   2         4208640        88100863   40.0 GiB    8300  Linux filesystem
   3        88100864       234440703   69.8 GiB    8300  Linux filesystem
rajesh@linux-f152:~> sudo e2fsck -v /dev/sda2
sudo: unable to open /var/lib/sudo/ts/rajesh: Read-only file system
[sudo] password for root: 
e2fsck 1.43.1 (08-Jun-2016)
/dev/sda2 is in use.
e2fsck: Cannot continue, aborting.

I tried ‘snapper’ but still got these error.

H/W: Core2Duo E7300, no GPU, SSD PNY cs1311.

Any help is apriciated. (sorry for bad english).

Hi rajesh_kumar

That doesn’t sound good.
If an update doesn’t complete, then the state of your system isn’t really clear, and usually you will not be able to repair it, because you don’t know which files are bad and which aren’t.

What about power supply?

maybe fstab got corrupted?
what does /etc/fstab say about root?
did you try using yast/snapper to roll back to a previous state, I’m not sure if you can run snapper from a rescue disk as btrfs is a file system based backup you should be able to restore a previous state
ps
TW users need to use zypper dup for updates

Thanks @ratzi and @I_A for your response.
Actually I am new to opensuse (actually to linux world). And I figured out that I messed things badly :silly:. So I installed a fresh leap installation Leap 42.1. And since I have only one PC i will continue with this until i will get another one (which i will build soon :smile:). So that my work don’t get interrupted if i mess things again.