Archive for December, 2011

Setting Android and Path environment variables on Mac OS X

December 21, 2011 2 comments

When bash starts it reads the following files every time you login. For the purposes of OS X, this means every time you open a new Terminal window.

  • /etc/profile
  • ~/.bash_profile
  • ~/.bash_login (if .bash_profile does not exist)
  • ~/.profile (if .bash_login does not exist)

When you start a new shell by typing bash on the command line, it reads .bashrc

Finally, OS X also uses ~/.MacOSX/environment.plist to set more environment variables, including paths if necessary.

Add Android and PATH variables to ~/.profile, e.g.:

export ANDROID_HOME=/Users/cduu/Development/bin/android-sdk/android-sdk_r15-macosx_x86
export PATH=/Users/cduu/Development/bin/android-sdk/android-sdk_r15-macosx_x86/platform-tools:/Users/cduu/Development/bin/android-sdk/android-sdk_r15-macosx_x86/tools:$PATH

Check environment variables in a new Terminal with:

Categories: Android, Development, Mac OS X

Reinstall Grub 2 after installing Windows 7 or reinstalling Windows Bootmanager (MBR)

An easy way is to use a Ubuntu livecd.

  • Boot Ubuntu 11.10 with the livecd
  • Start the disk utility with the command palimpsest to find the partition where Ubuntu was installed to. On my hard disk it was /dev/sda5.

  • Use your partition number instead of the 5…:
sudo -i
mount /dev/sda5 /mnt
grub-install --root-directory=/mnt/ /dev/sda
  • restart
Categories: Linux, Ubuntu, Windows 7

Restore Windows 7 Bootmanager (BOOTMGR is missing)

December 19, 2011 2 comments
  • Boot Windows 7 with DVD and press Shift + F10
  • start the program “diskpart
    • list disk shows hard drives
    • select disk x choose the hard drive x
    • list part shows partitions of hard drive x
    • select part y choose partition y
    • detail part shows informations of the partition; check if it is active
    • active activate the partition as boot-partition
    • exit exit diskpart
  • fix the boot record:
bootrec /ScanOs
bootrec /fixmbr
bootrec /fixboot
  • try auto-repair a few times

if windows is still not booting:

  • copy “bootmgr” and the directory “boot” of Windows 7 DVD to the root directory of your Windows 7 partition
  • fix the boot record:
bootrec /ScanOs
bootrec /fixmbr
bootrec /fixboot
Categories: Windows 7