Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] GRUB2 problem with having Windows 8 preinstalled
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
mvlabat
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2014
Posts: 82

PostPosted: Sat Jan 25, 2014 9:18 pm    Post subject: [SOLVED] GRUB2 problem with having Windows 8 preinstalled Reply with quote

Hello, I'm installing Gentoo for the first time and I have Windows 8 preinstalled. I've proceeded all the steps described in the handbook and now I faced the problem installing GRUB2. At first I didn't have a separate boot partition for Gentoo, because Windows had created it alredy for itself (/dev/sda1). I wanted to modify it using EasyBCD program. But as it turned out the program requires Linux to be installed with GRUB2. I understood it from not very exhaustively informative program interface (but I'm not sure if it is realy so).

So I loaded from SystemRescueCD again and created a new partition (/dev/sda7) designed for boot. Then, as I found out, GRUB2 can't be installed on any partition but /dev/sda. And so I installed GRUB2 on /dev/sda partition and made a config file for it in /dev/sda7 (I'm not sure if this step had been done rightly too). So having all this done I get only GRUB command line loaded after. I can't boot either Window, or Linux. Just don't know how, because I expected some kind of graphical menu or something like this.

Restoring Windows boot sector I opened EasyBCD program again. Having no idea on further actions I tried to create a new boot option for loading Gentoo. So the program would find installed Linux by itself. On reloading I discovered that a new option to load Gentoo realy appeared. So I chose it and got GRUB2 command line again. This is where I was realy surprised. I didn't expect that something of GRUB remained. But I'm still not able to load Gentoo.
Now I'm confused what to do. I don't know how to organise dualboot Windows 8 and Gentoo, because didn't find enough information of using EasyBCD for it.
Hope for your help. Thank you.


Last edited by mvlabat on Sat Feb 01, 2014 7:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Sun Jan 26, 2014 6:29 am    Post subject: Reply with quote

boot the sysresccd. run
Code:
parted -l | wgetpaste
and post the url returned here. this will provide information regarding the partition structure for us and you with minimum pain. I suspect the output will resemble
Quote:
parted -l
Model: some model
Disk /dev/sda: some size
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 316MB 315MB ntfs Basic data partition hidden, diag
2 316MB 420MB 105MB fat32 EFI system partition boot
3 420MB 555MB 134MB Microsoft reserved partition msftres
4 555MB 256GB 256GB ntfs Basic data partition
if Partition Table is GPT and an EFI system partition is present it is likely that Windows 8 was installed as UEFI. As best I know Easybcd and UEFI windows are not friends.

Second step should be fixing the windows Master Boot Record (MBR) which was overwitten by grub2
http://answers.microsoft.com/en-us/windows/forum/windows_8-system/how-to-fix-windows-8-mbr/3d5439e9-521d-445c-ad52-a1d4b7f17237 is one of many howto's for this.

If it appears that windows 8 may in fact be installed UEFI recommend using http://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8 .
_________________
Defund the FCC.


Last edited by DONAHUE on Sun Jan 26, 2014 6:55 am; edited 1 time in total
Back to top
View user's profile Send private message
djdunn
l33t
l33t


Joined: 26 Dec 2004
Posts: 780
Location: Arrakis

PostPosted: Sun Jan 26, 2014 6:49 am    Post subject: Reply with quote

however syslinux:6 and uefi with windows works fine
_________________
A process cannot be understood by stopping it. Understanding must move with the flow of the process, must join it and flow with it.

-The First Law of Mentat
Back to top
View user's profile Send private message
mvlabat
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2014
Posts: 82

PostPosted: Fri Jan 31, 2014 2:52 pm    Post subject: Reply with quote

Sorry for such a delay.

http://bpaste.net/show/174174/

"Partition Table: msdos". Now I'm little confused.. :roll:
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Fri Jan 31, 2014 4:40 pm    Post subject: Reply with quote

knowing that /dev/sda has an msdos partition table means that either easybcd or grub2 should work. Is the windows 8 MBR now repaired and windows 8 booting?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
mvlabat
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2014
Posts: 82

PostPosted: Fri Jan 31, 2014 5:14 pm    Post subject: Reply with quote

Yes, it's repaired and Windows is able to boot.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Fri Jan 31, 2014 5:26 pm    Post subject: Reply with quote

grub2 is still your preferred bootloader?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
mvlabat
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2014
Posts: 82

PostPosted: Fri Jan 31, 2014 11:59 pm    Post subject: Reply with quote

No, it isn't. I'll prefer anything in order to make it work )
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Sat Feb 01, 2014 12:57 am    Post subject: Reply with quote

Quote:
Model: ATA ST1000LM014-1EJ1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 368MB 367MB primary ntfs boot
2 368MB 108GB 107GB primary ntfs
3 108GB 892GB 784GB primary ntfs
4 892GB 1000GB 109GB extended
7 892GB 892GB 133MB logical ext4
5 892GB 900GB 8590MB logical linux-swap(v1)
6 900GB 1000GB 99.8GB logical ext4

sda7 is /boot, sda5 is swap, sda6 is / (root) ???

if you would like to eliminate the awkwardly placed /dev/sda7, say so, we can change the plan to accomodate before proceeding.

