Questions gpt, mbr and multi booting

I’ve decided to re install leap 42.2 from scratch again in some ways accounting for several things that have cropped up while I have been using linux. I’ve also decided to lay things out for subsequent multi booting. I might boot both leap and tumbleweed for instance.

First thing is to clear up booting. Since using suse and opensuse I haven’t needed to worry about it so not totally clear on uefi booting and gpt, Currently I have this. It’s an ssd.


dhcppc1:/home # parted /dev/sda print
Model: ATA PLEXTOR PX-128M5 (scsi)
Disk /dev/sda: 128GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name     Flags
 1      1049kB  206MB  204MB  fat16        primary
 2      206MB   128GB  128GB  ext4         primary

Yast shows that I am booting from the fat16 partition using efi. BUT in days of old the first disk found by the bios was used to boot and not knowing how things work now is the boot block on this drive ? If I happened to plug this one into the correct connection it’s a pure fluke so for all I know it might be on another drive. I have 2 others a raid 0 and a spare disk.

Also - I understand that when GPT is used there is no need for extended and logical partitions so I just need to create as many partitions on the ssd as I want one at a time ?

John

Hi
UEFI booting checks for an nvram entry eg;


efibootmgr -v
Boot0001* opensuse	HD(1,GPT,55e6515e-2df5-4971-98c0-57c6f1171098,0x800,0x82000)/File(\EFI\opensuse\grubx64.efi)

So then UEFI looks for the disk UUID and a valid partition set to type EF00, then the file to boot from… very simple process and no machine code in some part of the disk you can’t see (mbr)… :wink:

A gpt type disk can have 128 partitions…

UEFI scans all drives for the special EFI boot directory. But the order of boot is controlled by the UEFI flash memory tables. The tables define the boot order. You can change both by the UEFI boot interface or read man efibootmgr for details on view and change the UEFI settings from Linux

Yes with GPT just add all the partitions you like :wink:

Thanks. Lots seems to be mentioned in this area but no nitty gritty

:open_mouth: I get a lot more but suppose this is so that boot from can be selected in the bios?


dhcppc1:/home # efibootmgr -v
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0002,0000,0003,0001,0007,0004,0005,0006
Boot0000* opensuse      HD(1,800,61800,6cc9b049-e812-4280-bf44-6cd06d088bf4)File(\EFI\opensuse\grubx64.efi)
Boot0001* USB Floppy/CD Vendor(b6fef66f-1495-4584-a836-3492d1984a8d,0500000001)AMBO
Boot0002* opensuse-secureboot   HD(1,800,61800,6cc9b049-e812-4280-bf44-6cd06d088bf4)File(\EFI\opensuse\shim.efi)
Boot0003* ATAPI CD-ROM Drive    Vendor(b6fef66f-1495-4584-a836-3492d1984a8d,0300000001)AMBO
Boot0004* CD/DVD Drive  BIOS(3,0,00)AMGOAMNOY.......+.C.D./.D.V.D. .D.r.i.v.e. .........................rN.D+..,.\.........AMBO
Boot0005  USB Floppy/CD Vendor(b6fef66f-1495-4584-a836-3492d1984a8d,0500000000)AMBO
Boot0006* Hard Drive    BIOS(2,0,00)AMGOAMNOe.......+.P.L.E.X.T.O.R. .P.X.-.1.2.8.M.5.P.r.o.........................rN.D+..,.\.........AMBOAMNO?.........F.a.k.e. .U.s.b. .O.p.t.i.o.n...............AMBOAMNOU.......+.V.B.0.2.5.0.E.A.V.E.R.........................rN.D+..,.\.........AMBOAMNOg.......+.W.D.C. .W.D.1.0.E.F.R.X.-.6.8.F.Y.T.N.0.........................rN.D+..,.\.........AMBOAMNOg.......+.W.D.C. .W.D.1.0.E.F.R.X.-.6.8.F.Y.T.N.0.........................rN.D+..,.\.........AMBO
Boot0007  USB Hard Drive        Vendor(b6fef66f-1495-4584-a836-3492d1984a8d,0200000001)AMBO


