You are not logged in.

#1 2015-06-10 15:55:42

kelnoky
Member
Registered: 2007-11-20
Posts: 135

[SOLVED] Migrating from BIOS/MBR to EFI/GPT

I am getting new hardware today (mainly important for this is the motherboard) and I wanna migrate my arch install over to the new stuff. Since my current setup is rather old, it's still using the BIOS/MBR combo and I would like to know what I have to watch out for when migrating.

I know that I have to convert all my disks go GPT and that that can be easily accomplished by gdisk. So I would install the drives in the new system and boot into the arch live environment and convert all my disks to gpt, that would be my first step. Then I would "just" need to install a new bootloader, I thought about going with gummiboot, since I have heard good things. However, reading through the gummiboot wiki article I realize that most of this EFI stuff is very new to me and most of it reads like gibberish. It seems somehow I need to have and "ESP" in my /boot? And something about EFI shells? I am very confused about this process. I tried reading the wiki, but I am afraid I will assemble my new shit later and will just be stuck without a bootable system.

I would appreciate any help. smile

Last edited by kelnoky (2015-06-11 07:13:12)

Offline

#2 2015-06-10 16:02:49

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

The simplest thing is to make /boot the ESP.

Don't worry about EFI shells at this point.

Any other specific questions, just ask.

Offline

#3 2015-06-10 16:06:30

kelnoky
Member
Registered: 2007-11-20
Posts: 135

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

So what would I do to make /boot the ESP? I mean, I already have a /boot. Do I reformat it cause it's supposed to be FAT32 for the ESP? Do I just copy all my stuff from /boot to a temporary folder, reformat to FAT32, copy the stuff back into /boot and then what? How do I create the ESP? big_smile

Offline

#4 2015-06-10 16:10:42

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

Yes, you will need to change the partition type and format it to vfat. You can copy the data off before and copy it back, or you can just reinstall anything that's on that partition; that should be the bootloader, kernel(s), and possibly microcode.

You could probably make that change now if you wanted, a BIOS system will boot from a vfat /boot just fine.

Offline

#5 2015-06-10 16:19:35

kelnoky
Member
Registered: 2007-11-20
Posts: 135

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

I just converted all my hdds (I have 5) to gpt, except one - the one with my /home and a few derelict partitions (old arch installs, other small distros etc) on it. I don't even know what all those partitions were at one point.

Gdisk tells me this for the drive (/dev/sda):

Warning! Main partition table overlaps the first partition by 33 blocks!
You will need to delete this partition or resize it in another utility.

My fdisk -l output:

kelnoky ~ $ sudo fdisk -l
Disk /dev/sdb: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf49ee5f5

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sdb1            2048 122882047 122880000 58.6G  7 HPFS/NTFS/exFAT
/dev/sdb2       122882048 234440703 111558656 53.2G 83 Linux


Disk /dev/sdc: 279.5 GiB, 300069052416 bytes, 586072368 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0004d77b

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sdc1              63 534868109 534868047  255G 83 Linux
/dev/sdc2       534870016 586072063  51202048 24.4G 83 Linux


Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x63557f81

Device     Boot    Start       End   Sectors   Size Id Type
/dev/sda1  *           1    208844    208844   102M 83 Linux
/dev/sda2         208845   2313359   2104515     1G 82 Linux swap / Solaris
/dev/sda3        2314238  39182335  36868098  17.6G  5 Extended
/dev/sda4       39182535 976768064 937585530 447.1G 83 Linux
/dev/sda5        2314240  39182335  36868096  17.6G 83 Linux

Partition table entries are not in disk order.


Disk /dev/sdd: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x64ab1982

Device     Boot     Start        End    Sectors   Size Id Type
/dev/sdd1  *         2048  718563327  718561280 342.7G  7 HPFS/NTFS/exFAT
/dev/sdd2       718565376 1953523711 1234958336 588.9G 83 Linux


Disk /dev/sde: 1.8 TiB, 2000398934016 bytes, 3907029168 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: gpt
Disk identifier: 362A4230-C4B5-4E7B-876D-87E96C3BEF55

Device          Start        End    Sectors   Size Type
/dev/sde1        2048 2048002047 2048000000 976.6G Linux filesystem
/dev/sde2  2048002048 3907028991 1859026944 886.5G Linux filesystem

So I am worried I might lose data if I convert that disk to GPT. However, I think that first partition (/dev/sda1 is meant by that, right?) is just some old /boot which I never bothered to remove. This is all messed up, I have been using these drives for so long. big_smile So one the one hand, maybe I can just delete that partition without any adverse effects. But, on the other hand, is that still my bootloader? It's the only partition that has a boot flag, except /dev/sdd1 where I have my Windows. My / resides on /dev/sdb, which is my SSD. I'll also post my lsblk -f:

