2

Background

My power went out during some rain recently while I was away from home. When I got back the power was still out and when it came back on, my system seems to have suffered some issues.

Some information about my system:

It is a desktop running Windows 10 Professional installed on two SSDs setup in RAID0. It also has a RAID5 array of three 6TB disks used for bulk storage of media.

I run pretty much everything inside of a Linux Mint 18.3 Guest OS using Virtualbox.

The main virtual disk (VDI) on which Linux Mint is installed is stored on the SSDs, and all of the media on my RAID5 array is shared with the Linux guest OS via the shared folder feature of VirtualBox.

Details

When power was restored to my place, I tried powering up the machine. The Windows 10 host OS booted fine, it didn't even need to run a disk check or anything that I noticed. Seems to be running fine.

When I tried to start up my Linux Mint VM, it also seemed to boot fine, but when I tried to check for OS updates I get the following error:

E: Can't write /root/.synaptic/selections.update

W: Not using locking for read only lock file /root/.synaptic/lock
W: Not using locking for read only lock file /root/.synaptic/lock.non-interactive

After this I realized that my entire main file system that linux was installed on was mounted in read only mode. I am unable to create a new files or write to any existing files. From what I have read it seems that Linux is automatically booting into read only mode because the file system may be corrupted.

I am currently backing up the entire virtual disk image. It is almost a terabyte, so it still has several hours left, after which I am going to attempt to repair the VM.

Question

The advice I found briefly searching the web was that I should run the fsck command to try to repair the file system, but that I can only do this on an unmounted file system. From what I read it was recommended to boot from a USB/LiveCD and use that to run fsck on the unmounted file system.

Is it possible for me to do this for my VirtualBox VM? If so, how? Does anyone have any other advice on how I can go about attempting to repair this system?

  • 2
    You can put a Linux LiveCD ISO into your virtual optical drive, start the machine, boot from it and then run fsck on your partitions. – Freddy May 19 at 0:44
2

Answer:

File recovery on ext3/ext4 file system is not easy at all compared to NTFS. For your issue indeed running fsck from an other system will get you back on track, but you will need to check your partition/files to see if nothing is missing. Most of the time when a file is lost on ext file system it result in a zero byte file or the file become completely missing. Indeed, a power loss can cause some harm to your files but normally that should not be too much of an issue because most of the impacted file are those on the SSD-Cache/Ram at the moment of the power loss. Also, check all your SSD with the manufacturer tools to get their state and see if they were not impacted.

Going back to your virtual disk and how you can fix it, just download any live ISO linux distribution, mount it on your virtual machine, boot on it and run the scan on your disk from there. If you are more of a GUI person, you can use KDE-Partition-Manager after the scan just reboot and remove the ISO file; you should be good to go.

How to recover lost files

Quote from my other answer here

Recovery Tools - Command Line:

Recovery Tools - Gui:

Infos:

In my personal experience I get my data back using ufs-explorer and photorec

(1) = Not open source, not free

(2) = Not open source, free

(3) = Open source and free

(4) = Have NTFS support

(5) = Have directory structure feature

Search lost files

In the case of zeroed files, you can use this command on important directory to search zero sized files, but bear in mind that most of what you will find are legit files that are indeed zero byte files; you will need then to check the result list and search for suspicious missing files.

find . -size 0 -print

Also, as I mentioned, most of the impacted files are those loaded on the cache thus I advise you to check the files/applications that were used when the crash occurred.

Lastly, Virtualbox has a snapshot feature: you can use that to make backups quickly in an efficient way.

  • 1
    Thank you for the detailed answer. I will give this a shot as soon as the backup process has finished. – Cory Gross May 19 at 1:14
  • you are welcome... i updated my answer ;) – intika May 19 at 4:11
  • So what ended up happening was that when I rebooted my VM next time it would only go into the command line in initramfs. From there I was able to run fsck on the file system. It repaired a number of errors, all of which looked like they were in Google Chrome's temporary files. Now it seems everything is fixed. – Cory Gross May 19 at 7:40
  • Great :), probably that chrome was opened when the crash occurred... – intika May 19 at 8:07
  • By the way an other solution if you where using linux as the vm host would be mounting the vm disk on the host and fix it there... it's probably doable on windows too but not as easy as linux... – intika May 19 at 8:10

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.