You are not logged in.

#1 2012-10-06 14:23:29

sonay
Member
Registered: 2010-03-09
Posts: 75

[SOLVED]Dual boot problem with an Asus UX31A (EFI)

I never did an EFI install before and I still don't understand how it works however following the Zenbook wiki, I have successfully installed Arch. Now I can't boot Windows 7 anymore. I am using grub2, have installed os-prober. Grub menu has windows 7 entry but when used prompts a wrong EFI file path error.

My partition table is:

[root@zenbook sonay]# lsblk
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda       8:0    0 238.5G  0 disk 
├─sda1    8:1    0   200M  0 disk 
├─sda2    8:2    0   128M  0 disk 
├─sda3    8:3    0  98.6G  0 disk 
├─sda4    8:4    0     4G  0 disk 
├─sda5    8:5    0  90.7G  0 disk 
├─sda6    8:6    0   512M  0 disk /boot/efi
├─sda7    8:7    0   3.9G  0 disk 
├─sda8    8:8    0    10G  0 disk 
├─sda9    8:9    0   200M  0 disk /boot
└─sda10   8:10   0  30.3G  0 disk /
sdc       8:32   0 931.5G  0 disk 
└─sdc1    8:33   0 931.5G  0 disk /run/media/sonay/My Passport

/dev/sda1 used to be Windows 7 EFI partition. Gparted says it is flagged as boot.

What I did to install arch:

Partitioned /dev/sda5 with windows disk manager to create linux partitions and formatted the new partitions with gparted as the noob I am.
created /dev/sda6 for EFI boot
created /dev/sda9 for boot partition
created /dev/sda10 as root.

Did not touch
/dev/sda1 which was the EFI partition named SYSTEM
/dev/sda2 which was windows boot partition
/dev/sda3 which was windows C:,
/dev/sda4 and /dev/sda7 which I don't know what they used to be (possible for Asus fast wake up or swap whatever)
/dev/sda8 which is recovery partition.

I did not touch any grub files, except /etc/default/grub

[sonay@zenbook ~]$ cat /etc/default/grub 
GRUB_DEFAULT=0
GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet init=/bin/systemd add_efi_memmap elevator=noop i915.i915_enable_rc6=1 pcie_aspm=force drm.vblankoffdelay=1 i915.semaphores=1 nmi_watchdog=0"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter 
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx" 
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper 
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

#GRUB_SAVEDEFAULT="true"

Finally my /boot/grub/grub.cfg is:

[sonay@zenbook ~]$ cat /etc/default/grub 
GRUB_DEFAULT=0
GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet init=/bin/systemd add_efi_memmap elevator=noop i915.i915_enable_rc6=1 pcie_aspm=force drm.vblankoffdelay=1 i915.semaphores=1 nmi_watchdog=0"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter 
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx" 
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper 
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

