First of all thanks for all people here who gave me input to improve my knowledge for partitioning harddrives. ======================= what you read here: how to convert a msdos partition table (boot with grub2 and a opensuse tumbleweed on it) to a gpt table also booting, WITHOUT data loss in a modern pc. (no ueffi used) ------------------------ why? background: old sda from old system was copied 1:1 to a new system with nvme. using dd ------------------------ we will end up with a gpd disk and a grub-bios-boot-partition from sector 34 to sector 2047. (if your disk is mbr and aligned, this area should be always free) ======================= what i have used to boot system not from installed harddrive: https://www.system-rescue.org/ (you could do all this only if your drive is NOT mounted) ======================= tools involved (all on system-rescue-cd): parted gparted gdisk (so you need a linux system with graphic desktop) ======================= info: all here is written by hand and not copy/paste, so there could be some typos in. ======================= WARNING: you should know what you do and not blind copy some commands from here, you could destroy your system completely !!!!!!! !!!! for sure make a backup before !!!!! ======================= boot the system from system-rescue-cd (9.03) setkmap de-latin1 # for german keyboard (if you like it ;-)) startx ------------------ take a look about your partitions: gparted: partition table: msdos heads 255 sector/track 2 cylinders 3830411 total sectors 1953525168 sector size 512 nvme0n1p1 first sector ext4 boot / 60GiB 2048 ->125831167 nvme0n1p2 first secror ext4 /home 869.51GiB 125831168 -> 1949331455 nvme0n1p3 first secror linux swap 2GiB 1949331456 -> 1953525167 the nvme0n1p3 "swap" will be deleted because in future swap will be a "swapfile" on this system (docs to do this are not included here) ------------------- check alignment: parted /dev/nvme0n1 (parted) align-check opt 1 (parted) align-check opt 2 (parted) quit (could be also calculated for most drives by hand start of partition should be dividable by 2048) ------------------- delete and resize partitions: gparted: delete swap resize nvme0n1p2 to the end of disk, but leave one mb free (always align to MiB) (gparted shows after pressing "resize-move" 1.71 MiB free) apply all operations (its important to have some free space at end of disk for second gpt partition table i guess must be minimum 33 sectors) (for msdos mbr not needed) ------------------- only for information (partition table is still msdos, so parted shows free from 2 to 2047): parted /dev/nvme0n1 (parted) unit s (parted) print free (parted) quit ------------------- now change mbr to gpt: gdisk /dev/nvme0n1 (command) w (do you want to proceed) y ------------------- now make a small grub boot partition from sector 34 to 2047: (34 is first free if we would use gpt and we see, boot flag is now missing at partition 1) parted /dev/nvme0n1 (parted) unit s (parted) print free (parted) mkpart grub 34s 2047s (warning ...not aligned..) ignore (parted) print free (parted) quit the warning "not aligned" could be easily ignored this partition will be read once at boot so there should be "no" performance impact. ------------------- because now partiton number 3 is now the small grub partition at start, we change the numbering of partitions (i do not like to have 3 before 1): gdisk /dev/nvme0n1 (parted) s (parted) w (parted do you want to proceed) y (parted) quit ------------------- because kernel may have some wrong information's about this nvme now make a new-start of systemrescuecd (not sure if needed): ------------------- setkmap de-latin1 startx gparted set flag for new first partition (nvme0n1p1) "bios_grub" set flag for the old boot partition (nvme0n1p2) "legacy_boot" leave graphical desktop ------------- (the last block i have not done with system-rescue-cd, but with a second tumbleweed system, connected as sda, but i think it should work also with system-rescue-cd) ------------- chroot to the system: mkdir /mnt/nvme0n1p2 mount /dev/nvme0n1p2 /mnt/nvme0n1p2 mount --bind /dev /mnt/nvme0n1p2/dev mount --bind /proc /mnt/nvme0n1p2/proc mount --bind /sys /mnt/nvme0n1p2/sys chroot /mnt/nvme0n1p2 fix your /etc/fstab file from old partition numbers to the new one. grub2-install /dev/nvme0n1 (make sure you have nvme0n1 NOT nvme0n1pX !!) change /etc/default/grub_installdevice in my system change first line to: /dev/nvme0n1p2 and delete line 2: (activate) and line 3: (generic_mbr) so only one line is left (maybe this is not needed:) grub2-mkconfig -o /boot/grub2/grub.cfg (and here should be a newer command, for dracut? i do not know the command if somebody know it would be nice to tell me. - at the moment this will work fine:) mkinitrd exit shutdown -r now system boot with new gpt layout. =================================== simoN -- www.becherer.de