19

Recently while using my VirtualBox VM, the system crashed. Afterwords, the VM would no longer boot (I am using Vagrant). In my troubleshooting, I turned on the VirtualBox GUI and found that the reason the VM is no longer booting is due to the following error:

Couldn't remount RDWR because of unprocessed orphan inode list.

I searched for this error on Google and found that this may be caused by file system corruption, but it may be fixable with a simple unmount/remount. Unfortunately, I can't get to a console to do this, or at least I can't figure out a way to. Is there a way I can fix this error without a console, or in lieu of that, is there a way I can access a console in my VM without being able to mount the virtual hard drive?

2 Answers 2

38

I managed to solve this problem this morning. Here are the steps I took in case anyone else encounters this problem:

Download a bootable linux .iso.

I am running Ubuntu 14.04 x64 in my VM, so I decided to download the 64-bit Ubuntu 14.04 installation .iso from here. It shouldn't really matter what release you download, as long as it supports your file system and you are familiar with it.

Mount the .iso file in the VM as a virtual CD-ROM.

From the console, run virtualbox to open the Virtual Box configuration GUI. From there, go to: Settings -> Storage -> Add CD/DVD Device -> Choose disk. Browse to the .iso file you just downloaded.

Boot from the .iso file.

Now start the boot process for your VM by using the command vagrant up. During boot, you should be prompted to press a key to select a boot device (For me it was F12). Now select CD-ROM to boot from. The .iso you downloaded should boot. If you are using Ubuntu, select Try Ubuntu. Now, start a Terminal window.

Unmount and fsck the disk

In the terminal, you may first have to unmount the virtual HDD. If your disk is /dev/sda1, use the following command:

sudo umount /dev/sda1

You can then run fsck on the disk:

fsck /dev/sda1

After confirming the fixes, reboot the VM. All should be back to normal.

6
  • Timely help, when an eclipse crash left me hanging dry.
    – GuSuku
    Oct 6, 2015 at 3:52
  • 9
    This works! As an additional tip, after you mount the bootable CD in VirtualBox settings make sure you go to the "Systems" tab and select CD/DVD in "Boot Order". Also, you can put it on top to force booting from the cd while making the fix (the F12 did not work on my Mac...).
    – RayOnAir
    Apr 13, 2016 at 23:16
  • 3
    This worked with steps suggested by @RayOnAir . Additionally Ubuntu Server image did not work i had to use Desktop image to use the fsck command. Jun 8, 2016 at 22:25
  • 2
    To clarify: the step "Now, start a Terminal window" is performed from within Ubuntu in the guest machine. Click the Ubuntu icon in the upper left, type "terminal", and click the Terminal app icon. Oct 20, 2018 at 17:19
  • 1
    This just saved me! Another tip, I had to use sudo to run fsck - sudo fsck /dev/sda1
    – jessica
    Apr 4, 2019 at 17:31
0

I was facing the same issue on an AWS EC2 machine. To complicate the resolution, the volume that was affected was the root volume of the EC2 instance. Hence the device was failing to boot and SSH was also not possible to the instance.

The following steps helped me resolve the issue:

  1. Detach the volume from the EC2 instance.
  2. Configure a new EC2 instance using the same AMI and in the same AZ as that of the old one.
  3. Attach the volume (detached in Step 1) to the new instance.
  4. Execute the following commands:
# Switch to Root user:
sudo -i

# Identify the device Filesystem name and save it as a variable:
lsblk
rescuedev=/dev/xvdf1    # Mention the right Filesystem for the particular volume.

# Use /mnt as the mount point:
rescuemnt=/mnt
mkdir -p $rescuemnt
mount $rescuedev $rescuemnt

# Mount special file systems and change the root directory (chroot) to the newly mounted file system:
for i in proc sys dev run; do mount --bind /$i $rescuemnt/$i ; done
chroot $rescuemnt

# Download, install and execute EC2Rescue tool for Linux to fix the issues: 
curl -O https://s3.amazonaws.com/ec2rescuelinux/ec2rl.tgz
tar -xf ec2rl.tgz
cd ec2rl-<version_number>
./ec2rl run
cat /var/tmp/ec2rl/*/Main.log | more
./ec2rl run --remediate

# Switch back from the Root user and unmount the volume:
exit
umount $rescuemnt/{proc,sys,dev,run,}
  1. Shut down the EC2 instance and detach the volume.
  2. Attach the volume to the original instance and start the EC2 instance.

You must log in to answer this question.

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