Archive | March, 2015

Ubuntu PHP

12 Mar
Configuration File (php.ini) Path   /etc/php5/apache2

FSCK needs to be run manually on VM start

10 Mar

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:

  1. Log into vCenter
  2. Find the machine that is having the issue
  3. Power Off the machine
  4. Click on Edit Settings
  5. Click on Options
  6. Choose to boot into the bios on next boot
    PSPHP - Virtual Machine Properties
  7. Start the machine
  8. 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
  9. Choose GParted Live (default settings)
  10. Choose Don’t Touch keymap
  11. Press enter to choose the default language which is English
  12. Choose 2
  13. 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
  14. 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
  15. Repeat step 14 for all devices in step 13
  16. Type reboot
  17. 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.