You are not logged in.

#1 2012-11-13 22:42:21

Foucault
Member
From: Athens, Greece
Registered: 2010-04-06
Posts: 214

[Solved] GPT and dual booting in a BIOS system

Hello everyone!
I recently got a new SSD and I'm pondering on what partition table I should use for a new installation, since for various reasons I will need to keep windows installed in a different disk. The layout I'm trying to achieve is

/dev/sda -> ArchLinux installation (GPT), the new ssd
/dev/sdb -> Windows installation (MBR), my old blank mbr hdd

What I'm thinking to do is the following. My bootloader will be syslinux.

1) Attach the new disk that arch will reside in. Partition the disk in GPT mode and install arch as usual.
2) Detach the ssd from the motherboard and plug in the old disk that will host windows. This disk has already been formatted and it's using an MBR partition table.
3) Install and test windows. Currently there are no GPT disks plugged in the motherboard, so the windows installer should only see one (empty) disk available.
4) Re-attach the ssd that arch has already been installed in and move the windows disk to a different sata port. The arch disk should be first in boot order.
5) Boot archlinux.
6) Modify syslinux.cfg to allow chainloading the windows from the other disk.

So selecting the windows option from syslinux should "jump" into the MBR disk and boot windows.

In theory the above should work, I have even tried it in a virtualbox instance and seems to work OK. However, I would like some more input. According to your experience is such a setup possible?

Last edited by Foucault (2012-11-24 11:19:02)

Offline

#2 2012-11-14 01:26:13

hiciu
Member
Registered: 2010-08-11
Posts: 84

Re: [Solved] GPT and dual booting in a BIOS system

Sure. If anything, arch will be the one who makes problems (/dev/sda, /dev/sdb, /etc/fstab).

Offline

#3 2012-11-14 07:15:52

Foucault
Member
From: Athens, Greece
Registered: 2010-04-06
Posts: 214

Re: [Solved] GPT and dual booting in a BIOS system

Of course, I will be using UUIDs everywhere, so partition numbering should not be a problem (well, I hope so anyway).

Offline

#4 2012-11-14 09:06:55

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [Solved] GPT and dual booting in a BIOS system

Foucault wrote:

According to your experience is such a setup possible?

It's the same thing as pressing Tab over "Boot existing OS" from the Arch Linux install media and changing it to "hd1 1" (or "hd1" to chainload to whatever bootloader was installed on the MBR of the drive). For Windows 7 (and probably Windows 8, too), you need to point it at the 100 MB "System Reserved" partition.

https://wiki.archlinux.org/index.php/Sy … ainloading


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#5 2012-11-15 06:04:08

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [Solved] GPT and dual booting in a BIOS system

I would advise against moving around SATA cables. If you want both drives attached at the same time all the time. Then attach them and leave them. Install Windows first and Linux second. You may also consider selecting the boot device within BIOS instead of chain loading.

Your life will probaly be easier with GRUB2 but to each his own.

As far as one disk being GPT and the other MBR. It doesn't matter at all. Just if you are installing the bootloader and /boot to a disk with GPT the boot loader needs to support GPT. Like, I boot from a USB stick that is MBR partitioned with GRUB2. It also has /boot on it. Then the SSD is GPT partitioned and has everything else on it.

Basicaly, after the bootloader has loaded the kernel into memory. It's all the same after that point. The kernel knows how to read MBR and GPT.

Last edited by hunterthomson (2012-11-15 06:09:43)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#6 2012-11-15 06:12:56

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

Re: [Solved] GPT and dual booting in a BIOS system

The kernel will not gaurantee persistence in its naming anyways.  So even if you do move the sata cables to different ports, you still may not end up with the correct device being /dev/sda.  I would recommend using either UUID's, or if those are a bit much for you, apply filesystem labels, and use LABEL=<disk_label> (or you may use /dev/disk/by-label/<disk_label>).  This can be done during filesystem creation or with the appropriate tool for your given filesystem.  For example ext{2,3,4} will use /sbin/e2label. 

Apart from that, I think that in any case, learning the software correctly is much easier than moving hardware everytime your sh*t goes wrong.

And as everyone else has stated above me, mixing MBR and GPT should cause no issues.

Offline

#7 2012-11-15 08:47:35

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [Solved] GPT and dual booting in a BIOS system

Ya, the thing with moving the stata cable around is that...

(at least with gurb...)
Grub will know the UUID's and suff. However, in the grub.cfg the disk with /boot on it is also idetified by...

set root='hd1,msdos1'

OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#8 2012-11-15 09:06:24

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

Re: [Solved] GPT and dual booting in a BIOS system

