Install Debian 10 on a system which have both GPT and MBR

Help with issues regarding installation of Debian

Install Debian 10 on a system which have both GPT and MBR

Postby LuxGiammi » 2019-08-28 12:50

I have a notebook which has two drives: one is an SSD and the other is an HDD. It also currently has both Windows 10 (SSD) and Windows 7 (HDD): I want to remove Windows 7 and install Debian 10. As I'd like it to boot fast, it would be a great idea to put all the system files required for boot in the SSD and the other files in the HDD (as the SSD has not got so much space (~20 GB left)). So I thought to set up Debian installation in this way:

One partition on the SSD in which I mount the /boot directory (~2GB)
One partition on the HDD in which I mount the / directory (root) (~90GB)
One partition on the HDD in which I mount the /home directory (~150GB)
One partition on the HDD as a swap area (~12GB - my RAM size is 12GB)

The problem is that, by looking in the Disk Management tool in Windows (screenshot below: the HDD is HITACHI and the SSD is KINGSTON: please note that the HDD begins with an EFI partition), the SSD and the HDD use two different partition tables: the former uses MBR and the latter uses GPT. I must admit that I don't know well the difference between EFI/UEFI and legacy systems and I don't know how to specify to the debian installer which one to use. Could you please tell me whether the aforementioned partition scheme would work and if I need to take some precautions regarding the GPT/MBR and the UEFI/EFI/BIOS problem?

Image

Thanks in advance
LuxGiammi
 
Posts: 4
Joined: 2019-08-28 08:48

Re: Install Debian 10 on a system which have both GPT and MB

Postby nulix » 2019-08-28 13:06

First you need backups. Old fashioned reliable backups. Then you can play around with partitions.
nulix
 
Posts: 6
Joined: 2019-07-18 10:38

Re: Install Debian 10 on a system which have both GPT and MB

Postby phenest » 2019-08-28 20:40

No. The first thing is to research UEFI booting and partition types to better understand how to go about this.

GPT and MBR are not synonymous. GPT is a partitioning type that is needed for UEFI booting. MBR is used for legacy booting but has nothing to do with partitions. It's perfectly possible to have a MBR for legacy booting and using GPT for partitioning on the same drive.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D
User avatar
phenest
 
Posts: 1703
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Install Debian 10 on a system which have both GPT and MB

Postby p.H » 2019-08-28 20:59

LuxGiammi wrote:As I'd like it to boot fast, it would be a great idea to put all the system files required for boot in the SSD and the other files in the HDD (as the SSD has not got so much space (~20 GB left)). So I thought to set up Debian installation in this way:

One partition on the SSD in which I mount the /boot directory (~2GB)
One partition on the HDD in which I mount the / directory (root) (~90GB)

The contents of /boot (GRUB, kernel image and initramfs) is only a tiny part of what is needed to bring the system to a usable state. You won't get much boot speed improvement if you only put /boot on the SSD. As much of the system as possible should be put on the SSD.

LuxGiammi wrote:The problem is that, by looking in the Disk Management tool in Windows (screenshot below: the HDD is HITACHI and the SSD is KINGSTON: please note that the HDD begins with an EFI partition), the SSD and the HDD use two different partition tables: the former uses MBR and the latter uses GPT.

The partition table types are not an issue. If you want to keep Windows 10 on the SSD, you must find out whether it boots in EFI mode from the EFI system partition on the HDD or in legacy mode from the SSD.

If Windows 10 boots in EFI mode, you must keep the EFI system partition when installing Debian and you must boot the Debian installer in EFI mode to enable multiboot in GRUB.

If Windows boots in legacy mode, you can delete the EFI system partition and you must boot the Debian installer in legacy mode to enable multiboot in GRUB.

A simple way to check would be to remove the HDD and check if Windows 10 can still boot. Or disable EFI boot in the UEFI boot options if the firmware allows it.
p.H
 
