LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices

Reply
 
Search this Thread
Old 06-12-2012, 10:38 PM   #1
rohandhruva
Member
 
Registered: Dec 2004
Posts: 42

Rep: Reputation: 17
Sony VAIO S and EFI troubles


I bought a new Sony Vaio S series laptop. It uses Insyde H2O BIOS EFI, and trying to install Linux on it is driving me crazy.

Code:
root@kubuntu:~# parted /dev/sda print
Model: ATA Hitachi HTS72756 (scsi)
Disk /dev/sda: 640GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  274MB   273MB   fat32        EFI system partition          hidden
 2      274MB   20.8GB  20.6GB  ntfs         Basic data partition          hidden, diag
 3      20.8GB  21.1GB  273MB   fat32        EFI system partition          boot
 4      21.1GB  21.3GB  134MB                Microsoft reserved partition  msftres
 5      21.3GB  342GB   320GB   ntfs         Basic data partition
 6      342GB   358GB   16.1GB  ext4         Basic data partition
 7      358GB   374GB   16.1GB  ntfs         Basic data partition
 8      374GB   640GB   266GB   ntfs         Basic data partition
What is surprising is that there are 2 EFI system partitions on the disk. The sda2 partition is a 20gb recovery partition which loads windows with a basic recovery interface. This is accessible by pressing the "ASSIST" button as opposed to the normal power button. I presume that the sda1 EFI System Partition (ESP) loads into this recovery.

The sda3 ESP has more fleshed out entries for Microsoft Windows, which actually goes into Windows 7 (as confirmed by bcdedit.exe on Windows). Ubuntu is installed on sda6, and while installation I chose sda3 as my boot partition. The installer correctly created a sda3/EFI/ubuntu/grubx64.efi application.

The real problem: for the life of me, I can't set it to be the default! I tried creating a sda3/startup.nsh which called grubx64.efi, but it didn't help -- on rebooting, the system still boots into windows. I tried using efibootmgr, and that shows as it it worked:

Code:
root@kubuntu:~# efibootmgr 
BootCurrent: 0000
BootOrder: 0000,0001
Boot0000* EFI USB Device
Boot0001* Windows Boot Manager
root@kubuntu:~# efibootmgr --create --gpt --disk /dev/sda --part 3 --write-signature --label "GRUB2" --loader "\\EFI\\ubuntu\\grubx64.efi" 
BootCurrent: 0000
BootOrder: 0002,0000,0001
Boot0000* EFI USB Device
Boot0001* Windows Boot Manager
Boot0002* GRUB2
root@kubuntu:~# efibootmgr
BootCurrent: 0000
BootOrder: 0002,0000,0001
Boot0000* EFI USB Device
Boot0001* Windows Boot Manager
Boot0002* GRUB2
However, on rebooting, as you guessed, the machine rebooted directly back into Windows.

The only things I can think of are:
1. The sda1 partition is somehow being used
2. Overwrite /EFI/Boot/bootx64.efi and /EFI/Microsoft/Boot/bootmgfw.efi with grubx64.efi [but this seems really radical].

Can anyone please help me out? Thanks -- any help is greatly appreciated, as this issue is driving me crazy!
 
Old 06-13-2012, 12:24 AM   #2
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Ubuntu 11, Arch, / Gnome 3.X, OSX,Windows
Posts: 157

Rep: Reputation: 33
I amongst many, would NEVER ever again buy ANY computer that has "Insyde H20" marked on it anywhere.
However, that answer is not very helpful.

If you have another HD kicking around on an old laptop, why not fire it in and do a complete ( ie not dual boot ) installation of Linux. Cut the troubleshooting way down that way.

Also, I am willing to bet that the problem lay in the space before partition 1, the area from 0 - to 1049kB that is not listed on your partition table.

Last edited by ceyx; 06-13-2012 at 12:27 AM.
 
Old 06-13-2012, 05:55 AM   #3
rohandhruva
Member
 
Registered: Dec 2004
Posts: 42

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by ceyx View Post
I amongst many, would NEVER ever again buy ANY computer that has "Insyde H20" marked on it anywhere.
However, that answer is not very helpful.

If you have another HD kicking around on an old laptop, why not fire it in and do a complete ( ie not dual boot ) installation of Linux. Cut the troubleshooting way down that way.

