rocky-linux / rocky-tools

MIT License
407 stars 144 forks source link

./migrate2rocky.sh: line 413: dm-0/partition: No such file or directory #129

Closed chattytak closed 2 years ago

chattytak commented 2 years ago

I tried to make the following migrations.

CentOS8.4 --> RockyLinux8.5

However, an error occurred. Is this a bug?

./migrate2rocky.sh: line 413: dm-0/partition: No such file or directory

Unable to gather EFI data: Can't find disk name or partition number for dm-0.

An error occurred while we were attempting to convert your system to Rocky Linux. Your system may be unstable. Script will now exit to prevent possible damage.

 A log of this installation can be found at /var/log/migrate2rocky.log

This CentOS uses iPXE and iscsi for SAN boot. It also has a multipath configuration with ibft0 and ibft1.

# multipath -l
36589cfc0000002a73bb0398682e8e4bf dm-6 FreeNAS,iSCSI Disk
size=256G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=0 status=active
| `- 9:0:0:0  sdd 8:48 active undef running
`-+- policy='service-time 0' prio=0 status=enabled
  `- 10:0:0:0 sde 8:64 active undef running
36589cfc00000019b133871bc1245f735 dm-0 FreeNAS,iSCSI Disk
size=128G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=0 status=active
| `- 7:0:0:0  sdb 8:16 active undef running
`-+- policy='service-time 0' prio=0 status=enabled
  `- 8:0:0:0  sdc 8:32 active undef running
36589cfc00000072b94d0157d71561e8c dm-19 FreeNAS,iSCSI Disk
size=6.0T features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=0 status=active
| `- 11:0:0:0 sdf 8:80 active undef running
`-+- policy='service-time 0' prio=0 status=enabled
  `- 12:0:0:0 sdg 8:96 active undef running
pajamian commented 2 years ago

migrate2rocky was not designed or tested to work in this particular environment, so it's assuming a conventional EFI boot scenario and trying to locate the EFI boot device and partition so it can add a new EFI boot entry for Rocky Linux, but failing.

At line 998 you'll find the efi_check function. If you just add a return as the first line of that function then migrate2rocky will skip the EFI boot checks and not attempt to add an EFI boot entry. Then migrate2rocky should run and do the migration, but you'll need to add the EFI boot entry yourself.

Line 1017 contains the fix_efi function which has two commands (grub2-mkconfig and efibootmgr) that update grub and the EFI boot entry once the migration is complete. These will not be run if you disable the efi_check as per above and you'll need to run them manually, finding the correct parameters to put in. Hopefully this should get you a bootable working Rocky Linux system.

I need not tell you that this should not be done on a production system initially, and to have the system fully backed up.

Please let me know how things go and if you find a working solution so I can code it into migrate2rocky.

chattytak commented 2 years ago

Please let me know how things go and if you find a working solution so I can code it into migrate2rocky.

I found a way to make it work, using almalinux-deploy.sh to migrate to almalinux. Unlike migrate2rocky, almalinux-deploy.sh worked without any problems. So far there is no big difference between rockylinux and almalinux. However, there seems to be a big difference in the migration tools. A program is meaningful only when it works. I'm going to use almalinux because a program that doesn't work is meaningless. Thank you. (I would contribute to migrate2rocky if there is no other tool that works well, but I don't feel like reinventing the wheel.)

pajamian commented 2 years ago

I'm sorry you feel that way as nothing can be improved without the help of those having issues. I hope your experience with Alma Linux is everything you need it to be.