Posts: 1091
Joined: 2017-09-17 07:12

Re: Install Debian 10 on a system which have both GPT and MB

Postby djk44883 » 2019-08-28 22:42

As mentioned /boot is minuscule part of the boot process. Pretty much once yo make a selection from the boot menu, every thing in there's over with.

Unless you plan to use hibernate for your system... 12GB swap is wasted space. If you plan to hibernate, then great. With 12GB RAM, you'll have very little swapping, depending on your use. It's recommended, for some reason, to always to have a minimum amount.

Somewhat comes down to what make you feel good :)
djk44883
 
Posts: 80
Joined: 2010-12-11 13:14

Re: Install Debian 10 on a system which have both GPT and MB

Postby NFT5 » 2019-08-29 02:30

LuxGiammi wrote:So I thought to set up Debian installation in this way:

One partition on the SSD in which I mount the /boot directory (~2GB)
One partition on the HDD in which I mount the / directory (root) (~90GB)
One partition on the HDD in which I mount the /home directory (~150GB)
One partition on the HDD as a swap area (~12GB - my RAM size is 12GB)

The problem is that, by looking in the Disk Management tool in Windows (screenshot below: the HDD is HITACHI and the SSD is KINGSTON: please note that the HDD begins with an EFI partition), the SSD and the HDD use two different partition tables: the former uses MBR and the latter uses GPT. I must admit that I don't know well the difference between EFI/UEFI and legacy systems and I don't know how to specify to the debian installer which one to use. Could you please tell me whether the aforementioned partition scheme would work and if I need to take some precautions regarding the GPT/MBR and the UEFI/EFI/BIOS problem?


Start with some housekeeping.
In Win10:
- Remove/uninstall any programs that you don't need. Be tough here, only keep what you use regularly.
- Run Disk Cleanup (or equivalent) to remove unnecessary files. Include downloaded updates and anything that isn't essential, even System restore points if your system is stable now.
- Move your Document/Video/Music/Data libraries from the C:\ drive to an appropriate place on the HDD.
- Defragment the C:\ drive, at least twice, restarting each time.

Now assess how much your position has improved by looking at the capacity of your C:\ drive. As a minimum you'll want to have about 20GB free, more is better. This is because you'll want to use 10GB (minimum) for your new Debian installation, 15GB would be better. You'll also want to leave some space on the C:\ drive for the constant stream of garbage coming from Microsoft. 5GB as a minimum, 10GB would be safer..

If it looks like you can do this then shrink the size of the C:\ drive so that you have at least 10GB unused on that SSD.

To shrink the C:\ drive I would use GParted Live, but there are other utilities, including Windows ones. While you're doing this you can format the Win7 partition to Ext4, after backing up any data that you might need, (goodbye Windows 7!!) and then shrink it to allow space for a Linux Swap partition, which you'll need to create. As above, with 12GB RAM, 15GB is a bit of a waste, but think about the future and whether you might want to increase your RAM. After shrinking the Win10 C:\ drive, create a new partition on the SSD of at least 10GB. This will be your new Debian operating system partition. Note that if you're thinking about Debian 10 Buster and the KDE desktop then 15GB is nearer to the minimum size that you'll need. For Buster with XFCE I'd allow 12GB or with MATE, 10GB.

So, what you'll end with is Win10 and Debian 10 (/) on your SSD and your Debian /home, plus the Swap partition on the HDD (in addition to the current data and Recovery partitions. Note that this is different to your plan to put just /boot on the SSD. This is because what is in /boot is quite small and the system needs to access many other files when starting. Putting just /boot on the SSD won't improve your load speed much, but putting all of / will, so that is the ideal situation to aim for.

There is no need to be concerned about whether each partition is GPT or MBR - these are only ways that detail, to the system, how files and partitions are set up on that drive. To you, as a user, they make no significant difference unless you have very large drives (3TB +), and you don't. All current Debian installation images are UEFI capable and will load the correct one automatically, so no need to worry there.

