Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Partitioning for a dual boot system
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
degras
Guru
Guru


Joined: 05 Jan 2006
Posts: 460

PostPosted: Wed Nov 19, 2014 10:17 pm    Post subject: Partitioning for a dual boot system Reply with quote

Hi,
I am unsure of how to partition for a dual boot system (Windows 7 and Gentoo). Currently Windows uses three partitions and there is an unallocated block that I will use to install Gentoo.
I am guessing I need to add four partitions including a bootloader partition as in the following example:

Code:

Partition   Filesystem   Size   Description
/dev/sda1   (bootloader)   2M   BIOS boot partition
/dev/sda2   ext2   128M   Boot partition
/dev/sda3   (swap)   512M or higher   Swap partition
/dev/sda4   ext4   Rest of the disk   Root partition


Also in gparted do I set every new partition to a primary partition rather than extended?

Thanks
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7163
Location: almost Mile High in the USA

PostPosted: Thu Nov 20, 2014 12:40 am    Post subject: Reply with quote

The MBR partition scheme limits to four primary partitions. If you have 3, usually the best thing to do is to make the fourth one the "extended" partition and start creating partitions in that.

Now the question sort of is... how are you planning to chainload. Windows bootloader will not boot Linux and vice versa. So you have to chainload the other bootloader.

I ended up finding that Windows7 does not like being chainloaded (it prevents hibernation from working) so I had to use it to chainload Gentoo. Had to use Windows bcdedit (or something like that) to edit Win7's bootloader.

Then on the Gentoo side, I installed its bootloader on its partition (NOT MBR) and dumped the bootsector, and passed the bootsector to Windows.

You can do it the other way around, by using Linux's bootloader to chainload Windows.

On my 256GB (240GB) "disk" I ended up splitting it around 60G/60G/remainder, and the remainder is shared area that both OS can access, and used Windows as the primary bootloader on this machine. Grub is installed on the Linux partition (not MBR.)

My other machines don't have a windows problem so they have Grub on the MBR...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 340
Location: Stockholm

PostPosted: Thu Nov 20, 2014 10:02 am    Post subject: Reply with quote

You don't need to remove Windows bootloader. Install another boot loader on any other partition instead and set the bootflag. My layout:

Code:
fdisk -l

Disk /dev/sda: 698,7 GiB, 750156374016 bytes, 1465149168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x005cd7ed

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1             2048     409599     407552   199M  7 HPFS/NTFS/exFAT
/dev/sda2           409600  266649599  266240000   127G  7 HPFS/NTFS/exFAT
/dev/sda3  *     266649600  309069823   42420224  20,2G a5 FreeBSD
/dev/sda4        309069824 1465147119 1156077296 551,3G  5 Extended
/dev/sda5       1464936448 1465147119     210672 102,9M  c W95 FAT32 (LBA)
/dev/sda6        309071872  330043391   20971520    10G 83 Linux
/dev/sda7        330045440  351016959   20971520    10G 83 Linux
/dev/sda8        351019008  371990527   20971520    10G 83 Linux
/dev/sda9        371992576  791422975  419430400   200G  7 HPFS/NTFS/exFAT
/dev/sda10       791425024 1210855423  419430400   200G 83 Linux
/dev/sda11      1210857472 1422516223  211658752 100,9G  7 HPFS/NTFS/exFAT
/dev/sda12      1422518272 1464936447   42418176  20,2G  7 HPFS/NTFS/exFAT

grub:0 config /boot/grub/menu.lst:
Code:

timeout         300
color cyan/blue white/blue
 
title           gentoo-3.17.2/sda6 <<   
root            (hd0,5)
kernel          /boot/kernel-genkernel-x86_64-3.17.2-gentoo root=/dev/sda6 ro vga=773 rootdelay=17 psmouse.proto=imps
initrd          /boot/initramfs-genkernel-x86_64-3.17.2-gentoo

title           gentoo-3.17.0/sda6
root            (hd0,5)
kernel          /boot/kernel-genkernel-x86_64-3.17.0-gentoo root=/dev/sda6 ro vga=773 rootdelay=17 psmouse.proto=imps
initrd          /boot/initramfs-genkernel-x86_64-3.17.0-gentoo

