Adsense 1

Thursday, October 10, 2013

Ubuntu 13.10 Beta testing issues in upgrading few packages

I upgraded to Ubuntu 13.10 Beta couple of weeks back. Dist-upgrade exited with error. I didn't give attention to the error that time. Since last week i noticed that some package upgrades failed. Trying to troubleshoot it i found that initscripts installation is failing with error - cannot create cannot create /var/log/dmesg: Is a directory. To my surprise there was directory /var/log/dmesg and under that there were some files like boot-repair.log and one directory each of the partition i had (eg: /var/log/dmesg/sda). Since this was a test setup i went ahead and moved the directory sudo mv /var/log/dmesg /var/log/dmesg.old

Then did this: sudo apt-get update && sudo apt-get dist-upgrade

Voila! all packages installed correctly. Note that while i had around 64 packages waiting to be installed (and unable to install) because of this issue the system was fairly stable and didn't face any issue operating it normally. I did not use it heavily though

Saturday, August 24, 2013

Recovering Windows 8 bootloader in UEFI BIOS dual booting Ubuntu

Continuation of my last post...My experience recovering Windows 8 boot loader

Recovery attempt using Windows Installation/Recovery Disk

Since none of my previous attempts to restore Windows 8 boot loader worked, the only option i have now is to somehow recover windows 8 without losing data or my partitions. I had created a recovery point in windows but that will work only if i could somehow boot into windows using installation or recovery CD. Unfortunately i did not create recovery disk yet since this was new laptop. I also found a recovery disk here but didn't try it since i wasn't sure if it was safe to use.

I didn't have windows 8 OS media either. Downloaded it from the Internet and burned it into a DVD using the external DVD i had (my laptop doesn't have optical drive). In parallel tried to find and read as much help as i could possibly find in the Internet. Below I have back linked some of the links I got much info from.

Attempt to recover using Windows 8 installation media

Booted to Windows 8 from the DVD i just created. It did not ask for "Repair windows" option as mentioned in the tutorial here. Instead it just asked me to choose the Keyboard layout and went ahead with installing Windows 8. So i cancelled it immediately. I didn't want to install the OS again - all i wanted was to find a way to recover the existing OS. Note that if this step had showed me that windows is present in the disk and the recovery options for the same it would have been easy.

Attempt to recover using Windows 8 Recovery disk

I had a Windows 8 recovery Disk from another computer (HP laptop). I booted from the recovery CD. It showed the following options as shown here: System Restore, System Image Recovery, Automatic Repair and Command prompt). First tried the System Restore option and it threw error saying it couldn't find any image. Strange since i had created an image. Entered into command prompt to troubleshoot the same and found that hard disk wasn't detected. This may be because driver for the hard drive was not present in the recovery CD (may be because the recovery disk I used was for another laptop). I had all drivers in another partition in my laptop. So booted to Ubuntu, copied the drivers to an external USB drive. Rebooted using recovery CD again. Went into command prompt and loaded the drivers for my harddrive using drvload command. I was able to see the drive and all partitions in the drives from command prompt. Read this for more help on listing drives from command prompt.

Attempt 1:

I could see my windows partitions. So proceeded with boot loader recovery.

bootrec /fixmbr
bootrec /fixboot

Rebooted. Still couldn't boot into windows (not sure why!). I felt that using recovery disk of another laptop might be risky but i am not sure if that is true. But now that i know the problem we saw above (no recovery option shown) was due to driver issue, may be i can load the drivers manually and attempt other options. So tried that. 

At the installation prompt Hit Shift+F10 and used drvload to load drivers. As soon as i came out of command prompt it showed me the Recover Windows Option. 

Selected Recover Windows option (had to load the drivers manually again). Then tried few more bootrec commands in command prompt:

bootrec /fixmbr
bootrec /fixboot
bootrec /scanos
bootrec /rebuildbcd

Rebooted. Still couldn't boot into windows; all it showed was a blank screen and i still don't have a clue why it didn't work. I could sense where this is going (reset?) but continued.

Note, for all the below trials I booted from Windows 8 installation media, Loaded drivers manually using Shift+F12 and Drvload and choose Recover Windows Option. Since this was a generic Windows 8 installation media i thought it would be safe to try other Recovery options. 

Trial 1:

First i tried Automatic Repair. It ran but after that too still i couldn't boot to windows 8. 

Trial 2:

Tried the System Restore option. It showed me the recovery point which was created when i installed EasyBCD. It said EasyBCD won't be available if i use that image since that was what i wanted i proceeded with that option. After 20 mins or so restore completed. 

Rebooted the machine and boom blank screen! May be this option wouldn't restore bootfiles or bootrec - so i thought.

Trial 3: Success! At last

Tried the next option Refresh Windows. This asked me to select the drive. I selected c: (thankfully all my data were in other paritions). I started to "refresh" windows again. After about 30 mins i was able to boot to Windows but this time Windows 8 boot loader showed me 3 windows 8 options all pointing to the same copy. Booted into windows. In my desktop there was a file with the list of all programs removed from the system. It for some reason didn't have many of them like Office 2013, Firefox etc. Since my data partition had all programs downloaded already i reinstalled all required apps from that. Only thing i had to redownload was Office 2013 since it installs from Office 365 servers directly (One Click Install file).