If it doesn't look like you can free up enough space to achieve the above, then your only options are to get a bigger SSD or put Debian on the HDD. There was a time when I ran Windows and Linux on a 120GB SSD, configured as I've detailed above, so it is certainly possible but your housekeeping needs to be kept up and space not wasted with stuff that isn't necessary. On this desktop I have /home partitions of only 30GB which are only 10% full because I have separate drives for all my data. You could easily do similar.
User avatar
NFT5
 
Posts: 324
Joined: 2014-10-10 11:38
Location: Canberra, Australia

Re: Install Debian 10 on a system which have both GPT and MB

Postby LuxGiammi » 2019-08-29 18:41

nulix wrote:First you need backups. Old fashioned reliable backups. Then you can play around with partitions.


Done. Even though I have the folder my Windows programs are installed in on the HDD (if I put it on the SSD it would have been full now).

phenest wrote:No. The first thing is to research UEFI booting and partition types to better understand how to go about this.

GPT and MBR are not synonymous. GPT is a partitioning type that is needed for UEFI booting. MBR is used for legacy booting but has nothing to do with partitions. It's perfectly possible to have a MBR for legacy booting and using GPT for partitioning on the same drive.


Mmmhh... I'm not an expert, but some people discouraged me from using an hybrid configuration. Anyway, I have this guide (http://www.rodsbooks.com/efi-bootloaders/) which seems pretty exhaustive to me.

p.H wrote:
LuxGiammi wrote:As I'd like it to boot fast, it would be a great idea to put all the system files required for boot in the SSD and the other files in the HDD (as the SSD has not got so much space (~20 GB left)). So I thought to set up Debian installation in this way:

One partition on the SSD in which I mount the /boot directory (~2GB)
One partition on the HDD in which I mount the / directory (root) (~90GB)

The contents of /boot (GRUB, kernel image and initramfs) is only a tiny part of what is needed to bring the system to a usable state. You won't get much boot speed improvement if you only put /boot on the SSD. As much of the system as possible should be put on the SSD.

LuxGiammi wrote:The problem is that, by looking in the Disk Management tool in Windows (screenshot below: the HDD is HITACHI and the SSD is KINGSTON: please note that the HDD begins with an EFI partition), the SSD and the HDD use two different partition tables: the former uses MBR and the latter uses GPT.

The partition table types are not an issue. If you want to keep Windows 10 on the SSD, you must find out whether it boots in EFI mode from the EFI system partition on the HDD or in legacy mode from the SSD.

If Windows 10 boots in EFI mode, you must keep the EFI system partition when installing Debian and you must boot the Debian installer in EFI mode to enable multiboot in GRUB.

If Windows boots in legacy mode, you can delete the EFI system partition and you must boot the Debian installer in legacy mode to enable multiboot in GRUB.

A simple way to check would be to remove the HDD and check if Windows 10 can still boot. Or disable EFI boot in the UEFI boot options if the firmware allows it.


I managed to inspect which is the boot type of Windows 10 and it boots in legacy mode. How can I do in order to boot the debian installer in legacy mode? How can I see if it has been booted in legacy mode and there were no errors (I created a USB key with a copy of Debian 10)?

djk44883 wrote:As mentioned /boot is minuscule part of the boot process. Pretty much once yo make a selection from the boot menu, every thing in there's over with.

Unless you plan to use hibernate for your system... 12GB swap is wasted space. If you plan to hibernate, then great. With 12GB RAM, you'll have very little swapping, depending on your use. It's recommended, for some reason, to always to have a minimum amount.

Somewhat comes down to what make you feel good :)


Hibernation is something I use often, so I think I'll go with 12 GB. Thanks :D

NFT5 wrote:
LuxGiammi wrote:So I thought to set up Debian installation in this way:

One partition on the SSD in which I mount the /boot directory (~2GB)
One partition on the HDD in which I mount the / directory (root) (~90GB)
One partition on the HDD in which I mount the /home directory (~150GB)
One partition on the HDD as a swap area (~12GB - my RAM size is 12GB)

The problem is that, by looking in the Disk Management tool in Windows (screenshot below: the HDD is HITACHI and the SSD is KINGSTON: please note that the HDD begins with an EFI partition), the SSD and the HDD use two different partition tables: the former uses MBR and the latter uses GPT. I must admit that I don't know well the difference between EFI/UEFI and legacy systems and I don't know how to specify to the debian installer which one to use. Could you please tell me whether the aforementioned partition scheme would work and if I need to take some precautions regarding the GPT/MBR and the UEFI/EFI/BIOS problem?


Start with some housekeeping.
In Win10:
- Remove/uninstall any programs that you don't need. Be tough here, only keep what you use regularly.
- Run Disk Cleanup (or equivalent) to remove unnecessary files. Include downloaded updates and anything that isn't essential, even System restore points if your system is stable now.
- Move your Document/Video/Music/Data libraries from the C:\ drive to an appropriate place on the HDD.
- Defragment the C:\ drive, at least twice, restarting each time.

Now assess how much your position has improved by looking at the capacity of your C:\ drive. As a minimum you'll want to have about 20GB free, more is better. This is because you'll want to use 10GB (minimum) for your new Debian installation, 15GB would be better. You'll also want to leave some space on the C:\ drive for the constant stream of garbage coming from Microsoft. 5GB as a minimum, 10GB would be safer..

If it looks like you can do this then shrink the size of the C:\ drive so that you have at least 10GB unused on that SSD.

To shrink the C:\ drive I would use GParted Live, but there are other utilities, including Windows ones. While you're doing this you can format the Win7 partition to Ext4, after backing up any data that you might need, (goodbye Windows 7!!) and then shrink it to allow space for a Linux Swap partition, which you'll need to create. As above, with 12GB RAM, 15GB is a bit of a waste, but think about the future and whether you might want to increase your RAM. After shrinking the Win10 C:\ drive, create a new partition on the SSD of at least 10GB. This will be your new Debian operating system partition. Note that if you're thinking about Debian 10 Buster and the KDE desktop then 15GB is nearer to the minimum size that you'll need. For Buster with XFCE I'd allow 12GB or with MATE, 10GB.

So, what you'll end with is Win10 and Debian 10 (/) on your SSD and your Debian /home, plus the Swap partition on the HDD (in addition to the current data and Recovery partitions. Note that this is different to your plan to put just /boot on the SSD. This is because what is in /boot is quite small and the system needs to access many other files when starting. Putting just /boot on the SSD won't improve your load speed much, but putting all of / will, so that is the ideal situation to aim for.

There is no need to be concerned about whether each partition is GPT or MBR - these are only ways that detail, to the system, how files and partitions are set up on that drive. To you, as a user, they make no significant difference unless you have very large drives (3TB +), and you don't. All current Debian installation images are UEFI capable and will load the correct one automatically, so no need to worry there.

If it doesn't look like you can free up enough space to achieve the above, then your only options are to get a bigger SSD or put Debian on the HDD. There was a time when I ran Windows and Linux on a 120GB SSD, configured as I've detailed above, so it is certainly possible but your housekeeping needs to be kept up and space not wasted with stuff that isn't necessary. On this desktop I have /home partitions of only 30GB which are only 10% full because I have separate drives for all my data. You could easily do similar.