title           gentoo-3.17.2/sda7 64-bit << 
root            (hd0,6)
kernel          /boot/kernel-genkernel-x86_64-3.17.2-gentoo root=/dev/sda7 ro vga=773 rootdelay=17 psmouse.proto=imps
initrd          /boot/initramfs-genkernel-x86_64-3.17.2-gentoo

title           gentoo-3.16.1/sda7 64-bit
root            (hd0,6)
kernel          /boot/kernel-genkernel-x86_64-3.16.1-gentoo root=/dev/sda7 ro vga=773 rootdelay=17 psmouse.proto=imps
initrd          /boot/initramfs-genkernel-x86_64-3.16.1-gentoo
 
title           Arch-linux/sda8 64-bit init=/bin/systemd <<< 
root            (hd0,7)
kernel          /boot/vmlinuz-linux root=/dev/sda8 ro vga=773 rootdelay=17 psmouse.proto=imps
initrd          /boot/initramfs-linux.img

title           Arch-linux/sda8 64-bit init=/bin/systemd fallback 
root            (hd0,7)
kernel          /boot/vmlinuz-linux root=/dev/sda8 ro vga=773 rootdelay=17 psmouse.proto=imps
initrd          /boot/initramfs-linux-fallback.img

title           Windows
root            (hd0,0)
chainloader     +1

title           grub2 sda6
root            (hd0,5)
chainloader     +1

title      memtest86+
root       (hd0,5)
kernel       /boot/memtest86plus/memtest

That is, the boatloader in /sda3 loads first. From there I chainload Windows bootloader to start Win/7 or I choose to load other systems. (My FreeBSD is chainloaded via grub:2)
Back to top
View user's profile Send private message
degras
Guru
Guru


Joined: 05 Jan 2006
Posts: 460

PostPosted: Thu Nov 20, 2014 7:46 pm    Post subject: Reply with quote

eccerr0r wrote:

Then on the Gentoo side, I installed its bootloader on its partition (NOT MBR) and dumped the bootsector, and passed the bootsector to Windows.


Just to clarify, going with the chain load from Windows to Gentoo approach. The partition with the Gentoo bootloader is still required (in its own partition)? Then after Gentoo is installed the boot information (from the bootloader partition) is copied to Windows? So I would still have 4 partitions for Gentoo (bootloader partition, boot partition, swap partition and root partition) in the extended partition?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7163
Location: almost Mile High in the USA

PostPosted: Thu Nov 20, 2014 9:11 pm    Post subject: Reply with quote

I have my whole Gentoo installed in its own partition, so the boot and root partition is the same. I now usually only use swap files so that's also on the root partition. You don't need to do it the same way of course. I have the extended partition because of the EFI partition and Windows itself having its own boot partition, and it took up space in the MBR table, completely filling it (along with needing a RST partition...)

Still not sure what I should do with the 32G SSD that I no longer use as it's not necessary on my machine anymore...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1752

PostPosted: Fri Nov 21, 2014 11:56 pm    Post subject: Reply with quote

eccerr0r wrote:
Still not sure what I should do with the 32G SSD that I no longer use as it's not necessary on my machine anymore...
Small storage device, most likely fast and designed to be "inside" the box. Perfect match for offline backup :lol:

Back to topic, the easiest way to partition disk is "stuff everything into one partition". It's not necesarly the best idea to do that, but it is simple and it works which makes it a fine starting point.
So, if you have 3 windows partitions and some free space left, just use this space for 4th partition and stuff gentoo there. When you decide to replace your HDD (and let's be fair, hdd will die sooner or later), you might reconsider partition table.
As has been already said, you can install bootloader on that partition containing linux and make it bootable. This will allow you chainloading windows bootloader from MBR.Also, after you reinstall windows you only have to toogle bootable flag again to make your linux boot again
If you want to create more partitions, I suggest making a small boot (50 MB turned out to be more than enough for me) and making the rest of space LVM's physical volume. Such a setup gives a lot of flexibility so you can easily tune your mountpoints as your needs change. And there is and added benefit, snapshots you can use to "freeze" system state. Handy thing
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