Also, I am willing to bet that the problem lay in the space before partition 1, the area from 0 - to 1049kB that is not listed on your partition table.
I guess I am learning that the hard way But how would you know that a computer will use Insyde H2O beforehand?

I have another hd, but I am not sure how that will help -- I do actually want to dual boot.

Hmm.. that's something I didn't think of. What could that 1049kb do to hijack the bootloader?
 
Old 06-13-2012, 09:19 AM   #4
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Ubuntu 11, Arch, / Gnome 3.X, OSX,Windows
Posts: 157

Rep: Reputation: 33
Quote:
how would you know that a computer will use Insyde H2O beforehand?
It should be clearly marked on the cardboard shipping box, and also in the documentation which is available on the web before purchase. But you are right, it is exactly how I learned the hard way too. Unfortunately, it seems the learning is always about the ways Microsoft is locking down "its" market. ( Microsoft owns that Sony, not you )

Quote:
but I am not sure how that will help
There would be no Windows system to protect with just Linux on it. If it worked, it would point to some parameter that is being used incorrectly by you or the partition editor used. If it doesn't, it is could point to the BIOS and "vendor lockin". Cut the problem in two this way.

Quote:
What could that 1049kb do to hijack the bootloader
That area is where the MBR is, master boot record. It may not be writeable ( BIOS parameter ? - have a look )

If you really want to keep Windows and are not really sure what is up, I recommend using the spare HD and the Gparted utility which should be available to Kubuntu. Actually, if you have the time, try the spare HD, Gparted and a vanilla Ubuntu or Debain. Experiment and find out what is going on before you really trash Windows accidentially.
 
Old 06-13-2012, 11:37 PM   #5
rohandhruva
Member
 
Registered: Dec 2004
Posts: 42

Original Poster
Rep: Reputation: 17
I was eventually able to solve this. I replaced the EFI/Microsoft/boot/bootmgfw.efi with the grub64.efi. I renamed the former to bootmgfw.efi.old and used grub to add a menu option to chainload into it.

This implies that the firmware is hardcoded to look for the microsoft windows bootloader, and does not respect efibootmgr settings, or startup.nsh. That's really terrible.

Thank you so much for your suggestions, ceyx
 
1 members found this post helpful.
Old 06-13-2012, 11:48 PM   #6
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Ubuntu 11, Arch, / Gnome 3.X, OSX,Windows
Posts: 157

Rep: Reputation: 33
Good Work ! Save us all the pain in the future
 
Old 07-17-2012, 06:39 AM   #7
luchnkov
LQ Newbie
 
Registered: Nov 2004
Posts: 5

Rep: Reputation: 0
Rohan - thanks for the posted solution. One issue that I am having with it is that using this approach I lose ability to resume Windows 7 from hibernation. Can you comment on whether that is a problem for you or not?
 
Old 07-17-2012, 06:55 AM   #8
rohandhruva
Member
 
Registered: Dec 2004
Posts: 42

Original Poster
Rep: Reputation: 17
Yes, unfortunately I had the same problem. I wasn't able to find a solution. If you do find one, please let me know
 
Old 07-18-2012, 07:54 PM   #9
luchnkov
LQ Newbie
 
Registered: Nov 2004
Posts: 5

Rep: Reputation: 0
OK, so I got it to work. Had to learn more about UEFI and H20 BIOS then I ever wished to Looks like the failure to come-out-of hibernation issue is a GRUB problem, I don't think it passes the expected environment when chain-loading the Windows boot manager - don't know exactly which variable is wrong, but the advice on the net seems to basically not use GRUB as a UEFI boot manager at all, and so I heeded that advice.

The brief summary is - I installed/booted the EFI shell and proved that I can boot Windows by calling bootmgfw.efi directly from the shell, and when I did so I could resume form hibernation without a problem. Then I installed rEFInd boot manager and switched to using it to multi-boot between Win7, Fedora and the EFI shell (the latter proved to be tremendously useful, so good to have it around and be able to boot into it). With that, both Windows and Linux can properly resume from hibernation.

Here are the gory details.