Unfortunately, I cannot free so much space on the SSD: I have 27GB spare space and all my documents and all my installed programs are on the HDD. I can make a 15GB partition for Debian. But then if I mount the root directory on the SSD, wouldn't the programs I install (by using apt or by direct compilation and installation) be installed on the SSD? Wouldn't this be a waste of precious space? Is there a way to tell apt to install all the packages inside another directory? Alternatively, is there a way to put on the SSD only the files and programs needed by the OS for the booting process and then put on the HDD all other programs and utilities (as for my files, I've understood I need to mount the /home directory on the HDD, but is there a directory apt or another package manager installs packages and programs in? By inspecting my PATH variable in BASH I see that a lot of the paths are under /usr, is it a good idea to create a partition on the HDD for that directory?)?

Thanks a lot to everybody for your help!
LuxGiammi
 
Posts: 4
Joined: 2019-08-28 08:48

Re: Install Debian 10 on a system which have both GPT and MB

Postby p.H » 2019-08-29 19:46

LuxGiammi wrote:I'm not an expert, but some people discouraged me from using an hybrid configuration.

By chance aren't you confusing GPT + DOS/MBR on separate drives with GPT + DOS/MBR on the same drive aka "hybrid MBR" ? Only the latter is strongly discouraged unless you know exactly what you are doing. I have used hybrid MBR, it works but has issues you'd better be aware of when you use it.

Or do you mean BIOS/legacy + EFI boot (which has not much to do with the above) ?
If one system is set up for EFI boot and the other is set up for BIOS/legacy boot, then you won't be able to boot both systems from the same GRUB, you will have to select which OS to boot by selecting the boot mode from the firmware boot options.

LuxGiammi wrote:I managed to inspect which is the boot type of Windows 10 and it boots in legacy mode.

Then you can delete the EFI partition on the HDD, Windows does not use it for legacy boot.

LuxGiammi wrote:How can I do in order to boot the debian installer in legacy mode? How can I see if it has been booted in legacy mode

In the firmware boot options, disable UEFI boot and enable only legacy boot if possible. Otherwise, in the firmware boot menu, select the USB drive in legacy mode, not in UEFI mode.
The Debian installer boot menu will show when it has been booted in EFI mode. EFI boot uses GRUB as the boot loader, whereas legacy boot uses ISOLinux as the boot loader.

LuxGiammi wrote:if I mount the root directory on the SSD, wouldn't the programs I install (by using apt or by direct compilation and installation) be installed on the SSD?

Programs installed by apt will be installed in /usr which should be on the SSD for speed. Programs compiled or not installed with apt are usually installed in locations such as /opt or /usr/local which can be mount points for separate filesystems on the HDD.

LuxGiammi wrote:Alternatively, is there a way to put on the SSD only the files and programs needed by the OS for the booting process and then put on the HDD all other programs and utilities

No. All are mixed in /usr.

LuxGiammi wrote:By inspecting my PATH variable in BASH I see that a lot of the paths are under /usr, is it a good idea to create a partition on the HDD for that directory?)?

No. Most of what is needed for system startup is in /usr so you would not provide much speed improvement.
You could put some parts of /usr which are not needed at startup (man pages, documentation) on the HDD, but that is not a big part of /usr.
You can put /var on the HDD too.
p.H
 
Posts: 1091
Joined: 2017-09-17 07:12

Re: Install Debian 10 on a system which have both GPT and MB

Postby phenest » 2019-08-29 20:13

@LuxGiammi :

We can see what it is you want to accomplish. What you are asking is quite normal. But I think you need to follow our advice as to the best layout for optimum performance. If you want to move directories around afterward and make symlinks for them, knock yourself out. But for now, just concentrate on getting Debian dual booting with Windows. We can help out with the details afterward.

@p.H:

I don't think the EFI partition should be deleted. Just in case we're all wrong about how it boots. The only partitions I would delete are the ones that Windows 7 currently resides in.
The Disk Management tool in Windows 10 can resize its own partitions while it's running. This is probably a better way as Windows can deal with NTFS better than Linux can. Once space is made ready for Debian, then start installing it.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D
User avatar
phenest
 
Posts: 1703
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Install Debian 10 on a system which have both GPT and MB

Postby NFT5 » 2019-08-30 00:40