Look like uuid’s but I understand this can also work with labels. Is there any way of making the opensuse install to do that ?

The grub and shim efi are also a bit confusing so what goes on here.

I suspect the floppy/cd is so that I can boot legacy cd’s. Maybe the usb hard drive is a USB3 dual sata dock, card reader plus a couple of powered usb ports.

:wink: I will get to multi booting but first things first.

John

Don’t know this is the BIOS/UEFI not the OS so have no idea how much or any control that can be used on the labeling method.

Reading the web pages of the person that produced gdisk it seems that labels could be used but not on Linux. Reason seemed to be 16bit rather than 8bit characters but I’d suspect those are what the .P .L .E etc are. Arch wiki mentions disk uuid’s but also partition labels. gdisk generates random uuid’s but can also write them directly if needed.

;)All read rather quickly so if some one wants to be sure read for yourself. Opensuse default seems to install gdisk so man pages are available.

One thing that came up worth noting is that the old partition on 2k boundaries isn’t a good idea any more as it can slow things down so 4k should be used. By k I mean binary style numbers. 4096 in other words. It seems disks are beginning to appear that use this internally.

John

I started wondering about multi booting because of how I mount various things to avoid writing to an ssd which leaves a lot of spare space on it. For one thing it would make upgrading to leap 42.3 when it comes easier. I could try tumbleweed. I need to look at a clean installation of LXDE. One way of going about this is here.

https://medium.com/@manujarvinen/setting-up-a-multi-boot-of-5-linux-distributions-ca1fcf8d502

Given a 120GB ssd it should be possible to get at least 5 different releases to boot up. Another way which I think is better is to use a common /home and different user names for each. It’s probably possible with some messing about to have a common mail box providing all use the same package. Maybe bookmarks too. Adding /home to the ssd could add 20gb or more to each install due to adding applications and other things. Not much of a problem with a 1TB /home. The usual suspects downloads etc can be common but may need altering xdg settings if links don’t work out.

The link mentions use of ReFind, maintained by the same person who looks after gdisk etc. Can’t say I agree with his comments about bios’s like mine as it allows me to boot any old **** but I wonder why use ReFind??

On the face of it from what I have read it should be possible to just use the first efi boot that is installed for all as picking up others should just need running a grub update. And I suspect running it again later if that one gets updated. There are other complications with secure booting though and I’m not sure how the security keys fit in with this. It seems ReFind looks after that but I’m not clear if this is a problem or if installs can be done without changing the efi boot settings that were there?? Or if the grub reset always works. If disto’s are changed they can need different sizes for efi boot. It seems opensuse split files and some don’t. I’ve seen suggestions that 500mb can get round that.

:\I picked up a hint somewhere recently that ReFind can bypass grub and boot straight to the kernels. :wink: Afraid that might appeal to some. I’m not so sure.

Hope there are some thoughts about on this subject. Personally I have no intention of changing distro but would like to build up arch from scratch mostly for educational purposes. Also have the ability to just install new releases without so much need to save stuff some where out of the way. I back up after a fashion by using raid on /home. I’ve tried external spinning metal and concluded it may as well be in my machine. I intend to sort out some cloud storage too.

John

On Wed 17 May 2017 12:26:01 PM CDT, ajohnw wrote:

I started wondering about multi booting because of how I mount various
things to avoid writing to an ssd which leaves a lot of spare space on
it. For one thing it would make upgrading to leap 42.3 when it comes
easier. I could try tumbleweed. I need to look at a clean installation
of LXDE. One way of going about this is here.

Setting up a multi-boot of 5 Linux distributions | by Manu Järvinen | Medium

Given a 120GB ssd it should be possible to get at least 5 different
releases to boot up. Another way which I think is better is to use a
common /home and different user names for each. It’s probably possible
with some messing about to have a common mail box providing all use the
same package. Maybe bookmarks too. Adding /home to the ssd could add
20gb or more to each install due to adding applications and other
things. Not much of a problem with a 1TB /home. The usual suspects
downloads etc can be common but may need altering xdg settings if links
don’t work out.

The link mentions use of ReFind, maintained by the same person who looks
after gdisk etc. Can’t say I agree with his comments about bios’s like
mine as it allows me to boot any old **** but I wonder why use ReFind??

On the face of it from what I have read it should be possible to just
use the first efi boot that is installed for all as picking up others
should just need running a grub update. And I suspect running it again
later if that one gets updated. There are other complications with
secure booting though and I’m not sure how the security keys fit in with
this. It seems ReFind looks after that but I’m not clear if this is a
problem or if installs can be done without changing the efi boot
settings that were there?? Or if the grub reset always works. If disto’s
are changed they can need different sizes for efi boot. It seems
opensuse split files and some don’t. I’ve seen suggestions that 500mb
can get round that.

:\I picked up a hint somewhere recently that ReFind can bypass grub and
boot straight to the kernels. :wink: Afraid that might appeal to some. I’m
not so sure.

Hope there are some thoughts about on this subject. Personally I have no
intention of changing distro but would like to build up arch from
scratch mostly for educational purposes. Also have the ability to just
install new releases without so much need to save stuff some where out
of the way. I back up after a fashion by using raid on /home. I’ve tried
external spinning metal and concluded it may as well be in my machine. I
intend to sort out some cloud storage too.

John

Hi
Don’t get me wrong, but what’s the point of having an SSD and not use
it write to it…?

You will have fun with the directories (naming) in the efi partition
with multiple openSUSE instances running. That’s why have two SSD’s in
my quad boot system and two efi partitions…

My old MacBook (2007)runs Tumbleweed only now with a 120GB SSD;


lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 119.2G  0 disk
├─sda1   8:1    0   260M  0 part /boot/efi
├─sda2   8:2    0    40G  0 part /
├─sda3   8:3    0    75G  0 part /data
└─sda4   8:4    0     4G  0 part [SWAP]

Never used refind with it, if wanted to boot into osX just used the
option key, else it booted straight to openSUSE.

This laptop HP 255 G4 has a 240GB SSD;


lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 223.6G  0 disk
├─sda1   8:1    0   260M  0 part /boot/efi
├─sda2   8:2    0    40G  0 part /
├─sda3   8:3    0 175.3G  0 part /data
└─sda4   8:4    0     8G  0 part [SWAP]

My Dell Inspiron 5555 has two 120GB SSD’s and quad boot (winX, openSUSE
leap 42.2, Tumbleweed and SLED 12 SP2);


lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 111.8G  0 disk
├─sda1   8:1    0   260M  0 part
├─sda2   8:2    0    40G  0 part
├─sda3   8:3    0    40G  0 part
└─sda4   8:4    0  31.5G  0 part /data
sdb      8:16   0 111.8G  0 disk
├─sdb1   8:17   0   300M  0 part
├─sdb2   8:18   0   100M  0 part /boot/efi
├─sdb3   8:19   0   128M  0 part
├─sdb4   8:20   0  62.9G  0 part
├─sdb5   8:21   0   450M  0 part
├─sdb6   8:22   0     8G  0 part [SWAP]
└─sdb7   8:23   0    40G  0 part /

Also have a Dell Inspiron 1545 with a 60GB SSD running SLED 12 SP1;


lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0 55.9G  0 disk
├─sda1   8:1    0  260M  0 part /boot
├─sda2   8:2    0   50G  0 part /
└─sda3   8:3    0  5.7G  0 part [SWAP]

All have thousands of hours on them, all running just fine, all use
btrfs and use 40GB / partitions.

My server, NAS and a couple of test laptops all run rotating rust…

Another alternative boot tool is gummiboot/systemd…


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.2|GNOME 3.20.2|4.4.62-18.6-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

;)I wont get into a discussion about why I use ssd as I do.

Multi booting seems to be a pretty fuzzy area. Largely down to jargon. Refind for instance has extensive documentation but there are few examples of actually using it. If MBR is used a simple grub partition can be used to chain to each distro that has been installed. Makes me wonder if it can just chain to one with an efi boot partition. Probably not. Pity.
If I just install all of them as they are usually installed with a boot partition I suspect my bios boot selector would show all of them. I’ve not looked to see if it can be set to always boot to that but it would probably be a messy way to do it.

I hadn’t come across systemd so will need to have a read. There is a spec here. Notice that kernels may need re compiling though - not good if that’s the case.

https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/

John

On Wed 17 May 2017 05:46:02 PM CDT, ajohnw wrote:

malcolmlewis;2823200 Wrote:
> Hi
>
> Another alternative boot tool is gummiboot/systemd…
>
> –
> Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
> openSUSE Leap 42.2|GNOME 3.20.2|4.4.62-18.6-default
> If you find this post helpful and are logged into the web interface,
> please show your appreciation and click on the star below… Thanks!

;)I wont get into a discussion about why I use ssd as I do.

Multi booting seems to be a pretty fuzzy area. Largely down to jargon.
Refind for instance has extensive documentation but there are few
examples of actually using it. If MBR is used a simple grub partition
can be used to chain to each distro that has been installed. Makes me
wonder if it can just chain to one with an efi boot partition. Probably
not. Pity.
If I just install all of them as they are usually installed with a boot
partition I suspect my bios boot selector would show all of them. I’ve
not looked to see if it can be set to always boot to that but it would
probably be a messy way to do it.

I hadn’t come across systemd so will need to have a read. There is a
spec here. Notice that kernels may need re compiling though - not good
if that’s the case.

BootLoaderSpec

John

Hi
It’s far easier with efi booting if the system BIOS is not locked to
windows… I’ve not had issues with either later model HP or Dell
systems, but did have fun with some of the earlier pro books.

Yes, you can load multiple systems with one (see os-prober) on my
multiboot system I use the Tumbleweed one (default boot), the others
have os-prober disabled, then just set the boot order (or if I forget,
on HP’s press F9 and select manually and update grub) with efibootmgr
(or create a systemd service to check/set).

Refind is needed because of the hfs file system and chainloading, hence
the reason to just select the option button on a Mac for me is a far
simpler solution, so either select the osX boot of efi boot…


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.2|GNOME 3.20.2|4.4.62-18.6-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Hi
You could also create additional ESP partitions (Type ef00) on the same disk, so as an example, one disk;

OSes to boot, winX, openSUSE Leap 42.2, openSUSE Tumbleweed, SLED 12 SP2 and SLES 12 SP2.

Pre Partition scheme (I use a live 13.1 USB for this);


sda1 type ef00 size 260MB (winX and 42.2 efi)
sda2 type 0c01 size 128MB (windows needs)
sda3 type 0700 size 20G (winX)
sda4 type 8300 size 20G (for 42.2)
sda5 type ef00 size 260MB (Tumbleweed,  SLED and SLES efi)
sda6 type 8300 size 20GB (for Tumbleweed)
sda7 type 8300 size 20GB (for SLED)
sda8 type 8300 size 20GB (for SLES)
sda9 type 8200 swap size ?
sda10 type 0700 450MB (for winX update stuff)

Format sda1 and sda5 to fat, then install windows. Then on the openSUSE/SLE installs I would rescan the disk in expert partitioner, then tell it which ESP to use, not to format, then set it’s path to /boot/efi. Complete each install and then decide which loader to use and configure accordingly… The reason the SLE’s can reside with Tumbleweed is the directory name created is sled and sles, so won’t be over written.

The freedesktop multiboot spec looks a bit questionable to me. Change everything and oh don’t bother about ms or mac. I’d have thought that something installed on the drive could be used with less bother. Much like using a grub partition on MBR.

Thanks for the replies. os-prober / efibootmng looks interesting but no man page. Centos has one and it states that it simply outputs a line for all boots on a system with chain on the end. That sounds much like the similar idea on MBR with a grub partition. It also mentions that linux-boot-prober may be needed. I ran both on my system and no output so I suspect that both skip the boot they are on.

One aspect of this area I haven’t managed to clear up is actual installs. I assume each is as it normally would be including an efi boot partition ? Or at least can be as it makes no difference? This isn’t mentioned very clearly on any of the methods. Not any I have found anyway.

The other aspect is installs writing to none volatile. I have no idea what my bios will make of dual booting but assume they do this to make themselves king when a system boots. What goes on here ? How to fix if this if this the case. Maybe it forms a table of them In the past I have written to none volatile myself but that was years and years ago and needs a utility to do it. Or write some code. I’d be a bit lost in that area now. It used to be an interesting way for virus to mess up machines and could also cause useful changes at times.