In order to boot shell/rEFInd on power up, had to figure out exactly how the BIOS picks the one EFI it chooses to boot. What I see is that its order of preference seems to be:
a. \EFI\Microsoft\Boot\bootmgfw.efi
b. \EFI\redhat\grub.efi - might be based on what Linux installation writes via efibootmgr into the EFI environment
c. \EFI\Boot\bootx64.efi

I.e., you remove a - it moves on to b, and so on. By default on my machine, bootx64.efi contained an exact copy of Windows bootmgfw.efi. As you found out before, regardless of what you write with efibootmgr, rebooting the machine changes that - so seems like the BIOS does its own scan/enumeration and rewrites those settings to its own liking.

So, what I did was:
- move bootmgfw.efi up a level to \EFI\Microsoft - eliminates a.
- renamed redhat directory to rh - eliminiates b.
- replaced bootx64.efi with what I wanted the machine to boot - i.e. with rEFInd EFI
- copied rEFInd config file int \EFI\Boot as well
- created a separate \EFI\Shell and copied the shell EFI there

This ensured that the EFI getting booted was in fact c., which is rEFInd boot manager

Unlike the BIOS/GRUB/Windows boot manager, rEFInd does an intelligent scan and presents all the EFIs it finds for you to select for booting. It found EFIs for Windows (Windows boot manager), Linux (GRUB), shell and self and presented them as a menu. You can further customize it in great detail by tweaking its config file. I.e., it does what a properly designed H20 should have been doing in the first place.

Thats all there is to it. See if this works for you. Good luck!

Last edited by luchnkov; 07-18-2012 at 08:16 PM.
 
Old 07-18-2012, 09:27 PM   #10
rohandhruva
Member
 
Registered: Dec 2004
Posts: 42

Original Poster
Rep: Reputation: 17
Thanks for the detailed solution You're right, I certainly learnt a lot more about EFI than I never needed to!

I did try rEFInd, but the problem was that the graphical menu was horribly broken for me. I did think of installing the shell and tweaking the config, but at that point I gave up trying to wrangle with it
 
Old 07-23-2012, 04:03 PM   #11
jncarlos
Member
 
Registered: Oct 2005
Location: HousTon TX, US
Distribution: Ubuntu 7.10, Opensuse 10.2
Posts: 45

Rep: Reputation: 15
Hi guys.. I too bought a new sony viao with this same bios and setup.. Believe its the same hard drive too. However I never tried installing my distro along windows 7. I actually just replaced my hard drive and installed Fedora 17, which is actually the only distro that recognized my EFI bios and configured boot all by itself. Because when I tried installing opensuse, ubuntu and not sure what else I tried, it will never boot. I will always get this error message OPERATING SYSTEM NOT FOUND. Another way I was able to install openSUSE was to go into the bios and change boot mode from EFI to LEGACY. which I belive changes to old way of booting and then I was able to install openSUSE 12.1..

I definetly did not know that insyde h20 was so hard to configure.. When I was shopping around for my new laptop, I look at many and looked up all the hardware to see what was most compatible with the kernel.. I tried a few laptops that I liked but couldn't keep for the lack of support.. Among some of them because of the dual graphic thing.. Gosh I hated that and its very difficult finding anything with single gp not being intel.. I, however failed to look up bios.. didn't think of it much.

Anyway after a few months of looking I finally settled with a new ivy bridge vaio with hd4000 gp. Low res but i really don't need high res much while on my laptop. I have a large display so Im good with that. Luckly I have no need for a windows partition on my personal computer, as we use an HP at work, so I replaced my hard drive to keep the factory one intact in case of warranty or whatnot and installed Fefora 17 using whole drive and it boots perfect under EFI, all my hardware is supported but memory card slots. But a simple kernel compile does the job.. Anyways its good to know you worked out your boot problem. Kudos
 
Old 07-23-2012, 04:19 PM   #12
rohandhruva
Member
 
Registered: Dec 2004
Posts: 42

Original Poster
Rep: Reputation: 17
jncarlos: Strange, because I tried openSUSE, and ubuntu both, and their liveusb sticks booted just fine. Maybe the way you created the livestick (or livecd) was different? You need to tell the UEFI to boot from optical drive first, and press F11 during boot. Also, the boot media needs to have an "EFI" folder in the top level, with a proper efi boot binary in the correct location(s). Both ubuntu and suse have it just right.

