Linux Volume Cleaning
Sometimes a virtual linux machine will not start up properly due to a file system issue. If this happens, a manual file system check (fsck) will need to be performed.
To perform a manual file system check you will need to boot into GParted followed various commands in the system.
Below is a step by step guide to fix this problem:
- Log into vCenter
- Find the machine that is having the issue
- Power Off the machine
- Click on Edit Settings
- Click on Options
- Choose to boot into the bios on next boot
- Start the machine
- When in the bios mount the GParted and change the boot order to have the CDROM first
- the GParted disc can be found on Nerd>ISO>Linux
- An alternative option is that when the machine boots up press ESC. This will allow you the time to add the GParted disc and boot menu will appear
- Choose GParted Live (default settings)
- Choose Don’t Touch keymap
- Press enter to choose the default language which is English
- Choose 2
- Type fdisk -l
- This will list all of the disks that will need to fsck
- Make a note of the this, but it will also be onscreen
- Type fsck -y /dev/<device boot from step 13>
- Example is fsck -y /dev/sda1
- Errors may appear but can be ignored
- the -y is to try and automatically fix any errors found
- Repeat step 14 for all devices in step 13
- Type reboot
- Eject/remove the disc when told to
In the case of an LVM that is dirty do these commands.
vgchange –ignorelockingfailure -ay
The LVM should be active now
lvscan –ignorelockingfailure
Now you can run fsck on the LVM
fsck -y /dev/mapper/LVM label
Once all partitions are clean, issue the command shutdown -h now. Remove Live CD and turn back on.