3

Ever since following this tutorial to migrate my sistem from my HDD to my SSD I have been getting an intermittent error where running any command I get something like this:

sudo: unable to open /var/lib/sudo/foo/0: Read-only file system
sudo: unable to execute /sbin/fsck: Input/output error

And the only way I can fix it is by hard rebooting my machine.

This used to happen ruffly once every two weeks and I have no idea why.

Now it happens every Sunday at ~8:00 am.

I really have no idea where to start when debugging this issue any tips would be greatly appreciated. I have done tests on my RAM and on my SDD but nothing seems to be untoward to me. I am sorry for such an open ended question but I am desperate to solve this issue ASAP.

EDIT:

Replaced the 2010 sandisk SSD and hasn't happened since. Moral of the story - don't buy old SSDs on eBay :)

maxisme
  • 131

2 Answers2

2

You can try to force a check of all file systems skipping mounted ones with the -M option

 sudo fsck -Af -M 

If it fails perhaps you can try for ext4 filesystems

 sudo fsck.ext4 -f /dev/sda1 > fsck-output.txt

You can change to ext3 depending on your filesystem type.

The Recommended filesystem for Linux systems would be EXT4 with TRIM intended to improve performance through reduced write cycles to the SSD drive given the limited write-rewrite cycles.

Check for output in the fsck-output.txt file for any errors or use dmesg to get any errors not printed on screen and let me know how it goes.

Regards Douglas and hope it works out.

Zuko
  • 1,277
0

Since this error started with the new SSD, I'd recommend checking the connection. If the disk is connected via SATA, that means both ends of the cable: Unplug and plug in again.

If the problem does not disappear, I'd recommend checking the SSD itself with whatever you have available. There might be some low-level tools from the manufacturer, there might be some data in the SMART logs.