4

I am using a ubuntu virtual host to host some websites. Sadly, I had some troubles and had to hard-reboot the server and now it seems like the file system is corrupted. Although, I am able to boot and use it, it is not possible to update the system:

root@myserver:~# apt update
Hit:1 http://mirror.scaleway.com/ubuntu zesty InRelease
Hit:2 http://mirror.scaleway.com/ubuntu zesty-updates InRelease                                                                                       
Hit:3 http://mirror.scaleway.com/ubuntu zesty-security InRelease                                                                                      
Hit:4 http://archive.ubuntu.com/ubuntu zesty InRelease                                                                                                
Get:5 http://archive.ubuntu.com/ubuntu zesty-updates InRelease [89.2 kB]                                                                              
Hit:6 http://ppa.launchpad.net/olipo186/git-auto-deploy/ubuntu zesty InRelease                                                          
Hit:7 http://mirror.klaus-uwe.me/mariadb/repo/10.2/ubuntu zesty InRelease                                                               
Get:8 http://archive.ubuntu.com/ubuntu zesty-security InRelease [89.2 kB]           
Fetched 178 kB in 2s (71.9 kB/s)                               
Reading package lists... Error!
E: flAbsPath on /var/lib/dpkg/status failed - realpath (117: Structure needs cleaning)
E: Could not open file  - open (2: No such file or directory)
E: Problem opening 
E: The package lists or status file could not be parsed or opened.

I found some solutions on the web (e.g., (fsck.ext4 /dev/nbd0), but all require to unmount the drive first. But what to do if the root filesystem is affected?

Is it possible to repair a mounted volume using fsck.ext4?

EDIT: I tried to force a check on reboot by creating a forcefsck file in the root file system. It successfully triggered a check, but I still get the same error when I want to update the system. Are there any other options to repair the system?

1 Answer 1

8
sudo touch /forcefsck

and a reboot will force a check on /.

3
  • I tried it and it successfully triggered the check. But it seems like it was not able to fix all the error. Do I have any other possibilities to "easily" repair the system, or should I directly go for a new installation?
    – NaN
    Aug 27, 2017 at 6:27
  • Did you get any solution? I'm currently stuck in same situation and the answer not helped me! Oct 15, 2020 at 13:03
  • Mind that this original question is about a virtual system. If a filesystem check does not fix this it could be an actual hardware problem
    – Rinzwind
    Oct 15, 2020 at 13:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .