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
  • any info in /var/log/ that might help? – Rinzwind Jun 07 '16 at 15:59
  • Nothing obvious no. – maxisme Jun 07 '16 at 16:05
  • If it's on a regular time interval, I'd start poking around cron, perhaps there's some script with a typo in there. When it goes RO, does mount show that it's read only? If so, it was (re)mounted that way (autofs perhaps), if not, then it might be the ssd drivers. Have you tried updating your system? – Tim S. Jun 07 '16 at 16:25
  • Same here, but with FAT32? – fosslinux Jun 08 '16 at 01:18
  • @Maximilian look into your /etc/crontab file. The fact that it occurs on specific day of week and specific time, suggests you might have a scheduled cronjob. Look for entries with 8 in second column. – Sergiy Kolodyazhnyy Mar 06 '17 at 12:12
  • @Serg yesterday it was at 07:52 – maxisme Mar 06 '17 at 12:17
  • I would ask for the content of /var/log/syslog around the last time this issue occurred, but /var is on the file system that was just switched to read-only. However you can poke around in the output of dmesg -T which resides in a memory buffer but it doesn't reach too far back. – David Foerster Mar 06 '17 at 17:37
  • This is the dmesg: http://pastebin.com/1zEN8Ju3 – maxisme Mar 06 '17 at 18:14
  • Why not just reinstall Ubuntu? It's possible to reinstall without losing your data. See my answer here: http://askubuntu.com/a/841310/518562 – You'reAGitForNotUsingGit Mar 08 '17 at 14:56
  • 1
    @AndroidDev I am 200 miles away from my server – maxisme Mar 08 '17 at 14:57

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,267
  • 11
  • 12
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.