hunterthomson wrote:

Ya, the thing with moving the stata cable around is that...

(at least with gurb...)
Grub will know the UUID's and suff. However, in the grub.cfg the disk with /boot on it is also idetified by...

set root='hd1,msdos1'

http://www.gnu.org/software/grub/manual … tml#search

Offline

#9 2012-11-15 09:18:57

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [Solved] GPT and dual booting in a BIOS system

Like I said...

also idetified by...

This could cause problems. I know for a fact that if I change hd1,msdos1 to hd2,msdos1 my system will not boot.

menuentry 'Arch GNU/Linux, with Linux grsec kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-grsec kernel-true-f1123956-1234-12345-90ee-12347712344' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  f1690956-fcba-4363-90ee-b19d771f7cc4
        else
          search --no-floppy --fs-uuid --set=root f1123956-1234-12345-90ee-12347712344
        fi  
        echo    'Loading Linux grsec kernel ...'
        linux   /vmlinuz-linux-grsec root=/dev/mapper/VolGroup00-lvolroot ro cryptdevice=/dev/sda2:root:allow-discards quiet
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-linux-grsec.img
}

Last edited by hunterthomson (2012-11-15 09:20:17)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#10 2012-11-15 09:31:20

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

Re: [Solved] GPT and dual booting in a BIOS system

hunterthomson wrote:

Like I said...

also idetified by...

This could cause problems. I know for a fact that if I change hd1,msdos1 to hd2,msdos1 my system will not boot.

menuentry 'Arch GNU/Linux, with Linux grsec kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-grsec kernel-true-f1123956-1234-12345-90ee-12347712344' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  f1690956-fcba-4363-90ee-b19d771f7cc4
        else
          search --no-floppy --fs-uuid --set=root f1123956-1234-12345-90ee-12347712344
        fi  
        echo    'Loading Linux grsec kernel ...'
        linux   /vmlinuz-linux-grsec root=/dev/mapper/VolGroup00-lvolroot ro cryptdevice=/dev/sda2:root:allow-discards quiet
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-linux-grsec.img
}

The search line comes after "set root=", so if the fs uuid of the /boot is indeed "f1123956-1234-12345-90ee-12347712344" then it should work. Check whether f1123956-1234-12345-90ee-12347712344 is the correct uuid. If at all there is any mistake, it should be the uuid.

Offline

#11 2012-11-15 09:48:46

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [Solved] GPT and dual booting in a BIOS system

I don't clame to know eveyrthing about the config. However, I know that the line

set root='hd1,msdos1'

Needs to be there and if it is incorrect then your system will not boot even if the uuid's are correct.
http://www.gnu.org/software/grub/manual … tml#search

In anycase this is a wase of time. The poster is planning of using syslinux and I think we can both agree that moving around the drives is opening the door to problems.

Last edited by hunterthomson (2012-11-15 09:55:46)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#12 2012-11-15 09:53:48

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 279

Re: [Solved] GPT and dual booting in a BIOS system

If it's any help this is the GPT partition table on my SSD...

Model: ATA OCZ-AGILITY3 (scsi)
Disk /dev/sdb: 120GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                 Flags
 1      1049kB  2097kB  1049kB               BIOS boot partition  bios_grub
 2      2097kB  120GB   120GB   ext4         Linux filesystem

and this is the entry in my burg.cfg (same for grub2 I'm guessing) for booting WinXP from another drive

menuentry "Windows XP" --class windows --class os {
	search --no-floppy --fs-uuid --set C44CD0494CD0383E
	drivemap -s (hd0) ${root}
	chainloader +1
}

Ryzen 9 5950X, X570S Aorus Pro AX, RX 6600, Arch x86_64

Offline

#13 2012-11-15 13:21:16

Foucault
Member
From: Athens, Greece
Registered: 2010-04-06
Posts: 214

Re: [Solved] GPT and dual booting in a BIOS system

Thank you all for your replies smile. Of course, I am more than aware that the sdX naming scheme is not persistent and as I've said UUIDs will be used everywhere (fstab, syslinux). Even in my current setup with a single disk I am using UUIDs for the partitions. The reason I am thinking for detaching the sata cable before the windows installation is because windows wants to install its bootloader on the mbr of the first disk (as far as I know at least). So if there is only one disk attached the windows installer will only see this one.


Update: Indeed I had to unplug the linux disk since windows was insisting on installing its bootloader on the first disk of the system. By having only one disk attached the installer proceeded smoothly and chainloading works as expected. Thank you all for your input.

Last edited by Foucault (2012-11-24 11:18:42)

Offline

Board footer

Powered by FluxBB