Yes, Insyde H2O is not only difficult to configure, but also doesn't follow the standards. I love the laptop, except for this crappy part, which makes it manufacturer-owned rather than user-owned.
 
Old 11-23-2012, 12:30 AM   #13
endor43
LQ Newbie
 
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
This step was immensely helpful to me and my new Vaio Z3. The issue that I am having is that after replacing bootmgfw.efi with grubx64.efi and renaming, it boots directly to grub console. I dont even get a menu where i can chose ubuntu. I tried putting a grub.cfg file next to the new bootmgfw.efi(grubx64.efi), no go?

Any ideas how i can get the renamed grubx64.efi to find all the rest of the grub stuff outside of the ESP in my linux parition?

Or do i have to put it all in /EFI/Microsoft/Boot on ESP?

Thank you!
 
Old 12-24-2012, 11:19 AM   #14
toshiro
LQ Newbie
 
Registered: Jan 2003
Distribution: Debian, Ubuntu, Solaris
Posts: 24

Rep: Reputation: 0
Quote:
Originally Posted by rohandhruva View Post
Thanks for the detailed solution You're right, I certainly learnt a lot more about EFI than I never needed to!

I did try rEFInd, but the problem was that the graphical menu was horribly broken for me. I did think of installing the shell and tweaking the config, but at that point I gave up trying to wrangle with it
I know the answer comes a little late but I think it's worth mentioning ... I had the same issue with the graphical menu with rEFInd and found that the problem was that the 'icons' folder wasn't located in the same folder of the EFI file that the system uses to boot; I've moved the 'icons' folder to that location and the menu worked perfectly after that.
 
Old 05-09-2013, 10:39 AM   #15
thisisjjd
LQ Newbie
 
Registered: May 2013
Posts: 3

Rep: Reputation: Disabled
Best practice to install linux side by side with Windows

Thanks so much for everyone who has contributed to this thread. My new VAIO Model S has a 750GB magnetic disk and my partition table is slightly different than what was described previously:
Code:
ubuntu@ubuntu:~$ sudo parted /dev/sda print
Model: ATA Hitachi HTS72757 (scsi)
Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  274MB   273MB   fat32        EFI system partition          hidden
 2      274MB   1819MB  1546MB  ntfs         Basic data partition          hidden, diag
 3      1819MB  2092MB  273MB   fat32        EFI system partition          boot
 4      2092MB  2226MB  134MB                Microsoft reserved partition  msftres
 5      2226MB  731GB   729GB   ntfs         Basic data partition
 6      731GB   750GB   19.0GB  ntfs         Basic data partition          hidden, diag

ubuntu@ubuntu:~$
Now that I've read the whole thread, here is what I think I need to do to create a dual boot Windows 8/Ubuntu environment:

1. Install Ubuntu 13.04 amd64.
I should tell it I want a dual boot environment and that it should install the boot environment into partition 3. I will shrink partition 5 and create a ext4 and swap partitions in the newly created space.

2. After finishing installation, I should expect that it won't properly boot Linux.
At this point I should follow Luchnkov's instructions in post #9 for installing the rEFInd boot manager (with toshiro's suggestion in post #14 for making the menu work properly). This should allow it to find the .efi file for GRUB and allow me to boot from it as well as the original windows environment.

Does that sound right?

One question I still have: How do I find the EFI shell .efi in order to follow Luchnkov's instruction "created a separate \EFI\Shell and copied the shell EFI there"?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to mount sony magic gate pro in my sony vaio CS VGN-CS24GH ngcsekhar Linux - Newbie 3 09-13-2011 10:52 AM
Troubles on video and animations on Sony Vaio, Fedora 12, GeForce 8400M GT enrymather Linux - Laptop and Netbook 0 12-24-2009 10:24 AM
Sony Vaio VGN-B1XP / sony driver question kentri9 Linux - Laptop and Netbook 0 12-27-2004 11:00 AM
help me install linux on sony sony vaio pcg-r505gl heina Linux - Newbie 4 10-10-2004 10:36 PM
Sony VAIO/XP BDW Linux - Newbie 0 06-01-2003 06:49 PM


All times are GMT -5. The time now is 12:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration