PDA

View Full Version : [all variants] Kubuntu Newbie unable to boot from other drive with GRUB 2



chris414
September 14th, 2015, 07:28 PM
Hello community,

first of all, I just want to say thank you for giving useful tips to everyone! I am just discovering the Linux / Unix / Whatever universe, so everything is absoloutely new for me.

Today I managed to install Kubuntu 15.04 onto my HDD. Now I have the problem, that I can't boot my Windows 7 (installed on SSD) using GRUB 2. If I select to boot from the SSD directly in the BIOS, everything is working like before. But if I try to boot the Windows entry of GRUB, it throws an error, that the UUID cannot be found. I studied lots of forum posts about this message, but as I said, I am absoloutely new to Kubuntu and I didn't understand much of the fixes ^^.

Some Facts:

SSD (Samsung EVO 250GB), first S-ATA plug on mainboard) -> sda
/dev/sda1 on SSD is marked (in GParted) as not existing :/, but is flagged with boot.

HDD (Seagate 1TB SSHD, second S-ATA plug) -> sdb

blkid outputs this:


/dev/sda1: LABEL="System-reserviert" UUID="720EF5770EF53527" TYPE="ntfs" PARTUUID="cc1469a2-01"
/dev/sda2: LABEL="Samsung SSD 850 EVO Series" UUID="FA5CF67F5CF6364B" TYPE="ntfs" PARTUUID="cc1469a2-02"
/dev/sda3: UUID="FC82FB4982FB06C4" TYPE="ntfs" PARTUUID="cc1469a2-03"
/dev/sdb1: LABEL="Seagate Desktop SSHD" UUID="083A27353A271F66" TYPE="ntfs" PARTUUID="21488213-01"
/dev/sdb2: LABEL="Recovery" UUID="90B61F6CB61F51D8" TYPE="ntfs" PARTUUID="21488213-02"
/dev/sdb5: UUID="02748eab-c8c0-469b-b431-6d271a0b4fe6" TYPE="ext4" PARTUUID="21488213-05"
/dev/sdb6: UUID="ac685054-006e-4aad-b64e-12e558000cb1" TYPE="swap" PARTUUID="21488213-06"
/dev/sdb7: UUID="ae7da2d1-6654-44dc-8025-6c7f4ee0e2ac" TYPE="ext4" PARTUUID="21488213-07"


sda1 should be the Windows bootloader
sda2 is the Windows System Partition (C:\)
sda3 is a 450.00MiB (maybe Windows recovery) partition

sdb1 is a data partition, filled with userdata, flagged with boot (why?)
sdb2 is (obviously) a 11GiB recovery partition, created by Windows
sdb3 is listed as extended in GParted
sdb4 doesn't exist xD
sdb5 is mounted as "/", so Kubuntu System
sdb6 is swap partition
sdb7 is "/home"

Windows Boot Script, generated by GRUB (not working):


insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 720EF5770EF53527
else
search --no-floppy --fs-uuid --set=root 720EF5770EF53527
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1


GRUB-generated kubuntu Boot Script (working):


recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 02748eab-c8c0-469b-b431-6d271a0b4fe6
else
search --no-floppy --fs-uuid --set=root 02748eab-c8c0-469b-b431-6d271a0b4fe6
fi
linux /boot/vmlinuz-3.19.0-15-generic root=UUID=02748eab-c8c0-469b-b431-6d271a0b4fe6 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.19.0-15-generic


I found this script on an other thread, and tried to adapt it, but i throws "hd1 cannot get C/H/S values":


set root=(hd1,2)
drivemap -s hd0 hd1
chainloader +1


I tried my best at providing information. If I missed some important information, just ask me, I will add them :D.

Thank you in advance for your help
Chris

oldfred
September 14th, 2015, 08:58 PM
With two drives and installs on each drive, you want to keep Windows boot loader on sda and grub2 boot loader on sdb.
When installing Ubuntu it defaults to install grub to sda. Only install option that gives a choice on where to install boot loader is Something Else.

Install grub to sdb first.
If you can boot into Ubuntu:
#reinstall from working (not liveCD/DVD/USB) system - first find Ubuntu drive (example is drive sdb but use your drive not partitions):
sudo parted -l
#if it's "/dev/sdb" then just run:
sudo grub-install /dev/sdb

But Ubuntu/grub has remembered which drive it originally installed and will reinstall there if you get a major update to grub.

#To see what drive grub2 uses see this line - grub-pc/install_devices:
sudo debconf-show grub-pc # for BIOS with grub-pc
It will show drive model & serial number
to see drive info
sudo lshw -C Disk -short

sudo grub-probe -t device /boot/grub

#to get grub2 to remember where to reinstall on updates:
sudo dpkg-reconfigure grub-pc or dpkg-reconfigure grub-efi-amd64
#Enter thru first pages,tab to ok, spacebar to choose/unchoose drive, enter to accept, do not choose partitions
http://ubuntuforums.org/showthread.php?t=2189643

Then install a Windows boot loader to sda and see if you can directly boot it. Grub only boots a working Windows and you normally need a Windows repair CD or flash drive. You may be able to directly boot and use f8 to get into the internal repair console.
If newer Windows 8 or later you must turn off fast startup in Windows as that is always on hibernation and grub cannot boot a hibernated Windows nor a Windows needing chkdsk.


Windows 8 UEFI repair USB must be FAT32, not for reinstall, just repairs
http://www.eightforums.com/tutorials/2855-system-repair-disc-create-windows-8-a.html
http://www.winhelp.us/create-a-recovery-drive-in-windows-8.html#USB


f8 to get to repair install screen, if you can start to boot
http://www.sevenforums.com/tutorials/666-advanced-boot-options.html
http://www.sevenforums.com/tutorials/681-startup-repair.html

(http://www.sevenforums.com/tutorials/681-startup-repair.html)
How to restore the Ubuntu/XP/Vista/7 bootloader
https://help.ubuntu.com/community/RestoreUbuntu/XP/Vista/7Bootloader


(http://www.sevenforums.com/tutorials/681-startup-repair.html)