1

After a sudden power failure, my machine(Lubuntu 16.04) is facing the same issue described here.

My machine is booting into a terminal. And when i execute startx command, it gives :

(EE) Could not create lock file in /tmp/.tX0-lock

So in order to execute sudo X -configure i ran the below command and got error described below.

sudo mount -o remount,rw /

[2112.489077] EXT4-fs error (device sda1): ext4_remount:4667: Abort forced by user
mount: cannot remount /dev/sda1 read-write, is write-protected

So I boot into a live system and chose rescue a broken system and in a shell with /dev/sda1 mounted to / and executed the following commands

sudo mount -o remount,rw /

And it executes without any errors.

After I executed the following

sudo fsck /dev/sda1

The result was clean with no errors.

After that, i executed the following command.

sudo X -configure

then the machine restarted itself and got the same they which I described in the first part of this question.

Update

I tried another live image of Ubuntu 16.04.

Now when i run fsck.ext4 -f /dev/sda5 from the live image, it says /dev/sda5 is mounted.

But when i run umount /dev/sda5 it says /dev/sda5 is not mounted.

I believe the issue is with my /dev/sda5 partition. Am i correct?

How can I fix my machine? Any small help would be appreciated

George Udosen
  • 36,677
Rooney
  • 965
  • Look at this: https://unix.stackexchange.com/questions/74090/linux-how-to-change-hdd-state-from-readonly-after-temporarly-crash – George Udosen Dec 08 '17 at 21:46
  • No luck, both commands blockdev --setrw /dev/sda and hdparm -r 0 executed successfully, and got response for hdparm as readonly = 0. But still unable touch or execute X-configure. – Rooney Dec 09 '17 at 06:29

1 Answers1

0

Finally i managed to fix the issue.

The issue was due to corrupted(not really) entry for swap partition in my /etc/fstab. Swap entry was /dev/sda5 instead of its UUID.

I believe the system failed to detect my swap partition from fstab and caused this issue turning my all file system read only.

So replacing the swap name from /dev/sda5 to its UUID in /etc/fstab from a live USB fixed the issue.

But i haven't changed anything in /etc/fstab before this issue started and don't know why this issue happened.

This answer explains why we need to add UUID in fstab instead of /dev/sd_

Rooney
  • 965