;)My HP uses the correct key for it’s boot up menu <ESC>. Must be because it’s a workstation.

John

Hi
So when I boot from Tumbleweed and run os-prober I see;


 os-prober 
/dev/sda2:openSUSE Leap 42.2 (x86_64):openSUSE:linux:btrfs:UUID=9e689967-6db2-4199-9ee9-d20c7c3584c0:subvol=@/.snapshots/1/snapshot
/dev/sda3:SUSE Linux Enterprise Desktop 12 SP2:SLED:linux:btrfs:UUID=3f063f63-0d65-4b02-a949-2eae883e80c2:subvol=@/.snapshots/96/snapshot
/dev/sdb2@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi

It’s just a script /usr/bin/os-prober so easy to see what it does.

It just adds an nvram entry and and hopefully moves it to the top of the order. Thing is you can manually add as well with the efibootmgr command (see man page or --help). Untill you install something additional you won’t know.

No Man efibootmgr ??? Did you perhaps install from GeckoLinux??? if so man pages are not included by default you must install if you want. I assume to save space for it’s small installer size. If normal openSUSE install you should have man efibootmgr. I do.

There are no man for os-prober probably because it is a script and thus easy to see what and how it works

I should have said os-prober and linux-boot-prober. ;)It happens.

John

Interesting question. Out of curiosity I opened up YAST’s partition manager and selected the / partition that is on the ssd. var,tmp and home are on disks. No swap at the moment. I then selected the partition for resizing. Up pop’s a prompt. You can try to unmount now, continue without unmounting or hit cancel if you don’t know what you are doing.

;)Well I do and wont set the partition too small but the interesting question is can YAST do this live ? It’s knows I am resizing / from the desktop etc. The prompt suggests that it might be able to do it. So can it ? I suspect it really means am I really sure that it’s ok to unmount the partition and I suppose remount it later.

When I re install I still wont know what the bios will do. I’m going to upgrade it due to a comes and goes reboot and now shutdown hang when a usb3 device is plugged in. I have a feeling this isn’t down to the bios though but could be.

John

;)I didn’t expect an answer to the last one. Could be that no one knows.

:’(I do need an answer to this one though. I booted up the install dvd and got into a mess with partitions as I imported the current one. Then found that it wouldn’t let me create another / where I wanted it. I then used the disk by disk entries and set each one where I wanted it to be. That did allow me to set / so guess this is the correct way. Then realised that due to the way I mount I need another /var so cancelled all to reboot. I have sda,sdb and md0. So ??

Select sda and set the mount point to / in the partition I have added for it.

Select sdb, mount the added var partition to /var, existing /tmp partition to tmp and existing swap to swap but probably not bother with swap at all as I’m not using it on kde.

Select md0 and mount to the existing /home partition on it to /home. That’s all that is on it.

Make sure nothing is going to be formatted. I vaguely remember a summary being shown before it’s actually done.

When it comes to software selection pick the desktop plus any bits and pieces needed. Do I need to install GRUB ?? Seems that this isn’t needed on some distro’s when another linux is added as the grub that is already installed will boot to it. (Set up via os-probe and a grub reset in the install that was already on the machine.) I would have thought that this would avoid messing up none volatile. **Or **can something else be omitted to avoid this happening ??

Set a user name that currently isn’t in /home. Probably in this case lxde and same for the machine name.

Having part done this I am most definitely switching to mount by label next time I install.

John

Resizing root while running from it sounds iffy to me. Should do it from a live USB/DVD . Do you change tires while driving down the highway??? :open_mouth:

Yes, you need (as long as you are using os-prober). It just extracts entries from bootloader configuration files of another distribution; so you need to have those entries in the first place.

I’ve installed lxde and it all went to the correct places as mentioned but …?

It still boots up into kde and doesn’t offer any alternatives. Just ran os-prober, same result, then tried os-prober and then grub2-mkconfig same result. os-prober does show that it’s there. grub2-mkconfig runs it anyway so no idea why both are mentioned?

John