12

My Ubuntu 14.04.2 computer has suddenly started displaying various serious errors.

It started when I was working on my Ruby on Rails app, left it for a while, came back, and tried to restart my server with rails s. In response, I got back this error:

Rails Error: Unable to access log file. Please ensure that /home/user/app/log/development.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.

I tried to run chmod 0666 /home/user/app/log/development.log and then various other chmod commands, like chmod 0664 and chmod 777. Each time I got back:

chmod: changing permissions of ‘/home/user/app/log/development.log’: Read-only file system

I tried other Rails apps and got the same error with them. Then I tried to save the file I was working on with Komodo IDE and quit, but Komodo told me the file was read-only and couldn't be saved.

Then, I noticed that my Skype had signed itself out, and when I tried to sign back in, it told me that I was already signed in.

So I restarted my computer. On the login screen, I got an error message, something like Errors were found when searching directory /. Press f to fix, I to ignore, and M to run a manual reboot.

I pressed I to ignore and signed in. Now I can't open Skype or Komodo at all. When I click on the icons they flash a few times like they are about to open, but then they just stop flashing and nothing happens.

Also, rails s, no longer returns an error, it literally just closes my terminal window.

When I run mount, half the time the terminal just closes, and half the time I get this message:

$ mount
/dev/sda2 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /sys/firmware/efi/efivars type efivarfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
/dev/sda1 on /boot/efi type vfat (rw)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=greg)

mount: warning: /etc/mtab is not writable (e.g. read-only filesystem).
   It's possible that information reported by mount(8) is not
   up to date. For actual information about system mount points
   check the /proc/mounts file.

I also just noticed that all my files have a lock icon over them. I assume this means all my files are read-only.

The output of:

sudo smartctl --all --tolerance=verypermissive /dev/sda

can be found here

What could be going on??

5
  • Please delete all your comments to keep things tidy here and drop by the AU chat and ping @ Fabby or @ A.B. when you've got the hard drive and you hit a snag on the way... – Fabby Oct 13 '15 at 20:17
  • You have some serious file system corruption. From the information in the question I cannot say whether it is caused by a hardware problem or something else. – kasperd Oct 13 '15 at 21:36
  • Going to sleep now... Ping me or A.B. in the chat when you wake up... – Fabby Oct 13 '15 at 23:53
  • @Fabby Okay this is pretty embarrassing, but I can't figure out how to ping other users.... – Jeff Caros Oct 14 '15 at 23:52
  • @JeffCaros: you just pinged me: Leave a comment with an @ before the name of the user. I can regularly be found in this chat room. Do the same there... – Fabby Oct 15 '15 at 10:09
12

This looks a lot like your file system is mounted read-only prior to a drive failure...

So please stop using the computer, shut it down completely and:

  1. Open your computer and check the hard disk. If it is not attached to its controller board, then buy a new external hard drive bigger then your current hard drive. It it is attached to its controller board, then buy a new internal hard drive with the same connector type.
  2. Insert it in your computer (If it is a laptop, buy an external USB HDD in the step above)
  3. Boot an Ubuntu Live DVD and choose Try Ubuntu
  4. Press Ctrl+Alt+T to go to a terminal and type:

    sudo apt-get install gddrescue
    sudo ddrescue --binary-prefixes --cluster-size=64 --sparse --timeout=20s /dev/WdX /dev/YdZ
    

    Note : W and X are the drive letters of your nearly broken hard drive and Y and Z are the drive letters of your new hard drive.

  5. If that works fine without any errors, we'll be testing whether my gut feeling is right:

    sudo apt-get install smartmontools
    sudo smartclt --scan
    
  6. Then perform :

    sudo smartctl /--test:short dev/XdY
    

for all devices that came up during the scan.

Then give feed back please!

Edit: I'm very sorry to have to tell you that your drive is dead.

Please swap the external drive with the internal drive and re-install Ubuntu on the new drive without attaching the old drive. Then hook up the old drive through the USB enclosure and try again... Maybe (extremely unlikely) you can recover some more data off it that way.

8
  • With the "errors were found when searching directory /" message, which the OP ignored, i'm afraid it's already too late for that, and the only way to salvage at least a part of the data is run fsck -y on the copy and search the lost+found directory. Apart from this, the post ist exactly the right thing to do. – Guntram Blohm Oct 13 '15 at 22:18
  • @GuntramBlohm Yup, that's the plan... – Fabby Oct 13 '15 at 23:13
  • Um...okay so I tried booting with a liveDVD. No option came up to "Try Ubuntu", but this time I pressed f "to fix errors". The computer booted up and all the errors went away. Is there any harm in just continuing to use the computer? – Jeff Caros Oct 14 '15 at 16:52
  • Could you please provide the output to sudo smartctl /--test:short dev/XdY? – Fabby Oct 14 '15 at 21:53
  • Anyone with this problem in the future should be advised that not every hard disk can be swapped with an external hard drive. Check if your hard disk is attached to its controller board before buying a new external hard drive. – Jeff Caros Oct 17 '15 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.