#GRUB_SAVEDEFAULT="true"
[sonay@zenbook ~]$ cat /boot/grub/grub.cfg
cat: /boot/grub/grub.cfg: Permission denied
[sonay@zenbook ~]$ su
Password: 
[root@zenbook sonay]# cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt10'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt10 --hint-efi=hd0,gpt10 --hint-baremetal=ahci0,gpt10  cf66f05a-418c-4517-a0e0-af01b3be4a67
else
  search --no-floppy --fs-uuid --set=root cf66f05a-418c-4517-a0e0-af01b3be4a67
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
set timeout=1
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch GNU/Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-cf66f05a-418c-4517-a0e0-af01b3be4a67' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt9'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt9 --hint-efi=hd0,gpt9 --hint-baremetal=ahci0,gpt9  42d2ba69-758d-4a54-9482-ae5d60866a52
	else
	  search --no-floppy --fs-uuid --set=root 42d2ba69-758d-4a54-9482-ae5d60866a52
	fi
	echo	'Loading Linux core repo kernel ...'
	linux	/vmlinuz-linux root=UUID=cf66f05a-418c-4517-a0e0-af01b3be4a67 ro  quiet init=/bin/systemd add_efi_memmap elevator=noop i915.i915_enable_rc6=1 pcie_aspm=force drm.vblankoffdelay=1 i915.semaphores=1 nmi_watchdog=0
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-linux.img
}
menuentry 'Arch GNU/Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-fallback-cf66f05a-418c-4517-a0e0-af01b3be4a67' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt9'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt9 --hint-efi=hd0,gpt9 --hint-baremetal=ahci0,gpt9  42d2ba69-758d-4a54-9482-ae5d60866a52
	else
	  search --no-floppy --fs-uuid --set=root 42d2ba69-758d-4a54-9482-ae5d60866a52
	fi
	echo	'Loading Linux core repo kernel ...'
	linux	/vmlinuz-linux root=UUID=cf66f05a-418c-4517-a0e0-af01b3be4a67 ro  quiet init=/bin/systemd add_efi_memmap elevator=noop i915.i915_enable_rc6=1 pcie_aspm=force drm.vblankoffdelay=1 i915.semaphores=1 nmi_watchdog=0
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-linux-fallback.img
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (on /dev/sda3)' --class windows --class os $menuentry_id_option 'osprober-chain-5246C0D846C0BE4B' {
	insmod part_gpt
	insmod ntfs
	set root='hd0,gpt3'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  5246C0D846C0BE4B
	else
	  search --no-floppy --fs-uuid --set=root 5246C0D846C0BE4B
	fi
	chainloader +1
}
menuentry 'Windows Recovery Environment (loader) (on /dev/sda8)' --class windows --class os $menuentry_id_option 'osprober-chain-3C98C9B298C96B4A' {
	insmod part_gpt
	insmod ntfs
	set root='hd0,gpt8'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8  3C98C9B298C96B4A
	else
	  search --no-floppy --fs-uuid --set=root 3C98C9B298C96B4A
	fi
	drivemap -s (hd0) ${root}
	chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

SOLUTION:

first I needed to mount Windows EFI partition which was /dev/sda1, so :

 mount /dev/sda1 /mnt 

Then issue the following commands and take note of the outputs:

 grub-probe --target=fs_uuid /mnt/EFI/Microsoft/Boot/bootmgfw.efi 

which outputs: 18DF-E58E and

 grub-probe --target=hints_string /mnt/EFI/Microsoft/Boot/bootmgfw.efi 

which outputs: --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1

Finally edit the os-prober entry to the following in /boot/grub/grub.cfg

menuentry 'Windows 7 (loader) (on /dev/sda3)' --class windows --class os $menuentry_id_option 'osprober-chain-5246C0D846C0BE4B' {
        insmod part_gpt
        insmod fat
        insmod search_fs_uuid
        insmod chain
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 18DF-E58E
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

Last edited by sonay (2012-10-07 18:20:20)

Offline

#2 2012-10-06 21:01:51

shulamy
Member
From: israel
Registered: 2010-09-11
Posts: 340

Re: [SOLVED]Dual boot problem with an Asus UX31A (EFI)

mayt be you have to change gpt3 to gpt1.

or mark sda3 flag to boot.

ezik

Last edited by shulamy (2012-10-07 18:08:49)

Offline

#3 2012-10-06 21:15:50

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Offline

#4 2012-10-07 17:51:21

sonay
Member
Registered: 2010-03-09
Posts: 75

Re: [SOLVED]Dual boot problem with an Asus UX31A (EFI)

grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
--hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1


Sorry, no need to anymore. Thanks anyways.

Last edited by sonay (2012-10-07 18:08:39)

Offline

#5 2012-10-09 15:20:57

nehaljwani
Member
Registered: 2012-10-09
Posts: 6

Re: [SOLVED]Dual boot problem with an Asus UX31A (EFI)

You don't necessarily need to dual boot Windows and Linux on UEFI. Follow the guide http://www.youtube.com/watch?v=PEou2dIcMSE to convert your UEFI to MBR-BIOS without loss of data.

Offline

#6 2012-10-09 16:49:51

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: [SOLVED]Dual boot problem with an Asus UX31A (EFI)

@nehaljwani, telling people to stop using uefi is not really a solution to the problem they are trying to fix.  Also, linking to a youtube video on how to do it is probably not the best srouce of documentation.

Offline

#7 2012-10-09 20:31:12

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,079

Re: [SOLVED]Dual boot problem with an Asus UX31A (EFI)

I think he is spamming threads. youtube is blocked from my workplace. I doubt if the video even has something to do with Arch Linux.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#8 2012-10-09 21:55:56

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: [SOLVED]Dual boot problem with an Asus UX31A (EFI)

@Inxsible, if we now call this distro Ubuntu, it has everything to do with Arch Linux.... oh wait, nevermind.  It is titled "Dual Boot Windows & Ubuntu In Sony Vaio HP dv6 Laptops With GPT EFI Partition or Dynamic".

Offline

Board footer

Powered by FluxBB