Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
migrating complex legacy install to uefi
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
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5369

PostPosted: Sat Dec 08, 2018 8:11 am    Post subject: migrating complex legacy install to uefi Reply with quote

Greetings,

I'm in the process of possibly getting a new machine, I'll probably switch from Intel to AMD.
my current install is a legacy bios + legacy grub config. I'd like to upgrade it to uefi bios + latest grub config.
my main issue is the partitions layout, have 5 hdds, one is no that important, the other 4 are, they are comprised of 3 raids, see:
Code:

dagg@NCC-5001-D ~ $ cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md3 : active raid5 sda3[0] sdd3[4] sdc3[2] sdb3[5]
      2923375104 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
     
md2 : active raid1 sda2[0] sdd2[3] sdc2[2] sdb2[4]
      2096116 blocks super 1.2 [4/4] [UUUU]
     
md1 : active raid1 sda1[0] sdd1[3] sdc1[2] sdb1[1]
      204736 blocks [4/4] [UUUU]
     
unused devices: <none>

where md1 is the boot, m2 is the root and m3 is the rest (home. usr, opt, var, portage and more).
each hdd's pt is as follows:
Code:

dagg@NCC-5001-D ~ $ gdisk -l /dev/sda
Password:
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Model: SAMSUNG HD103SJ
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): D187F40B-2093-44CD-919B-E6EEC718BFB4
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          411647   200.0 MiB   FD00  Linux RAID
   2          411648         4605951   2.0 GiB     FD00  Linux RAID
   3         4605952      1953525134   929.3 GiB   FD00  Linux RAID

now what is the correct way to setup an efi env without touching as much of the layout as possible?
my main concern is md3, that I really don't like to loose, I can play with md1 and md2

ideas?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43221
Location: 56N 3W

PostPosted: Sat Dec 08, 2018 10:56 am    Post subject: Reply with quote

DaggyStyle,

Do a new install, you only build everything once that way.

Copy over /home, so you keep your user data.
Copy over your existing /etc/portage but modify make.conf to suit your new hardware.
Copy over your world file. Thats /var/lib/portage/world

Once you are happy
Code:
emerge -uDNav --keep-going
and go for a coffee.
It will be done when you get back :)

Alternatively, before you migrate, build everything on the old system with -mtune=generic and -march not set.
Then you need to rebuild on the new hardware.

Moving to EFI has no impact on the raid set unless one of them is /boot. That will become your EFI partition and must be formatted vfat.
You can run legacy grub from vfat. However, vfat does not support symlinks, so some care is needed in the setup.
e.g. grub.config is a symlink target. The file name menu.lst (thats lowercase 'L', not digit '1') must be used.

As you are mixing legacy grub and GPT you must reinstall grub to the MBR if you move any of grubs components around on /boot.
This is because the stage2 file is loaded using a blocklist, rather like lilo uses to load the kernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5369

PostPosted: Sat Dec 08, 2018 6:37 pm    Post subject: Reply with quote

Greetings Neddy,

as mentioned, md1 is my boot, its a raid1. all I need to do is change the type to EF, create the raid and reformat it to vfat?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43221
Location: 56N 3W

PostPosted: Sat Dec 08, 2018 7:03 pm    Post subject: Reply with quote

DaggyStyle,

Since /boot will be rewritten entirely. Yes.
I was trying to hint that you could test that now.

You an fail one piece of md1 and remove it from the raid.
On the removed piece of md1 ... lets call it /dev/sde1, you can make a vfat filesystem and install all your current boot files too.
You cannot have the symlinks
Code:
boot -> .
and in /boot/grub, menu.lst -> grub.conf.

You need a file /boot/grub/menu.lst and you need to think carefully about filenames in this file.
If you use kernel
Code:
 /boot/somekernel
initrd /boot/somintrd
it won't work as the /boot there is the symlink to self.

Install grub to the MBR of /dev/sde.

When you boot normally, you will still use the md1 boot.
If you change the BIOS to boot from /dev/sde, it will use your new vfat trial boot.

You need to change /dev/sde1 to whatever partition you drop out of md1. If that makes you nervous, a USB key should work too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
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