kelnoky ~ $ lsblk -f
NAME   FSTYPE LABEL    UUID                                 MOUNTPOINT
sda                                                         
├─sda1 ext2            8791e8f1-b019-4803-9ade-4357381411a7 
├─sda2 swap            9076bd32-f55f-4ee8-9fb9-f07418bc5c2d 
├─sda3                                                      
├─sda4 ext4            e8e3235c-9e45-4b88-b890-d41a15dc4fab /home
└─sda5 ext4            9740a215-9456-483f-99c1-09ccb59d9c07 
sdb                                                         
├─sdb1 ntfs            30081A65081A29FC                     
└─sdb2 ext4            3f17af97-c520-4d55-880b-446667d9d2b5 /
sdc                                                         
├─sdc1 ext3            96cfdcd0-05c0-4039-aa14-28fb01b1115e /home/kelnoky/something
└─sdc2 ext4   var      259ee606-dba4-45f6-91ac-ee7e37d9ddbd /var
sdd                                                         
├─sdd1 ntfs   Data     FE1454D51454928F                     
└─sdd2 ext4            fdeae24c-5287-4671-a20a-16f8003a622d /home/kelnoky/unallocated
sde                                                         
├─sde1 ext4   down     b2a124b1-ee20-4db3-b3de-6de8b5deaa86 /home/kelnoky/down
└─sde2 ext4   vegetius af853e62-a33a-4a4b-beb9-70da32b10138 /home/kelnoky/vegetius
sr0                        

I am clearer on the ESP issue now, but now my harddrives confuse me....

Offline

#6 2015-06-10 16:23:19

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

I don't see anything mounted to /boot at all, are you sure you're currently using a separate boot partition? Where is your booloader config looking for the kernel?

Offline

#7 2015-06-10 16:35:09

kelnoky
Member
Registered: 2007-11-20
Posts: 135

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

Oh, yeah, sorry, forgot to write that in the post. Indeed, I don't have a seperate /boot at the moment. I used to on an older arch install, so that's what I figure that /dev/sda1 partition was once. Then I got the SSD and installed a new arch on there, abandoning the old system partitions on sda.

This is my grub.cfg menu entry I use to boot:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-3f17af97-c520-4d55-880b-446667d9d2b5' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos 
	insmod ext2
	set root='hd1,msdos2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2  3f17af97-c520-4d55-880b-446667d9d2b5
	else
	  search --no-floppy --fs-uuid --set=root 3f17af97-c520-4d55-880b-446667d9d2b5
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=UUID=3f17af97-c520-4d55-880b-446667d9d2b5 rw  quiet
	echo	'Loading initial ramdisk ...'
	initrd	 /boot/initramfs-linux.img
}

That's the UUID that points to my sdb2 partition on my SSD. That's where my / is, so my OS. So could my bootloader still be in sda1, thus making the procedure of simply deleting that partition dangerous? I mean, sure, I will install a different bootloader later anway, I guess. But I don't have the hardware yet. big_smile

Last edited by kelnoky (2015-06-10 16:37:23)

Offline

#8 2015-06-10 17:02:39

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

The bootloader should have been installed directly on /dev/sda and since /dev/sda1 is mounted nowhere, removing it should be totally safe. - Assuming you don't have stored any important data on it.

The kernel and other stuff relevant for booting respectively residing in /boot are on your disk mounted at / .

Offline

#9 2015-06-10 19:22:14

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

kelnoky wrote:

I don't have a seperate /boot at the moment.

Just create an EFI system partition -- FAT(32) formatted, 512MiB, make sure it is type "EF00" in gdisk -- copy the contents of /boot to that partition and then create an entry for it in /etc/fstab (this step may not even be needed; I am booting my Arch UEFI system without an fstab at the moment).

Then set up gummiboot, it is much easier to manage than GRUB.


Jin, Jîyan, Azadî

Offline

#10 2015-06-10 21:40:48

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 507

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

Head_on_a_Stick wrote:

(this step may not even be needed; I am booting my Arch UEFI system without an fstab at the moment).

How? Every time I try to boot without an fstab, my ~/ partition (drive) never gets loaded, nor does swap. I can understand my ~/.cache (tmpfs) and both of my samba shares not loading.


An old man, trying to stay sane

Offline

#11 2015-06-10 21:44:03

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

Buddlespit wrote:

How?

It only works with disks using a GUID partition table wink


Jin, Jîyan, Azadî

Offline

#12 2015-06-10 22:20:05

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 507

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

Head_on_a_Stick wrote:
Buddlespit wrote:

How?

It only works with disks using a GUID partition table wink

There has to be more to it than that. All of my disks are gpt, including the disk with ~/ and swap. I assumed it was because it was a separate disk.


An old man, trying to stay sane

Offline

#13 2015-06-10 22:33:32

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,572
Website

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

I'm guessing that HoaS is using a combination of Partition Type GUIDs and systemd mount units.

But please don't derail this topic, take it to PMs or start a new topic if you need to, thanks.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#14 2015-06-11 07:13:45

kelnoky
Member
Registered: 2007-11-20
Posts: 135

Re: [SOLVED] Migrating from BIOS/MBR to EFI/GPT

You guys helped a lot, thanks. Everything is migrated now, it worked with only the slightest problems, but I could figure those out. smile

Offline

Board footer

Powered by FluxBB