So after a 20Hrs marathon fix I got back Windows 8 and access to outlook (i had a copy of my ost file so didn't have to download all mails again).

My experience recovering Windows 8 boot loader

This is in continuation of my experience trying to install Windows 8 with Ubuntu and my EasyBCD2.2 installation overwrote MBR. I wasn't able to boot into Windows 8 at all; all i had was two Windows 8 options shown by EasyBCD2.2 and neither worked.

Here i am writing down all the methods i used "as is". Please be cautious when trying out these as you may end up losing everything (i had a copy of my data elsewhere so did not worry too much). At this point i was ready to explore all options to recover Windows 8 so i could learn the methods along the way and use them for future issues. There may be other easy methods or advanced commands that could be used in this situation but i am not exposed to those (I am from Linux world!)

Recovery attempt through UEFI BIOS

First thing i tried was to see if i can do something from the BIOS. I have worked on different BIOSes over the past years still UEFI was little different. Here we could define the OS booting file from BIOS directly; none of the older BIOSes i have worked with had this feature. Below are some intuitional trials done by me in BIOS.

Points to note before doing this:
1. In UEFI you can add entries for multiple OSes - each pointing to a specific EFI file from a bootable partition
2. I didn't disturb the EFI boot partition when i installed Ubuntu so i assumed all boot files will be there.
3. When i selected boot files for an entry i could see three partitions in the list but i selected the boot file only from first partition since i knew it was the EFI boot partition (usually this partition will have a EFI directory under which all boot files are stored. These settings may differ if you had customized the location or removed/altered boot partition.

Now for the actual entry in BIOS - in the bios menu under boot order option you can see the entries already present. You can choose to retain existing entries or remove them to avoid confusion. For each trial I removed the existing entry for windows and created a new entry with new name (say windows, Windows trial etc.) and selected one of the bootx64.efi/bootmgfw.efi/bootmgr.efi files from the boot disk (Disk0 in my case). In earlier BIOSes if bootloader/MBR is corrupted you cannot boot into any OS; with UEFI to boot into second OS you can hit F12 to create temp boot menu and select the second OS. I always kept Windows as first boot option so i hit F12 and selected Ubuntu manually whenever i wanted to use Ubuntu.

Trial 1:
Tried to reset the BIOS to defaults, recreated the Boot entries for Windows 8 and Ubuntu. Ubuntu worked. When i selected Window 8 EasyBCD's menu showed up.

Trial 2 to N: Multiple unsuccessful trials. Couldn't keep the count :)
Hoping that EasyBCD would have kept a copy of the boot file in the boot partition, I tried creating new entries for Windows 8 by selecting various bootx64.efi files available in the boot partition (under EFI/Boot, EFI/Microsoft/Boot). I tried all bootx64.efi, bootmgr.efi and bootmgfw.efi files i could find in the partition. Nothing worked; all i got was EasyBCD2.2's boot screen (that doesn't load Windows in my system)

After several tries i understood that apparently EasyBCD2.2 had overwritten windows boot files. Note I also tried removing Ubuntu entries from UEFI and recreated it. I could boot into Ubuntu, through UEFI boot menu (by hitting F12), and use it all the time. This is to ensure if the entries i put in actually work.


Recovery attempt through Ubuntu

From Ubuntu, browsing internet, i tried some suggestions and tools to fix the windows 8 boot problem. After trying several choices in boot-repair tool i gave up. This trial was a mere test to see if boot-repair would restore the original Windows 8 boot files. As I expected it didn't work though boot-repair created a boot menu with all Windows EFI files available in the boot partition (obviously none of them worked ie., displayed EasyBCD2.2 menu)

The only choice i had at this point was to boot from a Windows 8 installation CD and do a restoration of boot files by running bootfix commands.

Monday, August 19, 2013

My Windows 8 & Ubuntu dual boot Experience in UEFI BIOS

I got a new laptop few weeks back with Windows 8. Model is Dell Latitude 3330 - it is light weight has i5 processor, 8G RAM, 500G Hybrid SSD & 13.3" HD screen and HD cam - no optical drive. Performance of the laptop was superb when i first booted it. I am planning to install some apps mainly outlook 2013 (office 365 version) and some browsers like firefox, Chrome etc. My usage is very light - i use very minimal apps so i won't be installing too many apps - all i need is to check office mails and browse. I want to install Ubuntu as dual boot so have to change the partition schema.

Before installing Ubuntu i logged into Windows 8 and shrinked the main partition C: to 100G. This left me with 350+G for rest of the data. Then i booted from an external DVD drive with Ubuntu 13.04 (64Bit) and installed it. Left enough space for Ubuntu home & data partitions and also created couple of partitions for storing data - I partition drives in this way so that each partition can be handled separately. I wanted one partition to be "common" between both Windows & Ubuntu so that i can access data from both OSes when required. I also left the other partitions in the system (FACTORY reset, TOOLS) untouched.

After installing Ubuntu i rebooted the machine expecting to see an option menu but the system booted into Ubuntu directly. Boot loader menu was not displayed at all. Rebooted again and pressed F12 to BIOS boot menu. There, in the UEFI boot menu, i could see Windows and Ubuntu. I could boot into Windows and work. Then rebooted again to Linux and copied all my data to data partitions. After copying data i had 3 data partitions, 2 recovery & tools partitions & 3 Linux partitions.

Now trying to find a way to boot into Linux & Windows without hitting F12 every time I wanted a solution. Thought of trying a bootloader in Windows 8 and found this. So installed EasyBCD 2.2 in Windows 8, edited the boot options. It detected the OS automatically i had to change the option to Ubuntu though. Clicked on Write MBR. It reported success so rebooted the PC.

Shock! I had two options there. Windows 8 & Windows 8. Strange! Further none of the options took me to Windows 8. So i have completely lost the ability to boot into Windows 8. Thankfully i could hit F12 and boot into Ubuntu. All my data in other partitions were there. Started searching for solutions to recover