phenest wrote:I don't think the EFI partition should be deleted. Just in case we're all wrong about how it boots. The only partitions I would delete are the ones that Windows 7 currently resides in.


Agree 100%. They're only small partitions anyway and will allow you to reinstall Windows if ever you should decide that you want to.

phenest wrote:The Disk Management tool in Windows 10 can resize its own partitions while it's running.


Ah! Good you mentioned that. Better than Gparted which I suggested. I'm not really up to speed on Win10.

LuxGiammi wrote: I have 27GB spare space and all my documents and all my installed programs are on the HDD. I can make a 15GB partition for Debian. But then if I mount the root directory on the SSD, wouldn't the programs I install (by using apt or by direct compilation and installation) be installed on the SSD?


This is perfect. Shrink your Win10 C:\ drive so that you have 15GB free space which is ideal to create a partition to install Debian in. That will leave you about 12GB to cover updates from Microsoft which should be more than enough given that none of your data is on this drive.

The practise of installing the main operating system folders for Linux in to separate partitions works in certain server environments but, in a desktop computer it just adds an unnecessary level of complexity that you, as someone new to Linux, really don't need.

The best way is to install all the actual operating system in one partition and /home in another. Separate drives are no problem. Thus / and everything below that, except for /home, will be all together in the one partition, in your case, on the SSD. /home will be on your HDD, although it will appear in the tree structure when you look in a file manager.
User avatar
NFT5
 
Posts: 324
Joined: 2014-10-10 11:38
Location: Canberra, Australia

Re: Install Debian 10 on a system which have both GPT and MB

Postby djk44883 » 2019-08-31 01:01

Back to first post. I'm not sure what's considered
As I'd like it to boot fast,


I have all of Debian [Bullseys] installed on a 32GB SSD it boot's in about 10seconds from looking at kern.log, systemd-analyze critical-chain and systemd-analyze blame. But is stays on for weeks, so it's mostly irrelevant for me... for this system anyhow. It uses less than 10GB - including /home. Music, VIdeo and Downloads are stored elsewhere, but otherwise keep /home on the same filesystem.
djk44883
 
Posts: 80
Joined: 2010-12-11 13:14

Re: Install Debian 10 on a system which have both GPT and MB

Postby p.H » 2019-08-31 09:19

I still insist that the EFI system partition should be deleted if EFI boot is not used. Keeping it would cast confusion about the boot mode.
The Windows installer will create a new one if needed.
p.H
 
Posts: 1091
Joined: 2017-09-17 07:12

Re: Install Debian 10 on a system which have both GPT and MB

Postby phenest » 2019-08-31 14:47

p.H wrote:The Windows installer will create a new one if needed.

The OP is installing Debian not Windows.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D
User avatar
phenest
 
Posts: 1703
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Install Debian 10 on a system which have both GPT and MB

Postby p.H » 2019-08-31 18:53

Please pay attention when reading the whole thread. I was replying to this :
NFT5 wrote:They're only small partitions anyway and will allow you to reinstall Windows if ever you should decide that you want to.
p.H
 
Posts: 1091
Joined: 2017-09-17 07:12

Re: Install Debian 10 on a system which have both GPT and MB

Postby LuxGiammi » 2019-09-14 12:40

Hi everybody,

Thanks for your precious advice and sorry if I'm replying so late, but I've been busy in the previous two weeks.

I tried to make enough space on the SSD for the Debian installation, but unfortunately, the Windows Disk Management program does not allow me to shrink by more than 3GB the volume claiming that "[I] cannot shrink a volume beyond the point where any unmoveable files are located. See the "defrag" event in the application log for detailed information about the operation when it has completed". I can use some external tools to shrink the volume and get rid of the limitation, but wouldn't this cause Windows to malfunction?

Thanks a lot.
LuxGiammi
 
Posts: 4
Joined: 2019-08-28 08:48

Next

Return to Installation

Who is online

Users browsing this forum: No registered users and 11 guests

fashionable