is easy bcd installed in windows and working? if not, install it and test.
with easybcd working, boot the sysresccd to a network connection, mount the gentoo partitions, enter the chroot, nominally:
Code:
mount /dev/sda6 /mnt/gentoo
mount /dev/sda7 /mnt/gentoo/boot
cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -t proc none /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
then remove grub2 and install grub legacy on the partition boot record; not on the disk MBR:
Code:
emerge --unmerge grub
emerge grub-static
grub
find /boot/grub/stage1
expected to return (hd0,6) but may not because of the nonsequential partitions, if another value is returned use it in place of (hd0,6) in the following.
Code:
 root (hd0,6)
should report the file system of /boot.
Code:
setup (hd0,6)
should report sectors embedded and success. Edit grub.conf:
Code:
nano /boot/grub/grub.con
to
Quote:
default 0
timeout 5
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo
root (hd0,6)
kernel /boot/<your kernel name exactly as spelled in /boot> root=/dev/sda6

make a graceful exit:
Code:
exit
cd
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -l /mnt/gentoo{/boot,/proc,}
reboot
Reboot into windows. At this point, you should be back in Windows with GRUB tucked away in a hidden sector somewhere on your drive. Fire up everyone’s favorite bootloader manager (why, EasyBCD, of course!) and go to the “Add\Remove Entries” screen.
Choose “Linux\BSD” from the tabs on the top.
Select GRUB from the drop-down menu depending on what you configured earlier.
Choose the correct drive and partition number for your Linux partition. This should be the same partition as the one we just finished configuring. Refer to the image above for an example.
Enter the name you would like to give the Linux entry in the bootloader.
Press “Add Entry” and reboot to test.
These steps can be a bit tricky, and making mistakes could lead to some unwanted trouble (but don’t worry, nothing that can’t be fixed without dataloss). If you’re hesitant about something, don’t risk it – just ask for help.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
mvlabat
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2014
Posts: 82

PostPosted: Sat Feb 01, 2014 11:50 am    Post subject: Reply with quote

Thank you for such a complete instruction. )
Yes, sda7 is /boot, sda5 is swap, sda6 is / (root)

I've stucked at editing grub.conf file. That is my current config (I didn't touch it from the latest attempt to install):
Code:

default 0
timeout 7
splashimage=(hd0,5)/boot/grub/splash.xpm.gz

title Gentoo Linnux 3.13.0
root (hd0,5)
kernel /boot/kernel-3.13.0-vanilla root=/dev/sda6

title Gentoo Linux 3.13.0 (rescue)
root (hd0,5)
kernel /boot/kernel-3.13.0-vanilla root=/dev/sda6 init=/bin/bb

title Windows 8.1
rootnoverify (hd0,0)
makeactive
chainloader +1


So, as I understood, it's wrong and I have to edit it to your variant. But I can't find kernel name in my boot derictory, it is just absent. kernel-3.13.0-vanilla is expected...
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Sat Feb 01, 2014 3:40 pm    Post subject: Reply with quote

the command
Code:
ls /boot
should reveal the name of your kernel. If it does not the kernel was never compiled or compiled but never copied or copied to the wrong place. The most frequent "wrong place" when using a separate /boot partition results from not having the /boot partition mounted when copying the kernel. The kernel then ends up in the /boot directory on /dev/sda6. When /dev/sda7 is mounted at /boot on /dev/sda6 any files that are in /boot on /dev/sda6 disappear in favor of whatever files are on /dev/sda7. boot sysresccd,
Code:
mount /dev/sda6 /mnt/gentoo
ls /mnt/gentoo/boot
This should show no files. If files are present: (be careful with the rm lines, they remove what you tell them to)
Code:
 mkdir /mnt/gentoo/extraboot
cp -a  /mnt/gentoo/boot /mnt/gentoo/extraboot #save the misplaced files, just in case
rm -rf /mnt/gentoo/boot/* #remove them from sda6
ls /mnt/gentoo/boot #should be empty now
mount /dev/sda7 /mnt/gentoo/boot
cp -a  /mnt/gentoo/extraboot /mnt/gentoo/boot put misplaced in place
ls /mnt/gentoo/boot #checking
rm -rf /mnt/gentoo/extraboot #clean up

If files are not present:
Code:
 mount /dev/sda7 /mnt/gentoo/boot

In either case; with both gentoo partitions properly mounted, enter the chroot:
Code:
mount -t proc none /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
Create and install kernel:
Code:
 eselect kernel set linux-3.13.0 #BTW 3.13.1 exists
cd /usr/src/linux
make menuconfig #check it
make && make modules_install && make install # make all would work
emerge grub-static
Then
Code:
grub
find /boot/grub/stage1
expected to return (hd0,6) but may not because of the nonsequential partitions, if another value is returned use it in place of (hd0,6) in the following.
Code:
 root (hd0,6)
should report the file system of /boot.
Code:
setup (hd0,6)
should report sectors embedded and success.
Code:
quit
Edit grub.conf:
Code:
ls /boot
nano /boot/grub/grub.conf
To
Quote:
default 0
timeout 5
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo
root (hd0,6)
kernel /boot/vmlinuz-3.13.0 root=/dev/sda6
Kernel method is presumed to be manual not genkernel.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
mvlabat
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2014
Posts: 82

PostPosted: Sat Feb 01, 2014 7:37 pm    Post subject: Reply with quote

Thank you for your great help. Your solution worked. )
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum