Drive won't boot from its Grub, but will from another drive's Grub, after cloning, why?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












It was a month ago, so if you ask me on details, I might still remember, but better act on information that can be given as of now. Due to the lack of time, I did not ask for help here.




I have cloned my SATA SSD drive to a bigger NVMe drive.



  • The original SATA drive boots fine.


  • The new NVMe drive will boot only via the SATA Grub loader where I must select the NVMe booting drive.



Some outputs of helpful commands follow:



# fdisk -l

Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 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: gpt
Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 194559 192512 94M EFI System
/dev/nvme0n1p2 194560 488396799 488202240 232,8G Linux filesystem


Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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: gpt
Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

Device Start End Sectors Size Type
/dev/sda1 2048 194559 192512 94M EFI System
/dev/sda2 194560 488396799 488202240 232,8G Linux filesystem



I found a possibly useful script called bootinfoscript on SourceForge, it contains way too much information, but that is the point, right(?)



# ./bootinfoscript

Boot Info Script 0.61 [1 April 2012]


============================= Boot Info Summary: ===============================

=> No boot loader is installed in the MBR of /dev/sda.

sda1: __________________________________________________________________________

File system: vfat
Boot sector type: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /efi/BOOT/fbx64.efi /efi/ubuntu/fwupx64.efi
/efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi
/efi/ubuntu/shimx64.efi

sda2: __________________________________________________________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Linux Mint 19 Tara
Boot files: /boot/grub/grub.cfg /etc/fstab

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________
Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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: gpt

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sda1 1 488,397,167 488,397,167 ee GPT


GUID Partition Table detected.

Partition Start Sector End Sector # of Sectors System
/dev/sda1 2,048 194,559 192,512 EFI System partition
/dev/sda2 194,560 488,396,799 488,202,240 Data partition (Linux)

"blkid" output: ________________________________________________________________

Device UUID TYPE LABEL

/dev/nvme0n1
/dev/nvme0n1p1 4966-E925 vfat
/dev/nvme0n1p2 f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ext4
/dev/sda1 7C00-9D19 vfat
/dev/sda2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ext4

================================ Mount points: =================================

Device Mount_Point Type Options

/dev/fuse /run/user/1000/doc fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/nvme0n1p1 /boot/efi vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/nvme0n1p2 / ext4 (rw,relatime,errors=remount-ro,data=ordered)


=========================== sda2/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "$next_entry" ] ; then
set default="$next_entry"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi

if [ x"$feature_menuentry_id" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi

export menuentry_id_option

if [ "$prev_saved_entry" ]; then
set saved_entry="$prev_saved_entry"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault
if [ -z "$boot_once" ]; then
saved_entry="$chosen"
save_env saved_entry
fi

function recordfail
set recordfail=1
if [ -n "$have_grubenv" ]; then if [ -z "$boot_once" ]; then save_env recordfail; fi; fi

function load_video
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi


if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
else
search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
fi
font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
set gfxmode=800x600
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "$recordfail" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=hidden
set timeout=10
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 10 ; then
set timeout=0
fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode
set gfxpayload="$1"
if [ "$1" = "keep" ]; then
set vt_handoff=vt.handoff=1
else
set vt_handoff=
fi

if [ "$recordfail" != 1 ]; then
if [ -e $prefix/gfxblacklist.txt ]; then
if hwmatch $prefix/gfxblacklist.txt 3; then
if [ $match = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Linux Mint 19 Cinnamon' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
else
search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
fi
linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
initrd /boot/initrd.img-4.15.0-39-generic

submenu 'Advanced options for Linux Mint 19 Cinnamon' $menuentry_id_option 'gnulinux-advanced-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-39-generic-advanced-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
else
search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
fi
echo 'Loading Linux 4.15.0-39-generic ...'
linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-39-generic

menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-39-generic-recovery-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
else
search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
fi
echo 'Loading Linux 4.15.0-39-generic ...'
linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-39-generic



### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Linux Mint 19 Tara (19) (on /dev/nvme0n1p2)' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
else
search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
fi
linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
initrd /boot/initrd.img-4.15.0-39-generic

submenu 'Advanced options for Linux Mint 19 Tara (19) (on /dev/nvme0n1p2)' $menuentry_id_option 'osprober-gnulinux-advanced-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
menuentry 'Linux Mint 19 Cinnamon (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic--f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
else
search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
fi
linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
initrd /boot/initrd.img-4.15.0-39-generic

menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic--f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
else
search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
fi
linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
initrd /boot/initrd.img-4.15.0-39-generic

menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (recovery mode) (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic-root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro recovery nomodeset-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
else
search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
fi
linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro recovery nomodeset
initrd /boot/initrd.img-4.15.0-39-generic



set timeout_style=menu
if [ "$timeout" = 0 ]; then
set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware'
fwsetup

### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $config_directory/custom.cfg ]; then
source $config_directory/custom.cfg
elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=============================== sda2/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>

# / was on /dev/sda2 during installation
UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 / ext4 errors=remount-ro 0 1

# /boot/efi was on /dev/sda1 during installation
UUID=7C00-9D19 /boot/efi vfat umask=0077 0 1

# the swap file was created during installation
#/swapfile none swap sw 0 0

# RAM disk
none /ramdisk tmpfs size=2G,mode=0777 0 0

# auto-mount of windows drive
#/dev/disk/by-uuid/9CDAC383DAC357E2 /mnt/9CDAC383DAC357E2 auto nosuid,nodev,nofail,x-gvfs-show,ro 0 0
--------------------------------------------------------------------------------

=================== sda2: Location of files loaded by Grub: ====================

GiB - GB File Fragment(s)


=============================== StdErr Messages: ===============================

cat: /tmp/BootInfo-Pd0sZIg3/Tmp_Log: No such file or directory



I don't know what to do with it, I've tried too many things to even remember them.



I hope the above information would be helpful, otherwise, I am stuck.




The current behavior of the NVMe drive - if I try to boot directly from it, it automatically reboots.



I just do it like this for now:



I just do it like this for now




I do recall one more detail: I used GParted to change the partition UUIDs on the new drive and edited fstab accordingly.




I believe the problem arises from both drives having the same disk UUID, am I right?



If so, how shall I proceed now?




What I've tried:



# tune2fs /dev/nvme0n1 -U random

tune2fs 1.44.1 (24-Mar-2018)
tune2fs: Bad magic number in super-block while trying to open /dev/nvme0n1
Found a gpt partition table in /dev/nvme0n1


So, I suppose changing the whole disk UUID is done in a different way?










share|improve this question



























    up vote
    1
    down vote

    favorite












    It was a month ago, so if you ask me on details, I might still remember, but better act on information that can be given as of now. Due to the lack of time, I did not ask for help here.




    I have cloned my SATA SSD drive to a bigger NVMe drive.



    • The original SATA drive boots fine.


    • The new NVMe drive will boot only via the SATA Grub loader where I must select the NVMe booting drive.



    Some outputs of helpful commands follow:



    # fdisk -l

    Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 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: gpt
    Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

    Device Start End Sectors Size Type
    /dev/nvme0n1p1 2048 194559 192512 94M EFI System
    /dev/nvme0n1p2 194560 488396799 488202240 232,8G Linux filesystem


    Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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: gpt
    Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

    Device Start End Sectors Size Type
    /dev/sda1 2048 194559 192512 94M EFI System
    /dev/sda2 194560 488396799 488202240 232,8G Linux filesystem



    I found a possibly useful script called bootinfoscript on SourceForge, it contains way too much information, but that is the point, right(?)



    # ./bootinfoscript

    Boot Info Script 0.61 [1 April 2012]


    ============================= Boot Info Summary: ===============================

    => No boot loader is installed in the MBR of /dev/sda.

    sda1: __________________________________________________________________________

    File system: vfat
    Boot sector type: FAT32
    Boot sector info: No errors found in the Boot Parameter Block.
    Operating System:
    Boot files: /efi/BOOT/fbx64.efi /efi/ubuntu/fwupx64.efi
    /efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi
    /efi/ubuntu/shimx64.efi

    sda2: __________________________________________________________________________

    File system: ext4
    Boot sector type: -
    Boot sector info:
    Operating System: Linux Mint 19 Tara
    Boot files: /boot/grub/grub.cfg /etc/fstab

    ============================ Drive/Partition Info: =============================

    Drive: sda _____________________________________________________________________
    Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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: gpt

    Partition Boot Start Sector End Sector # of Sectors Id System

    /dev/sda1 1 488,397,167 488,397,167 ee GPT


    GUID Partition Table detected.

    Partition Start Sector End Sector # of Sectors System
    /dev/sda1 2,048 194,559 192,512 EFI System partition
    /dev/sda2 194,560 488,396,799 488,202,240 Data partition (Linux)

    "blkid" output: ________________________________________________________________

    Device UUID TYPE LABEL

    /dev/nvme0n1
    /dev/nvme0n1p1 4966-E925 vfat
    /dev/nvme0n1p2 f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ext4
    /dev/sda1 7C00-9D19 vfat
    /dev/sda2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ext4

    ================================ Mount points: =================================

    Device Mount_Point Type Options

    /dev/fuse /run/user/1000/doc fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
    /dev/nvme0n1p1 /boot/efi vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
    /dev/nvme0n1p2 / ext4 (rw,relatime,errors=remount-ro,data=ordered)


    =========================== sda2/boot/grub/grub.cfg: ===========================

    --------------------------------------------------------------------------------
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #

    ### BEGIN /etc/grub.d/00_header ###
    if [ -s $prefix/grubenv ]; then
    set have_grubenv=true
    load_env
    fi
    if [ "$next_entry" ] ; then
    set default="$next_entry"
    set next_entry=
    save_env next_entry
    set boot_once=true
    else
    set default="0"
    fi

    if [ x"$feature_menuentry_id" = xy ]; then
    menuentry_id_option="--id"
    else
    menuentry_id_option=""
    fi

    export menuentry_id_option

    if [ "$prev_saved_entry" ]; then
    set saved_entry="$prev_saved_entry"
    save_env saved_entry
    set prev_saved_entry=
    save_env prev_saved_entry
    set boot_once=true
    fi

    function savedefault
    if [ -z "$boot_once" ]; then
    saved_entry="$chosen"
    save_env saved_entry
    fi

    function recordfail
    set recordfail=1
    if [ -n "$have_grubenv" ]; then if [ -z "$boot_once" ]; then save_env recordfail; fi; fi

    function load_video
    if [ x$feature_all_video_module = xy ]; then
    insmod all_video
    else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
    fi


    if [ x$feature_default_font_path = xy ] ; then
    font=unicode
    else
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
    else
    search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
    fi
    font="/usr/share/grub/unicode.pf2"
    fi

    if loadfont $font ; then
    set gfxmode=800x600
    load_video
    insmod gfxterm
    set locale_dir=$prefix/locale
    set lang=en_US
    insmod gettext
    fi
    terminal_output gfxterm
    if [ "$recordfail" = 1 ] ; then
    set timeout=30
    else
    if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=10
    # Fallback hidden-timeout code in case the timeout_style feature is
    # unavailable.
    elif sleep --interruptible 10 ; then
    set timeout=0
    fi
    fi
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
    ### END /etc/grub.d/05_debian_theme ###

    ### BEGIN /etc/grub.d/10_linux ###
    function gfxmode
    set gfxpayload="$1"
    if [ "$1" = "keep" ]; then
    set vt_handoff=vt.handoff=1
    else
    set vt_handoff=
    fi

    if [ "$recordfail" != 1 ]; then
    if [ -e $prefix/gfxblacklist.txt ]; then
    if hwmatch $prefix/gfxblacklist.txt 3; then
    if [ $match = 0 ]; then
    set linux_gfx_mode=keep
    else
    set linux_gfx_mode=text
    fi
    else
    set linux_gfx_mode=text
    fi
    else
    set linux_gfx_mode=keep
    fi
    else
    set linux_gfx_mode=text
    fi
    export linux_gfx_mode
    menuentry 'Linux Mint 19 Cinnamon' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
    else
    search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
    fi
    linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
    initrd /boot/initrd.img-4.15.0-39-generic

    submenu 'Advanced options for Linux Mint 19 Cinnamon' $menuentry_id_option 'gnulinux-advanced-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
    menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-39-generic-advanced-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
    else
    search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
    fi
    echo 'Loading Linux 4.15.0-39-generic ...'
    linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
    echo 'Loading initial ramdisk ...'
    initrd /boot/initrd.img-4.15.0-39-generic

    menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-39-generic-recovery-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
    recordfail
    load_video
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
    else
    search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
    fi
    echo 'Loading Linux 4.15.0-39-generic ...'
    linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro recovery nomodeset
    echo 'Loading initial ramdisk ...'
    initrd /boot/initrd.img-4.15.0-39-generic



    ### END /etc/grub.d/10_linux ###

    ### BEGIN /etc/grub.d/20_linux_xen ###

    ### END /etc/grub.d/20_linux_xen ###

    ### BEGIN /etc/grub.d/20_memtest86+ ###
    ### END /etc/grub.d/20_memtest86+ ###

    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry 'Linux Mint 19 Tara (19) (on /dev/nvme0n1p2)' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
    insmod part_gpt
    insmod ext2
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
    else
    search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
    fi
    linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
    initrd /boot/initrd.img-4.15.0-39-generic

    submenu 'Advanced options for Linux Mint 19 Tara (19) (on /dev/nvme0n1p2)' $menuentry_id_option 'osprober-gnulinux-advanced-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
    menuentry 'Linux Mint 19 Cinnamon (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic--f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
    insmod part_gpt
    insmod ext2
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
    else
    search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
    fi
    linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
    initrd /boot/initrd.img-4.15.0-39-generic

    menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic--f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
    insmod part_gpt
    insmod ext2
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
    else
    search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
    fi
    linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
    initrd /boot/initrd.img-4.15.0-39-generic

    menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (recovery mode) (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic-root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro recovery nomodeset-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
    insmod part_gpt
    insmod ext2
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
    else
    search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
    fi
    linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro recovery nomodeset
    initrd /boot/initrd.img-4.15.0-39-generic



    set timeout_style=menu
    if [ "$timeout" = 0 ]; then
    set timeout=10
    fi
    ### END /etc/grub.d/30_os-prober ###

    ### BEGIN /etc/grub.d/30_uefi-firmware ###
    menuentry 'System setup' $menuentry_id_option 'uefi-firmware'
    fwsetup

    ### END /etc/grub.d/30_uefi-firmware ###

    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###

    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f $config_directory/custom.cfg ]; then
    source $config_directory/custom.cfg
    elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
    source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    --------------------------------------------------------------------------------

    =============================== sda2/etc/fstab: ================================

    --------------------------------------------------------------------------------
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point> <type> <options> <dump> <pass>

    # / was on /dev/sda2 during installation
    UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 / ext4 errors=remount-ro 0 1

    # /boot/efi was on /dev/sda1 during installation
    UUID=7C00-9D19 /boot/efi vfat umask=0077 0 1

    # the swap file was created during installation
    #/swapfile none swap sw 0 0

    # RAM disk
    none /ramdisk tmpfs size=2G,mode=0777 0 0

    # auto-mount of windows drive
    #/dev/disk/by-uuid/9CDAC383DAC357E2 /mnt/9CDAC383DAC357E2 auto nosuid,nodev,nofail,x-gvfs-show,ro 0 0
    --------------------------------------------------------------------------------

    =================== sda2: Location of files loaded by Grub: ====================

    GiB - GB File Fragment(s)


    =============================== StdErr Messages: ===============================

    cat: /tmp/BootInfo-Pd0sZIg3/Tmp_Log: No such file or directory



    I don't know what to do with it, I've tried too many things to even remember them.



    I hope the above information would be helpful, otherwise, I am stuck.




    The current behavior of the NVMe drive - if I try to boot directly from it, it automatically reboots.



    I just do it like this for now:



    I just do it like this for now




    I do recall one more detail: I used GParted to change the partition UUIDs on the new drive and edited fstab accordingly.




    I believe the problem arises from both drives having the same disk UUID, am I right?



    If so, how shall I proceed now?




    What I've tried:



    # tune2fs /dev/nvme0n1 -U random

    tune2fs 1.44.1 (24-Mar-2018)
    tune2fs: Bad magic number in super-block while trying to open /dev/nvme0n1
    Found a gpt partition table in /dev/nvme0n1


    So, I suppose changing the whole disk UUID is done in a different way?










    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      It was a month ago, so if you ask me on details, I might still remember, but better act on information that can be given as of now. Due to the lack of time, I did not ask for help here.




      I have cloned my SATA SSD drive to a bigger NVMe drive.



      • The original SATA drive boots fine.


      • The new NVMe drive will boot only via the SATA Grub loader where I must select the NVMe booting drive.



      Some outputs of helpful commands follow:



      # fdisk -l

      Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 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: gpt
      Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

      Device Start End Sectors Size Type
      /dev/nvme0n1p1 2048 194559 192512 94M EFI System
      /dev/nvme0n1p2 194560 488396799 488202240 232,8G Linux filesystem


      Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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: gpt
      Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

      Device Start End Sectors Size Type
      /dev/sda1 2048 194559 192512 94M EFI System
      /dev/sda2 194560 488396799 488202240 232,8G Linux filesystem



      I found a possibly useful script called bootinfoscript on SourceForge, it contains way too much information, but that is the point, right(?)



      # ./bootinfoscript

      Boot Info Script 0.61 [1 April 2012]


      ============================= Boot Info Summary: ===============================

      => No boot loader is installed in the MBR of /dev/sda.

      sda1: __________________________________________________________________________

      File system: vfat
      Boot sector type: FAT32
      Boot sector info: No errors found in the Boot Parameter Block.
      Operating System:
      Boot files: /efi/BOOT/fbx64.efi /efi/ubuntu/fwupx64.efi
      /efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi
      /efi/ubuntu/shimx64.efi

      sda2: __________________________________________________________________________

      File system: ext4
      Boot sector type: -
      Boot sector info:
      Operating System: Linux Mint 19 Tara
      Boot files: /boot/grub/grub.cfg /etc/fstab

      ============================ Drive/Partition Info: =============================

      Drive: sda _____________________________________________________________________
      Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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: gpt

      Partition Boot Start Sector End Sector # of Sectors Id System

      /dev/sda1 1 488,397,167 488,397,167 ee GPT


      GUID Partition Table detected.

      Partition Start Sector End Sector # of Sectors System
      /dev/sda1 2,048 194,559 192,512 EFI System partition
      /dev/sda2 194,560 488,396,799 488,202,240 Data partition (Linux)

      "blkid" output: ________________________________________________________________

      Device UUID TYPE LABEL

      /dev/nvme0n1
      /dev/nvme0n1p1 4966-E925 vfat
      /dev/nvme0n1p2 f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ext4
      /dev/sda1 7C00-9D19 vfat
      /dev/sda2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ext4

      ================================ Mount points: =================================

      Device Mount_Point Type Options

      /dev/fuse /run/user/1000/doc fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
      /dev/nvme0n1p1 /boot/efi vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
      /dev/nvme0n1p2 / ext4 (rw,relatime,errors=remount-ro,data=ordered)


      =========================== sda2/boot/grub/grub.cfg: ===========================

      --------------------------------------------------------------------------------
      #
      # DO NOT EDIT THIS FILE
      #
      # It is automatically generated by grub-mkconfig using templates
      # from /etc/grub.d and settings from /etc/default/grub
      #

      ### BEGIN /etc/grub.d/00_header ###
      if [ -s $prefix/grubenv ]; then
      set have_grubenv=true
      load_env
      fi
      if [ "$next_entry" ] ; then
      set default="$next_entry"
      set next_entry=
      save_env next_entry
      set boot_once=true
      else
      set default="0"
      fi

      if [ x"$feature_menuentry_id" = xy ]; then
      menuentry_id_option="--id"
      else
      menuentry_id_option=""
      fi

      export menuentry_id_option

      if [ "$prev_saved_entry" ]; then
      set saved_entry="$prev_saved_entry"
      save_env saved_entry
      set prev_saved_entry=
      save_env prev_saved_entry
      set boot_once=true
      fi

      function savedefault
      if [ -z "$boot_once" ]; then
      saved_entry="$chosen"
      save_env saved_entry
      fi

      function recordfail
      set recordfail=1
      if [ -n "$have_grubenv" ]; then if [ -z "$boot_once" ]; then save_env recordfail; fi; fi

      function load_video
      if [ x$feature_all_video_module = xy ]; then
      insmod all_video
      else
      insmod efi_gop
      insmod efi_uga
      insmod ieee1275_fb
      insmod vbe
      insmod vga
      insmod video_bochs
      insmod video_cirrus
      fi


      if [ x$feature_default_font_path = xy ] ; then
      font=unicode
      else
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      else
      search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      fi
      font="/usr/share/grub/unicode.pf2"
      fi

      if loadfont $font ; then
      set gfxmode=800x600
      load_video
      insmod gfxterm
      set locale_dir=$prefix/locale
      set lang=en_US
      insmod gettext
      fi
      terminal_output gfxterm
      if [ "$recordfail" = 1 ] ; then
      set timeout=30
      else
      if [ x$feature_timeout_style = xy ] ; then
      set timeout_style=hidden
      set timeout=10
      # Fallback hidden-timeout code in case the timeout_style feature is
      # unavailable.
      elif sleep --interruptible 10 ; then
      set timeout=0
      fi
      fi
      ### END /etc/grub.d/00_header ###

      ### BEGIN /etc/grub.d/05_debian_theme ###
      set menu_color_normal=white/black
      set menu_color_highlight=black/light-gray
      ### END /etc/grub.d/05_debian_theme ###

      ### BEGIN /etc/grub.d/10_linux ###
      function gfxmode
      set gfxpayload="$1"
      if [ "$1" = "keep" ]; then
      set vt_handoff=vt.handoff=1
      else
      set vt_handoff=
      fi

      if [ "$recordfail" != 1 ]; then
      if [ -e $prefix/gfxblacklist.txt ]; then
      if hwmatch $prefix/gfxblacklist.txt 3; then
      if [ $match = 0 ]; then
      set linux_gfx_mode=keep
      else
      set linux_gfx_mode=text
      fi
      else
      set linux_gfx_mode=text
      fi
      else
      set linux_gfx_mode=keep
      fi
      else
      set linux_gfx_mode=text
      fi
      export linux_gfx_mode
      menuentry 'Linux Mint 19 Cinnamon' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
      recordfail
      load_video
      gfxmode $linux_gfx_mode
      insmod gzio
      if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      else
      search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      fi
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
      initrd /boot/initrd.img-4.15.0-39-generic

      submenu 'Advanced options for Linux Mint 19 Cinnamon' $menuentry_id_option 'gnulinux-advanced-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
      menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-39-generic-advanced-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
      recordfail
      load_video
      gfxmode $linux_gfx_mode
      insmod gzio
      if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      else
      search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      fi
      echo 'Loading Linux 4.15.0-39-generic ...'
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
      echo 'Loading initial ramdisk ...'
      initrd /boot/initrd.img-4.15.0-39-generic

      menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-39-generic-recovery-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
      recordfail
      load_video
      insmod gzio
      if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      else
      search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      fi
      echo 'Loading Linux 4.15.0-39-generic ...'
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro recovery nomodeset
      echo 'Loading initial ramdisk ...'
      initrd /boot/initrd.img-4.15.0-39-generic



      ### END /etc/grub.d/10_linux ###

      ### BEGIN /etc/grub.d/20_linux_xen ###

      ### END /etc/grub.d/20_linux_xen ###

      ### BEGIN /etc/grub.d/20_memtest86+ ###
      ### END /etc/grub.d/20_memtest86+ ###

      ### BEGIN /etc/grub.d/30_os-prober ###
      menuentry 'Linux Mint 19 Tara (19) (on /dev/nvme0n1p2)' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
      insmod part_gpt
      insmod ext2
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      else
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      fi
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
      initrd /boot/initrd.img-4.15.0-39-generic

      submenu 'Advanced options for Linux Mint 19 Tara (19) (on /dev/nvme0n1p2)' $menuentry_id_option 'osprober-gnulinux-advanced-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
      menuentry 'Linux Mint 19 Cinnamon (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic--f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
      insmod part_gpt
      insmod ext2
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      else
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      fi
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
      initrd /boot/initrd.img-4.15.0-39-generic

      menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic--f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
      insmod part_gpt
      insmod ext2
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      else
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      fi
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
      initrd /boot/initrd.img-4.15.0-39-generic

      menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (recovery mode) (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic-root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro recovery nomodeset-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
      insmod part_gpt
      insmod ext2
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      else
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      fi
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro recovery nomodeset
      initrd /boot/initrd.img-4.15.0-39-generic



      set timeout_style=menu
      if [ "$timeout" = 0 ]; then
      set timeout=10
      fi
      ### END /etc/grub.d/30_os-prober ###

      ### BEGIN /etc/grub.d/30_uefi-firmware ###
      menuentry 'System setup' $menuentry_id_option 'uefi-firmware'
      fwsetup

      ### END /etc/grub.d/30_uefi-firmware ###

      ### BEGIN /etc/grub.d/40_custom ###
      # This file provides an easy way to add custom menu entries. Simply type the
      # menu entries you want to add after this comment. Be careful not to change
      # the 'exec tail' line above.
      ### END /etc/grub.d/40_custom ###

      ### BEGIN /etc/grub.d/41_custom ###
      if [ -f $config_directory/custom.cfg ]; then
      source $config_directory/custom.cfg
      elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
      fi
      ### END /etc/grub.d/41_custom ###
      --------------------------------------------------------------------------------

      =============================== sda2/etc/fstab: ================================

      --------------------------------------------------------------------------------
      # /etc/fstab: static file system information.
      #
      # Use 'blkid' to print the universally unique identifier for a
      # device; this may be used with UUID= as a more robust way to name devices
      # that works even if disks are added and removed. See fstab(5).
      #
      # <file system> <mount point> <type> <options> <dump> <pass>

      # / was on /dev/sda2 during installation
      UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 / ext4 errors=remount-ro 0 1

      # /boot/efi was on /dev/sda1 during installation
      UUID=7C00-9D19 /boot/efi vfat umask=0077 0 1

      # the swap file was created during installation
      #/swapfile none swap sw 0 0

      # RAM disk
      none /ramdisk tmpfs size=2G,mode=0777 0 0

      # auto-mount of windows drive
      #/dev/disk/by-uuid/9CDAC383DAC357E2 /mnt/9CDAC383DAC357E2 auto nosuid,nodev,nofail,x-gvfs-show,ro 0 0
      --------------------------------------------------------------------------------

      =================== sda2: Location of files loaded by Grub: ====================

      GiB - GB File Fragment(s)


      =============================== StdErr Messages: ===============================

      cat: /tmp/BootInfo-Pd0sZIg3/Tmp_Log: No such file or directory



      I don't know what to do with it, I've tried too many things to even remember them.



      I hope the above information would be helpful, otherwise, I am stuck.




      The current behavior of the NVMe drive - if I try to boot directly from it, it automatically reboots.



      I just do it like this for now:



      I just do it like this for now




      I do recall one more detail: I used GParted to change the partition UUIDs on the new drive and edited fstab accordingly.




      I believe the problem arises from both drives having the same disk UUID, am I right?



      If so, how shall I proceed now?




      What I've tried:



      # tune2fs /dev/nvme0n1 -U random

      tune2fs 1.44.1 (24-Mar-2018)
      tune2fs: Bad magic number in super-block while trying to open /dev/nvme0n1
      Found a gpt partition table in /dev/nvme0n1


      So, I suppose changing the whole disk UUID is done in a different way?










      share|improve this question















      It was a month ago, so if you ask me on details, I might still remember, but better act on information that can be given as of now. Due to the lack of time, I did not ask for help here.




      I have cloned my SATA SSD drive to a bigger NVMe drive.



      • The original SATA drive boots fine.


      • The new NVMe drive will boot only via the SATA Grub loader where I must select the NVMe booting drive.



      Some outputs of helpful commands follow:



      # fdisk -l

      Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 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: gpt
      Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

      Device Start End Sectors Size Type
      /dev/nvme0n1p1 2048 194559 192512 94M EFI System
      /dev/nvme0n1p2 194560 488396799 488202240 232,8G Linux filesystem


      Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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: gpt
      Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

      Device Start End Sectors Size Type
      /dev/sda1 2048 194559 192512 94M EFI System
      /dev/sda2 194560 488396799 488202240 232,8G Linux filesystem



      I found a possibly useful script called bootinfoscript on SourceForge, it contains way too much information, but that is the point, right(?)



      # ./bootinfoscript

      Boot Info Script 0.61 [1 April 2012]


      ============================= Boot Info Summary: ===============================

      => No boot loader is installed in the MBR of /dev/sda.

      sda1: __________________________________________________________________________

      File system: vfat
      Boot sector type: FAT32
      Boot sector info: No errors found in the Boot Parameter Block.
      Operating System:
      Boot files: /efi/BOOT/fbx64.efi /efi/ubuntu/fwupx64.efi
      /efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi
      /efi/ubuntu/shimx64.efi

      sda2: __________________________________________________________________________

      File system: ext4
      Boot sector type: -
      Boot sector info:
      Operating System: Linux Mint 19 Tara
      Boot files: /boot/grub/grub.cfg /etc/fstab

      ============================ Drive/Partition Info: =============================

      Drive: sda _____________________________________________________________________
      Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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: gpt

      Partition Boot Start Sector End Sector # of Sectors Id System

      /dev/sda1 1 488,397,167 488,397,167 ee GPT


      GUID Partition Table detected.

      Partition Start Sector End Sector # of Sectors System
      /dev/sda1 2,048 194,559 192,512 EFI System partition
      /dev/sda2 194,560 488,396,799 488,202,240 Data partition (Linux)

      "blkid" output: ________________________________________________________________

      Device UUID TYPE LABEL

      /dev/nvme0n1
      /dev/nvme0n1p1 4966-E925 vfat
      /dev/nvme0n1p2 f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ext4
      /dev/sda1 7C00-9D19 vfat
      /dev/sda2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ext4

      ================================ Mount points: =================================

      Device Mount_Point Type Options

      /dev/fuse /run/user/1000/doc fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
      /dev/nvme0n1p1 /boot/efi vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
      /dev/nvme0n1p2 / ext4 (rw,relatime,errors=remount-ro,data=ordered)


      =========================== sda2/boot/grub/grub.cfg: ===========================

      --------------------------------------------------------------------------------
      #
      # DO NOT EDIT THIS FILE
      #
      # It is automatically generated by grub-mkconfig using templates
      # from /etc/grub.d and settings from /etc/default/grub
      #

      ### BEGIN /etc/grub.d/00_header ###
      if [ -s $prefix/grubenv ]; then
      set have_grubenv=true
      load_env
      fi
      if [ "$next_entry" ] ; then
      set default="$next_entry"
      set next_entry=
      save_env next_entry
      set boot_once=true
      else
      set default="0"
      fi

      if [ x"$feature_menuentry_id" = xy ]; then
      menuentry_id_option="--id"
      else
      menuentry_id_option=""
      fi

      export menuentry_id_option

      if [ "$prev_saved_entry" ]; then
      set saved_entry="$prev_saved_entry"
      save_env saved_entry
      set prev_saved_entry=
      save_env prev_saved_entry
      set boot_once=true
      fi

      function savedefault
      if [ -z "$boot_once" ]; then
      saved_entry="$chosen"
      save_env saved_entry
      fi

      function recordfail
      set recordfail=1
      if [ -n "$have_grubenv" ]; then if [ -z "$boot_once" ]; then save_env recordfail; fi; fi

      function load_video
      if [ x$feature_all_video_module = xy ]; then
      insmod all_video
      else
      insmod efi_gop
      insmod efi_uga
      insmod ieee1275_fb
      insmod vbe
      insmod vga
      insmod video_bochs
      insmod video_cirrus
      fi


      if [ x$feature_default_font_path = xy ] ; then
      font=unicode
      else
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      else
      search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      fi
      font="/usr/share/grub/unicode.pf2"
      fi

      if loadfont $font ; then
      set gfxmode=800x600
      load_video
      insmod gfxterm
      set locale_dir=$prefix/locale
      set lang=en_US
      insmod gettext
      fi
      terminal_output gfxterm
      if [ "$recordfail" = 1 ] ; then
      set timeout=30
      else
      if [ x$feature_timeout_style = xy ] ; then
      set timeout_style=hidden
      set timeout=10
      # Fallback hidden-timeout code in case the timeout_style feature is
      # unavailable.
      elif sleep --interruptible 10 ; then
      set timeout=0
      fi
      fi
      ### END /etc/grub.d/00_header ###

      ### BEGIN /etc/grub.d/05_debian_theme ###
      set menu_color_normal=white/black
      set menu_color_highlight=black/light-gray
      ### END /etc/grub.d/05_debian_theme ###

      ### BEGIN /etc/grub.d/10_linux ###
      function gfxmode
      set gfxpayload="$1"
      if [ "$1" = "keep" ]; then
      set vt_handoff=vt.handoff=1
      else
      set vt_handoff=
      fi

      if [ "$recordfail" != 1 ]; then
      if [ -e $prefix/gfxblacklist.txt ]; then
      if hwmatch $prefix/gfxblacklist.txt 3; then
      if [ $match = 0 ]; then
      set linux_gfx_mode=keep
      else
      set linux_gfx_mode=text
      fi
      else
      set linux_gfx_mode=text
      fi
      else
      set linux_gfx_mode=keep
      fi
      else
      set linux_gfx_mode=text
      fi
      export linux_gfx_mode
      menuentry 'Linux Mint 19 Cinnamon' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
      recordfail
      load_video
      gfxmode $linux_gfx_mode
      insmod gzio
      if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      else
      search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      fi
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
      initrd /boot/initrd.img-4.15.0-39-generic

      submenu 'Advanced options for Linux Mint 19 Cinnamon' $menuentry_id_option 'gnulinux-advanced-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
      menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-39-generic-advanced-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
      recordfail
      load_video
      gfxmode $linux_gfx_mode
      insmod gzio
      if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      else
      search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      fi
      echo 'Loading Linux 4.15.0-39-generic ...'
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
      echo 'Loading initial ramdisk ...'
      initrd /boot/initrd.img-4.15.0-39-generic

      menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-39-generic-recovery-b235cea3-ea5b-4571-a252-b75b9cb3f5f0'
      recordfail
      load_video
      insmod gzio
      if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      else
      search --no-floppy --fs-uuid --set=root b235cea3-ea5b-4571-a252-b75b9cb3f5f0
      fi
      echo 'Loading Linux 4.15.0-39-generic ...'
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 ro recovery nomodeset
      echo 'Loading initial ramdisk ...'
      initrd /boot/initrd.img-4.15.0-39-generic



      ### END /etc/grub.d/10_linux ###

      ### BEGIN /etc/grub.d/20_linux_xen ###

      ### END /etc/grub.d/20_linux_xen ###

      ### BEGIN /etc/grub.d/20_memtest86+ ###
      ### END /etc/grub.d/20_memtest86+ ###

      ### BEGIN /etc/grub.d/30_os-prober ###
      menuentry 'Linux Mint 19 Tara (19) (on /dev/nvme0n1p2)' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
      insmod part_gpt
      insmod ext2
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      else
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      fi
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
      initrd /boot/initrd.img-4.15.0-39-generic

      submenu 'Advanced options for Linux Mint 19 Tara (19) (on /dev/nvme0n1p2)' $menuentry_id_option 'osprober-gnulinux-advanced-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
      menuentry 'Linux Mint 19 Cinnamon (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic--f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
      insmod part_gpt
      insmod ext2
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      else
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      fi
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
      initrd /boot/initrd.img-4.15.0-39-generic

      menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic--f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
      insmod part_gpt
      insmod ext2
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      else
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      fi
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro quiet splash fsck.mode=force fsck.repair=yes $vt_handoff
      initrd /boot/initrd.img-4.15.0-39-generic

      menuentry 'Linux Mint 19 Cinnamon, with Linux 4.15.0-39-generic (recovery mode) (on /dev/nvme0n1p2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.15.0-39-generic-root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro recovery nomodeset-f1fc7345-be7a-4c6b-9559-fc6e2d445bfa'
      insmod part_gpt
      insmod ext2
      if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      else
      search --no-floppy --fs-uuid --set=root f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
      fi
      linux /boot/vmlinuz-4.15.0-39-generic root=UUID=f1fc7345-be7a-4c6b-9559-fc6e2d445bfa ro recovery nomodeset
      initrd /boot/initrd.img-4.15.0-39-generic



      set timeout_style=menu
      if [ "$timeout" = 0 ]; then
      set timeout=10
      fi
      ### END /etc/grub.d/30_os-prober ###

      ### BEGIN /etc/grub.d/30_uefi-firmware ###
      menuentry 'System setup' $menuentry_id_option 'uefi-firmware'
      fwsetup

      ### END /etc/grub.d/30_uefi-firmware ###

      ### BEGIN /etc/grub.d/40_custom ###
      # This file provides an easy way to add custom menu entries. Simply type the
      # menu entries you want to add after this comment. Be careful not to change
      # the 'exec tail' line above.
      ### END /etc/grub.d/40_custom ###

      ### BEGIN /etc/grub.d/41_custom ###
      if [ -f $config_directory/custom.cfg ]; then
      source $config_directory/custom.cfg
      elif [ -z "$config_directory" -a -f $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
      fi
      ### END /etc/grub.d/41_custom ###
      --------------------------------------------------------------------------------

      =============================== sda2/etc/fstab: ================================

      --------------------------------------------------------------------------------
      # /etc/fstab: static file system information.
      #
      # Use 'blkid' to print the universally unique identifier for a
      # device; this may be used with UUID= as a more robust way to name devices
      # that works even if disks are added and removed. See fstab(5).
      #
      # <file system> <mount point> <type> <options> <dump> <pass>

      # / was on /dev/sda2 during installation
      UUID=b235cea3-ea5b-4571-a252-b75b9cb3f5f0 / ext4 errors=remount-ro 0 1

      # /boot/efi was on /dev/sda1 during installation
      UUID=7C00-9D19 /boot/efi vfat umask=0077 0 1

      # the swap file was created during installation
      #/swapfile none swap sw 0 0

      # RAM disk
      none /ramdisk tmpfs size=2G,mode=0777 0 0

      # auto-mount of windows drive
      #/dev/disk/by-uuid/9CDAC383DAC357E2 /mnt/9CDAC383DAC357E2 auto nosuid,nodev,nofail,x-gvfs-show,ro 0 0
      --------------------------------------------------------------------------------

      =================== sda2: Location of files loaded by Grub: ====================

      GiB - GB File Fragment(s)


      =============================== StdErr Messages: ===============================

      cat: /tmp/BootInfo-Pd0sZIg3/Tmp_Log: No such file or directory



      I don't know what to do with it, I've tried too many things to even remember them.



      I hope the above information would be helpful, otherwise, I am stuck.




      The current behavior of the NVMe drive - if I try to boot directly from it, it automatically reboots.



      I just do it like this for now:



      I just do it like this for now




      I do recall one more detail: I used GParted to change the partition UUIDs on the new drive and edited fstab accordingly.




      I believe the problem arises from both drives having the same disk UUID, am I right?



      If so, how shall I proceed now?




      What I've tried:



      # tune2fs /dev/nvme0n1 -U random

      tune2fs 1.44.1 (24-Mar-2018)
      tune2fs: Bad magic number in super-block while trying to open /dev/nvme0n1
      Found a gpt partition table in /dev/nvme0n1


      So, I suppose changing the whole disk UUID is done in a different way?







      linux boot grub2 cloning uuid






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 7 at 10:23

























      asked Dec 7 at 4:49









      Vlastimil

      7,6591258132




      7,6591258132




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Disk UUIDs



          I believe this was the main culprit and was in need of a change.



          It was as simple as booting up the system on the SATA drive and running:



          # gdisk /dev/nvme0n1


          x for experts menu



          g for new disk GUID



          R for randomize



          w to write changes to disk



          y to confirm



          The disk UUID had been changed... No need to change both of them, of course.



          # fdisk -l | grep -i identifier

          Disk identifier: 989573D5-37E7-437A-B680-9410F7234A94
          Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4



          Partitions UUIDs



          Again, to change those I used:



          # gdisk /dev/nvme0n1


          x for experts menu



          c for new partition UUID



          1 for the first partition; repeat these steps for the second partition



          R for randomize



          w to write changes to disk



          y to confirm




          GRUB update



          This was as simple as running:



          # update-grub



          Initrd regeneration



          # update-initramfs -u -k all



          UEFI BIOS settings



          The boot options had to be removed and updated.



          The NVMe drive boots just fine now.




          Notes



          • I do not use chroot for cloning. I use plain cat or more convenient pv for disk cloning purposes. I read something about it now. I never needed it, ever. And I cloned like a hundred of drives already.


          • Whenever I want to do an exact copy I do that on my SATA server, but this new M.2 PCIe is not exactly pluggable to it. So I elaborated a little. It is out of the scope of this Q & A.


          • I heard there are adapters, but I am not a fan of those, so I used my server as a middleman over the local network.


          • I do not like complications. Cloning systems, be it Linux or Windows is rather easy to me. But in a case like this (SATA to M.2) was a bit of a pain.


          • That was because on one drive was Linux and on the second there was Windows. And I wanted to keep everything in place, no re-installation, no rsync, or whatever one might use to copy. I do clone exact duplicates instead.


          • All you need is your brain and gdisk which I usually use to fix PMBR and such things, which are unavoidable with my methods but extremely quick to resolve.


          • This case was different, though, I did prepare a lot. Like doing (1:1) backups and such. It was my personal computer and I wanted just to switch over the system drives: M.2 + Windows & SATA + Linux. I wanted to make it the other way around.


          • This question arose once I needed to make sure the new Linux drive is doing fine as it is my primary operating system...






          share|improve this answer





























            up vote
            0
            down vote













            Based on the provided information it is hard to say what exactly is going on, your assumption with a UUID issue is most likely true.



            Here is how I would proceede to get your challenge done:



            • Clear the NVME using dd and /dev/zero. It should be sufficient to use bs=512 count=4

            • Create new partitions and file systems on the NVME.

            • Boot into a live system.

            • Copy the data from the SSD partitions to the NVME partitions.

            • Install Grub on the NVME, update /etc/fstab, update grub.cfg.

            For the last point I recommend the following method:



            • While still beeing on the live system, create a new "root" directory, mount the NVME's root file system there.


            • mount --bind /dev, /proc, /sys into the new "root". E.g. mount --bind /dev /mnt/nvmeroot/dev

            • chroot into the new "root" using: chroot /mnt/nvmeroot/ /bin/bash

            • Use blkid to find out new partition UUIDs, update /etc/fstab accordingly.

            • Install grub onto the nvme e.g. using grub-install

            • Update grubs config file with update-grub or grub2-mkconfig

            • Exit the chroot.

            • Unmount bind mounts, and the new "root".

            • Reboot from the NVME.

            In case something does not work:



            • Use the the e (edit) button in grub, and remove linux boot arguments as quiet, splash, rhgb options so you can see error messages during boot.

            • Reboot using the live system, mount the new "root", do the bind mounts, chroot and fix the issue, try again.





            share|improve this answer




















            • Why don't you try starting at: "In case something does not work"?
              – hargut
              Dec 7 at 7:32











            • A UUID is a Unique Identifier ID, it is simply NOT supposed to be duplicated. As soon as duplicated it would loose its main purpose of beeing UNIQUE.
              – hargut
              Dec 7 at 7:36











            • If you do not understand the last sentence, try reading the whole post.
              – hargut
              Dec 7 at 7:38






            • 2




              You do not need to wipe out disks to deal with UUID issues.
              – Rui F Ribeiro
              Dec 7 at 8:17






            • 1




              I am not sure if you are more interested on arguing or improving your answer. You missed the initrd (re)generation btw.
              – Rui F Ribeiro
              Dec 7 at 8:46

















            up vote
            0
            down vote














            Drive won't boot... after cloning, why?




            I do not have a /etc/default/grub handy but I will use a line from your bootinfo script



            # auto-mount of windows drive
            #/dev/disk/by-uuid/9CDAC383DAC357E2 /mnt/9CDAC383DAC357E2 auto nosuid,nodev,nofail,x-gvfs-show,ro 0 0


            so your original drive has UUID whatever



            you clone the contents of that disk to a new disk, or NVME thing. And the contents of grub on the new disk will still all reference uuid whatever which was the old disk, not the current new disk.



            That new disk will not have the same UUID as the original, you have to correct everywhere it was used, basically /etc/default/grub and follow that with a grub2-mkconfig and also correct your /etc/fstab.




            I believe the problem arises from both drives having the same disk UUID, am I right?




            UUID = universally unique identifier. The UUID should be different.



            There are a handful of ways to mount a disk... by-uuid or by-id or by-name or by-label or by-path of the top of my head. I do not know if all linux distributions follow this model but if you look under /dev/disk/ you will should see sub folders



            • by-id

            • by-label

            • by-path

            • by-uuid

            if you do by-name then that is simply calling out the disk from /dev/sda1 or /dev/sd?? which is not unique and i recommend against doing... if there is only ever one disk present then it would be /dev/sda and work but it would not be unique and would not be explicit so over time you take your chances. And things may be further complicated with an NVME showing up differently as /dev/nvme????



            from your fdisk:



            Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
            Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

            Device Start End Sectors Size Type
            /dev/nvme0n1p1 2048 194559 192512 94M EFI System
            /dev/nvme0n1p2 194560 488396799 488202240 232,8G Linux filesystem


            • look under /dev/disk/? and find that corresponding identifier.

            • correct your boot files to use this new nvme disk explicitly to boot it.

            • correct the /etc/fstab on that disk to use that identifier, it will have the text referencing the old disk because you cloned.





            share|improve this answer




















            • I used GParted to change the partition UUIDs on the new drive and edited fstab accordingly. you change uuid with gparted after system is running, but you are NOT changing the UUID of the disk on the disk, it will revert back to it's unique id on next boot or power cycle
              – ron
              Dec 7 at 15:46











            • fstab is part 2 of the fix, part 1 is modifying grub correctly to reference the new disk or in you case nvme
              – ron
              Dec 7 at 15:49










            • changing a disk UUID is a horrible way to solve this problem
              – ron
              Dec 7 at 15:52










            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f486499%2fdrive-wont-boot-from-its-grub-but-will-from-another-drives-grub-after-clonin%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            Disk UUIDs



            I believe this was the main culprit and was in need of a change.



            It was as simple as booting up the system on the SATA drive and running:



            # gdisk /dev/nvme0n1


            x for experts menu



            g for new disk GUID



            R for randomize



            w to write changes to disk



            y to confirm



            The disk UUID had been changed... No need to change both of them, of course.



            # fdisk -l | grep -i identifier

            Disk identifier: 989573D5-37E7-437A-B680-9410F7234A94
            Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4



            Partitions UUIDs



            Again, to change those I used:



            # gdisk /dev/nvme0n1


            x for experts menu



            c for new partition UUID



            1 for the first partition; repeat these steps for the second partition



            R for randomize



            w to write changes to disk



            y to confirm




            GRUB update



            This was as simple as running:



            # update-grub



            Initrd regeneration



            # update-initramfs -u -k all



            UEFI BIOS settings



            The boot options had to be removed and updated.



            The NVMe drive boots just fine now.




            Notes



            • I do not use chroot for cloning. I use plain cat or more convenient pv for disk cloning purposes. I read something about it now. I never needed it, ever. And I cloned like a hundred of drives already.


            • Whenever I want to do an exact copy I do that on my SATA server, but this new M.2 PCIe is not exactly pluggable to it. So I elaborated a little. It is out of the scope of this Q & A.


            • I heard there are adapters, but I am not a fan of those, so I used my server as a middleman over the local network.


            • I do not like complications. Cloning systems, be it Linux or Windows is rather easy to me. But in a case like this (SATA to M.2) was a bit of a pain.


            • That was because on one drive was Linux and on the second there was Windows. And I wanted to keep everything in place, no re-installation, no rsync, or whatever one might use to copy. I do clone exact duplicates instead.


            • All you need is your brain and gdisk which I usually use to fix PMBR and such things, which are unavoidable with my methods but extremely quick to resolve.


            • This case was different, though, I did prepare a lot. Like doing (1:1) backups and such. It was my personal computer and I wanted just to switch over the system drives: M.2 + Windows & SATA + Linux. I wanted to make it the other way around.


            • This question arose once I needed to make sure the new Linux drive is doing fine as it is my primary operating system...






            share|improve this answer


























              up vote
              2
              down vote



              accepted










              Disk UUIDs



              I believe this was the main culprit and was in need of a change.



              It was as simple as booting up the system on the SATA drive and running:



              # gdisk /dev/nvme0n1


              x for experts menu



              g for new disk GUID



              R for randomize



              w to write changes to disk



              y to confirm



              The disk UUID had been changed... No need to change both of them, of course.



              # fdisk -l | grep -i identifier

              Disk identifier: 989573D5-37E7-437A-B680-9410F7234A94
              Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4



              Partitions UUIDs



              Again, to change those I used:



              # gdisk /dev/nvme0n1


              x for experts menu



              c for new partition UUID



              1 for the first partition; repeat these steps for the second partition



              R for randomize



              w to write changes to disk



              y to confirm




              GRUB update



              This was as simple as running:



              # update-grub



              Initrd regeneration



              # update-initramfs -u -k all



              UEFI BIOS settings



              The boot options had to be removed and updated.



              The NVMe drive boots just fine now.




              Notes



              • I do not use chroot for cloning. I use plain cat or more convenient pv for disk cloning purposes. I read something about it now. I never needed it, ever. And I cloned like a hundred of drives already.


              • Whenever I want to do an exact copy I do that on my SATA server, but this new M.2 PCIe is not exactly pluggable to it. So I elaborated a little. It is out of the scope of this Q & A.


              • I heard there are adapters, but I am not a fan of those, so I used my server as a middleman over the local network.


              • I do not like complications. Cloning systems, be it Linux or Windows is rather easy to me. But in a case like this (SATA to M.2) was a bit of a pain.


              • That was because on one drive was Linux and on the second there was Windows. And I wanted to keep everything in place, no re-installation, no rsync, or whatever one might use to copy. I do clone exact duplicates instead.


              • All you need is your brain and gdisk which I usually use to fix PMBR and such things, which are unavoidable with my methods but extremely quick to resolve.


              • This case was different, though, I did prepare a lot. Like doing (1:1) backups and such. It was my personal computer and I wanted just to switch over the system drives: M.2 + Windows & SATA + Linux. I wanted to make it the other way around.


              • This question arose once I needed to make sure the new Linux drive is doing fine as it is my primary operating system...






              share|improve this answer
























                up vote
                2
                down vote



                accepted







                up vote
                2
                down vote



                accepted






                Disk UUIDs



                I believe this was the main culprit and was in need of a change.



                It was as simple as booting up the system on the SATA drive and running:



                # gdisk /dev/nvme0n1


                x for experts menu



                g for new disk GUID



                R for randomize



                w to write changes to disk



                y to confirm



                The disk UUID had been changed... No need to change both of them, of course.



                # fdisk -l | grep -i identifier

                Disk identifier: 989573D5-37E7-437A-B680-9410F7234A94
                Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4



                Partitions UUIDs



                Again, to change those I used:



                # gdisk /dev/nvme0n1


                x for experts menu



                c for new partition UUID



                1 for the first partition; repeat these steps for the second partition



                R for randomize



                w to write changes to disk



                y to confirm




                GRUB update



                This was as simple as running:



                # update-grub



                Initrd regeneration



                # update-initramfs -u -k all



                UEFI BIOS settings



                The boot options had to be removed and updated.



                The NVMe drive boots just fine now.




                Notes



                • I do not use chroot for cloning. I use plain cat or more convenient pv for disk cloning purposes. I read something about it now. I never needed it, ever. And I cloned like a hundred of drives already.


                • Whenever I want to do an exact copy I do that on my SATA server, but this new M.2 PCIe is not exactly pluggable to it. So I elaborated a little. It is out of the scope of this Q & A.


                • I heard there are adapters, but I am not a fan of those, so I used my server as a middleman over the local network.


                • I do not like complications. Cloning systems, be it Linux or Windows is rather easy to me. But in a case like this (SATA to M.2) was a bit of a pain.


                • That was because on one drive was Linux and on the second there was Windows. And I wanted to keep everything in place, no re-installation, no rsync, or whatever one might use to copy. I do clone exact duplicates instead.


                • All you need is your brain and gdisk which I usually use to fix PMBR and such things, which are unavoidable with my methods but extremely quick to resolve.


                • This case was different, though, I did prepare a lot. Like doing (1:1) backups and such. It was my personal computer and I wanted just to switch over the system drives: M.2 + Windows & SATA + Linux. I wanted to make it the other way around.


                • This question arose once I needed to make sure the new Linux drive is doing fine as it is my primary operating system...






                share|improve this answer














                Disk UUIDs



                I believe this was the main culprit and was in need of a change.



                It was as simple as booting up the system on the SATA drive and running:



                # gdisk /dev/nvme0n1


                x for experts menu



                g for new disk GUID



                R for randomize



                w to write changes to disk



                y to confirm



                The disk UUID had been changed... No need to change both of them, of course.



                # fdisk -l | grep -i identifier

                Disk identifier: 989573D5-37E7-437A-B680-9410F7234A94
                Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4



                Partitions UUIDs



                Again, to change those I used:



                # gdisk /dev/nvme0n1


                x for experts menu



                c for new partition UUID



                1 for the first partition; repeat these steps for the second partition



                R for randomize



                w to write changes to disk



                y to confirm




                GRUB update



                This was as simple as running:



                # update-grub



                Initrd regeneration



                # update-initramfs -u -k all



                UEFI BIOS settings



                The boot options had to be removed and updated.



                The NVMe drive boots just fine now.




                Notes



                • I do not use chroot for cloning. I use plain cat or more convenient pv for disk cloning purposes. I read something about it now. I never needed it, ever. And I cloned like a hundred of drives already.


                • Whenever I want to do an exact copy I do that on my SATA server, but this new M.2 PCIe is not exactly pluggable to it. So I elaborated a little. It is out of the scope of this Q & A.


                • I heard there are adapters, but I am not a fan of those, so I used my server as a middleman over the local network.


                • I do not like complications. Cloning systems, be it Linux or Windows is rather easy to me. But in a case like this (SATA to M.2) was a bit of a pain.


                • That was because on one drive was Linux and on the second there was Windows. And I wanted to keep everything in place, no re-installation, no rsync, or whatever one might use to copy. I do clone exact duplicates instead.


                • All you need is your brain and gdisk which I usually use to fix PMBR and such things, which are unavoidable with my methods but extremely quick to resolve.


                • This case was different, though, I did prepare a lot. Like doing (1:1) backups and such. It was my personal computer and I wanted just to switch over the system drives: M.2 + Windows & SATA + Linux. I wanted to make it the other way around.


                • This question arose once I needed to make sure the new Linux drive is doing fine as it is my primary operating system...







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Dec 7 at 14:45

























                answered Dec 7 at 10:35









                Vlastimil

                7,6591258132




                7,6591258132






















                    up vote
                    0
                    down vote













                    Based on the provided information it is hard to say what exactly is going on, your assumption with a UUID issue is most likely true.



                    Here is how I would proceede to get your challenge done:



                    • Clear the NVME using dd and /dev/zero. It should be sufficient to use bs=512 count=4

                    • Create new partitions and file systems on the NVME.

                    • Boot into a live system.

                    • Copy the data from the SSD partitions to the NVME partitions.

                    • Install Grub on the NVME, update /etc/fstab, update grub.cfg.

                    For the last point I recommend the following method:



                    • While still beeing on the live system, create a new "root" directory, mount the NVME's root file system there.


                    • mount --bind /dev, /proc, /sys into the new "root". E.g. mount --bind /dev /mnt/nvmeroot/dev

                    • chroot into the new "root" using: chroot /mnt/nvmeroot/ /bin/bash

                    • Use blkid to find out new partition UUIDs, update /etc/fstab accordingly.

                    • Install grub onto the nvme e.g. using grub-install

                    • Update grubs config file with update-grub or grub2-mkconfig

                    • Exit the chroot.

                    • Unmount bind mounts, and the new "root".

                    • Reboot from the NVME.

                    In case something does not work:



                    • Use the the e (edit) button in grub, and remove linux boot arguments as quiet, splash, rhgb options so you can see error messages during boot.

                    • Reboot using the live system, mount the new "root", do the bind mounts, chroot and fix the issue, try again.





                    share|improve this answer




















                    • Why don't you try starting at: "In case something does not work"?
                      – hargut
                      Dec 7 at 7:32











                    • A UUID is a Unique Identifier ID, it is simply NOT supposed to be duplicated. As soon as duplicated it would loose its main purpose of beeing UNIQUE.
                      – hargut
                      Dec 7 at 7:36











                    • If you do not understand the last sentence, try reading the whole post.
                      – hargut
                      Dec 7 at 7:38






                    • 2




                      You do not need to wipe out disks to deal with UUID issues.
                      – Rui F Ribeiro
                      Dec 7 at 8:17






                    • 1




                      I am not sure if you are more interested on arguing or improving your answer. You missed the initrd (re)generation btw.
                      – Rui F Ribeiro
                      Dec 7 at 8:46














                    up vote
                    0
                    down vote













                    Based on the provided information it is hard to say what exactly is going on, your assumption with a UUID issue is most likely true.



                    Here is how I would proceede to get your challenge done:



                    • Clear the NVME using dd and /dev/zero. It should be sufficient to use bs=512 count=4

                    • Create new partitions and file systems on the NVME.

                    • Boot into a live system.

                    • Copy the data from the SSD partitions to the NVME partitions.

                    • Install Grub on the NVME, update /etc/fstab, update grub.cfg.

                    For the last point I recommend the following method:



                    • While still beeing on the live system, create a new "root" directory, mount the NVME's root file system there.


                    • mount --bind /dev, /proc, /sys into the new "root". E.g. mount --bind /dev /mnt/nvmeroot/dev

                    • chroot into the new "root" using: chroot /mnt/nvmeroot/ /bin/bash

                    • Use blkid to find out new partition UUIDs, update /etc/fstab accordingly.

                    • Install grub onto the nvme e.g. using grub-install

                    • Update grubs config file with update-grub or grub2-mkconfig

                    • Exit the chroot.

                    • Unmount bind mounts, and the new "root".

                    • Reboot from the NVME.

                    In case something does not work:



                    • Use the the e (edit) button in grub, and remove linux boot arguments as quiet, splash, rhgb options so you can see error messages during boot.

                    • Reboot using the live system, mount the new "root", do the bind mounts, chroot and fix the issue, try again.





                    share|improve this answer




















                    • Why don't you try starting at: "In case something does not work"?
                      – hargut
                      Dec 7 at 7:32











                    • A UUID is a Unique Identifier ID, it is simply NOT supposed to be duplicated. As soon as duplicated it would loose its main purpose of beeing UNIQUE.
                      – hargut
                      Dec 7 at 7:36











                    • If you do not understand the last sentence, try reading the whole post.
                      – hargut
                      Dec 7 at 7:38






                    • 2




                      You do not need to wipe out disks to deal with UUID issues.
                      – Rui F Ribeiro
                      Dec 7 at 8:17






                    • 1




                      I am not sure if you are more interested on arguing or improving your answer. You missed the initrd (re)generation btw.
                      – Rui F Ribeiro
                      Dec 7 at 8:46












                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    Based on the provided information it is hard to say what exactly is going on, your assumption with a UUID issue is most likely true.



                    Here is how I would proceede to get your challenge done:



                    • Clear the NVME using dd and /dev/zero. It should be sufficient to use bs=512 count=4

                    • Create new partitions and file systems on the NVME.

                    • Boot into a live system.

                    • Copy the data from the SSD partitions to the NVME partitions.

                    • Install Grub on the NVME, update /etc/fstab, update grub.cfg.

                    For the last point I recommend the following method:



                    • While still beeing on the live system, create a new "root" directory, mount the NVME's root file system there.


                    • mount --bind /dev, /proc, /sys into the new "root". E.g. mount --bind /dev /mnt/nvmeroot/dev

                    • chroot into the new "root" using: chroot /mnt/nvmeroot/ /bin/bash

                    • Use blkid to find out new partition UUIDs, update /etc/fstab accordingly.

                    • Install grub onto the nvme e.g. using grub-install

                    • Update grubs config file with update-grub or grub2-mkconfig

                    • Exit the chroot.

                    • Unmount bind mounts, and the new "root".

                    • Reboot from the NVME.

                    In case something does not work:



                    • Use the the e (edit) button in grub, and remove linux boot arguments as quiet, splash, rhgb options so you can see error messages during boot.

                    • Reboot using the live system, mount the new "root", do the bind mounts, chroot and fix the issue, try again.





                    share|improve this answer












                    Based on the provided information it is hard to say what exactly is going on, your assumption with a UUID issue is most likely true.



                    Here is how I would proceede to get your challenge done:



                    • Clear the NVME using dd and /dev/zero. It should be sufficient to use bs=512 count=4

                    • Create new partitions and file systems on the NVME.

                    • Boot into a live system.

                    • Copy the data from the SSD partitions to the NVME partitions.

                    • Install Grub on the NVME, update /etc/fstab, update grub.cfg.

                    For the last point I recommend the following method:



                    • While still beeing on the live system, create a new "root" directory, mount the NVME's root file system there.


                    • mount --bind /dev, /proc, /sys into the new "root". E.g. mount --bind /dev /mnt/nvmeroot/dev

                    • chroot into the new "root" using: chroot /mnt/nvmeroot/ /bin/bash

                    • Use blkid to find out new partition UUIDs, update /etc/fstab accordingly.

                    • Install grub onto the nvme e.g. using grub-install

                    • Update grubs config file with update-grub or grub2-mkconfig

                    • Exit the chroot.

                    • Unmount bind mounts, and the new "root".

                    • Reboot from the NVME.

                    In case something does not work:



                    • Use the the e (edit) button in grub, and remove linux boot arguments as quiet, splash, rhgb options so you can see error messages during boot.

                    • Reboot using the live system, mount the new "root", do the bind mounts, chroot and fix the issue, try again.






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 7 at 6:56









                    hargut

                    2636




                    2636











                    • Why don't you try starting at: "In case something does not work"?
                      – hargut
                      Dec 7 at 7:32











                    • A UUID is a Unique Identifier ID, it is simply NOT supposed to be duplicated. As soon as duplicated it would loose its main purpose of beeing UNIQUE.
                      – hargut
                      Dec 7 at 7:36











                    • If you do not understand the last sentence, try reading the whole post.
                      – hargut
                      Dec 7 at 7:38






                    • 2




                      You do not need to wipe out disks to deal with UUID issues.
                      – Rui F Ribeiro
                      Dec 7 at 8:17






                    • 1




                      I am not sure if you are more interested on arguing or improving your answer. You missed the initrd (re)generation btw.
                      – Rui F Ribeiro
                      Dec 7 at 8:46
















                    • Why don't you try starting at: "In case something does not work"?
                      – hargut
                      Dec 7 at 7:32











                    • A UUID is a Unique Identifier ID, it is simply NOT supposed to be duplicated. As soon as duplicated it would loose its main purpose of beeing UNIQUE.
                      – hargut
                      Dec 7 at 7:36











                    • If you do not understand the last sentence, try reading the whole post.
                      – hargut
                      Dec 7 at 7:38






                    • 2




                      You do not need to wipe out disks to deal with UUID issues.
                      – Rui F Ribeiro
                      Dec 7 at 8:17






                    • 1




                      I am not sure if you are more interested on arguing or improving your answer. You missed the initrd (re)generation btw.
                      – Rui F Ribeiro
                      Dec 7 at 8:46















                    Why don't you try starting at: "In case something does not work"?
                    – hargut
                    Dec 7 at 7:32





                    Why don't you try starting at: "In case something does not work"?
                    – hargut
                    Dec 7 at 7:32













                    A UUID is a Unique Identifier ID, it is simply NOT supposed to be duplicated. As soon as duplicated it would loose its main purpose of beeing UNIQUE.
                    – hargut
                    Dec 7 at 7:36





                    A UUID is a Unique Identifier ID, it is simply NOT supposed to be duplicated. As soon as duplicated it would loose its main purpose of beeing UNIQUE.
                    – hargut
                    Dec 7 at 7:36













                    If you do not understand the last sentence, try reading the whole post.
                    – hargut
                    Dec 7 at 7:38




                    If you do not understand the last sentence, try reading the whole post.
                    – hargut
                    Dec 7 at 7:38




                    2




                    2




                    You do not need to wipe out disks to deal with UUID issues.
                    – Rui F Ribeiro
                    Dec 7 at 8:17




                    You do not need to wipe out disks to deal with UUID issues.
                    – Rui F Ribeiro
                    Dec 7 at 8:17




                    1




                    1




                    I am not sure if you are more interested on arguing or improving your answer. You missed the initrd (re)generation btw.
                    – Rui F Ribeiro
                    Dec 7 at 8:46




                    I am not sure if you are more interested on arguing or improving your answer. You missed the initrd (re)generation btw.
                    – Rui F Ribeiro
                    Dec 7 at 8:46










                    up vote
                    0
                    down vote














                    Drive won't boot... after cloning, why?




                    I do not have a /etc/default/grub handy but I will use a line from your bootinfo script



                    # auto-mount of windows drive
                    #/dev/disk/by-uuid/9CDAC383DAC357E2 /mnt/9CDAC383DAC357E2 auto nosuid,nodev,nofail,x-gvfs-show,ro 0 0


                    so your original drive has UUID whatever



                    you clone the contents of that disk to a new disk, or NVME thing. And the contents of grub on the new disk will still all reference uuid whatever which was the old disk, not the current new disk.



                    That new disk will not have the same UUID as the original, you have to correct everywhere it was used, basically /etc/default/grub and follow that with a grub2-mkconfig and also correct your /etc/fstab.




                    I believe the problem arises from both drives having the same disk UUID, am I right?




                    UUID = universally unique identifier. The UUID should be different.



                    There are a handful of ways to mount a disk... by-uuid or by-id or by-name or by-label or by-path of the top of my head. I do not know if all linux distributions follow this model but if you look under /dev/disk/ you will should see sub folders



                    • by-id

                    • by-label

                    • by-path

                    • by-uuid

                    if you do by-name then that is simply calling out the disk from /dev/sda1 or /dev/sd?? which is not unique and i recommend against doing... if there is only ever one disk present then it would be /dev/sda and work but it would not be unique and would not be explicit so over time you take your chances. And things may be further complicated with an NVME showing up differently as /dev/nvme????



                    from your fdisk:



                    Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
                    Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

                    Device Start End Sectors Size Type
                    /dev/nvme0n1p1 2048 194559 192512 94M EFI System
                    /dev/nvme0n1p2 194560 488396799 488202240 232,8G Linux filesystem


                    • look under /dev/disk/? and find that corresponding identifier.

                    • correct your boot files to use this new nvme disk explicitly to boot it.

                    • correct the /etc/fstab on that disk to use that identifier, it will have the text referencing the old disk because you cloned.





                    share|improve this answer




















                    • I used GParted to change the partition UUIDs on the new drive and edited fstab accordingly. you change uuid with gparted after system is running, but you are NOT changing the UUID of the disk on the disk, it will revert back to it's unique id on next boot or power cycle
                      – ron
                      Dec 7 at 15:46











                    • fstab is part 2 of the fix, part 1 is modifying grub correctly to reference the new disk or in you case nvme
                      – ron
                      Dec 7 at 15:49










                    • changing a disk UUID is a horrible way to solve this problem
                      – ron
                      Dec 7 at 15:52














                    up vote
                    0
                    down vote














                    Drive won't boot... after cloning, why?




                    I do not have a /etc/default/grub handy but I will use a line from your bootinfo script



                    # auto-mount of windows drive
                    #/dev/disk/by-uuid/9CDAC383DAC357E2 /mnt/9CDAC383DAC357E2 auto nosuid,nodev,nofail,x-gvfs-show,ro 0 0


                    so your original drive has UUID whatever



                    you clone the contents of that disk to a new disk, or NVME thing. And the contents of grub on the new disk will still all reference uuid whatever which was the old disk, not the current new disk.



                    That new disk will not have the same UUID as the original, you have to correct everywhere it was used, basically /etc/default/grub and follow that with a grub2-mkconfig and also correct your /etc/fstab.




                    I believe the problem arises from both drives having the same disk UUID, am I right?




                    UUID = universally unique identifier. The UUID should be different.



                    There are a handful of ways to mount a disk... by-uuid or by-id or by-name or by-label or by-path of the top of my head. I do not know if all linux distributions follow this model but if you look under /dev/disk/ you will should see sub folders



                    • by-id

                    • by-label

                    • by-path

                    • by-uuid

                    if you do by-name then that is simply calling out the disk from /dev/sda1 or /dev/sd?? which is not unique and i recommend against doing... if there is only ever one disk present then it would be /dev/sda and work but it would not be unique and would not be explicit so over time you take your chances. And things may be further complicated with an NVME showing up differently as /dev/nvme????



                    from your fdisk:



                    Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
                    Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

                    Device Start End Sectors Size Type
                    /dev/nvme0n1p1 2048 194559 192512 94M EFI System
                    /dev/nvme0n1p2 194560 488396799 488202240 232,8G Linux filesystem


                    • look under /dev/disk/? and find that corresponding identifier.

                    • correct your boot files to use this new nvme disk explicitly to boot it.

                    • correct the /etc/fstab on that disk to use that identifier, it will have the text referencing the old disk because you cloned.





                    share|improve this answer




















                    • I used GParted to change the partition UUIDs on the new drive and edited fstab accordingly. you change uuid with gparted after system is running, but you are NOT changing the UUID of the disk on the disk, it will revert back to it's unique id on next boot or power cycle
                      – ron
                      Dec 7 at 15:46











                    • fstab is part 2 of the fix, part 1 is modifying grub correctly to reference the new disk or in you case nvme
                      – ron
                      Dec 7 at 15:49










                    • changing a disk UUID is a horrible way to solve this problem
                      – ron
                      Dec 7 at 15:52












                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote










                    Drive won't boot... after cloning, why?




                    I do not have a /etc/default/grub handy but I will use a line from your bootinfo script



                    # auto-mount of windows drive
                    #/dev/disk/by-uuid/9CDAC383DAC357E2 /mnt/9CDAC383DAC357E2 auto nosuid,nodev,nofail,x-gvfs-show,ro 0 0


                    so your original drive has UUID whatever



                    you clone the contents of that disk to a new disk, or NVME thing. And the contents of grub on the new disk will still all reference uuid whatever which was the old disk, not the current new disk.



                    That new disk will not have the same UUID as the original, you have to correct everywhere it was used, basically /etc/default/grub and follow that with a grub2-mkconfig and also correct your /etc/fstab.




                    I believe the problem arises from both drives having the same disk UUID, am I right?




                    UUID = universally unique identifier. The UUID should be different.



                    There are a handful of ways to mount a disk... by-uuid or by-id or by-name or by-label or by-path of the top of my head. I do not know if all linux distributions follow this model but if you look under /dev/disk/ you will should see sub folders



                    • by-id

                    • by-label

                    • by-path

                    • by-uuid

                    if you do by-name then that is simply calling out the disk from /dev/sda1 or /dev/sd?? which is not unique and i recommend against doing... if there is only ever one disk present then it would be /dev/sda and work but it would not be unique and would not be explicit so over time you take your chances. And things may be further complicated with an NVME showing up differently as /dev/nvme????



                    from your fdisk:



                    Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
                    Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

                    Device Start End Sectors Size Type
                    /dev/nvme0n1p1 2048 194559 192512 94M EFI System
                    /dev/nvme0n1p2 194560 488396799 488202240 232,8G Linux filesystem


                    • look under /dev/disk/? and find that corresponding identifier.

                    • correct your boot files to use this new nvme disk explicitly to boot it.

                    • correct the /etc/fstab on that disk to use that identifier, it will have the text referencing the old disk because you cloned.





                    share|improve this answer













                    Drive won't boot... after cloning, why?




                    I do not have a /etc/default/grub handy but I will use a line from your bootinfo script



                    # auto-mount of windows drive
                    #/dev/disk/by-uuid/9CDAC383DAC357E2 /mnt/9CDAC383DAC357E2 auto nosuid,nodev,nofail,x-gvfs-show,ro 0 0


                    so your original drive has UUID whatever



                    you clone the contents of that disk to a new disk, or NVME thing. And the contents of grub on the new disk will still all reference uuid whatever which was the old disk, not the current new disk.



                    That new disk will not have the same UUID as the original, you have to correct everywhere it was used, basically /etc/default/grub and follow that with a grub2-mkconfig and also correct your /etc/fstab.




                    I believe the problem arises from both drives having the same disk UUID, am I right?




                    UUID = universally unique identifier. The UUID should be different.



                    There are a handful of ways to mount a disk... by-uuid or by-id or by-name or by-label or by-path of the top of my head. I do not know if all linux distributions follow this model but if you look under /dev/disk/ you will should see sub folders



                    • by-id

                    • by-label

                    • by-path

                    • by-uuid

                    if you do by-name then that is simply calling out the disk from /dev/sda1 or /dev/sd?? which is not unique and i recommend against doing... if there is only ever one disk present then it would be /dev/sda and work but it would not be unique and would not be explicit so over time you take your chances. And things may be further complicated with an NVME showing up differently as /dev/nvme????



                    from your fdisk:



                    Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
                    Disk identifier: 1207A335-32CA-4B6C-A508-29A0E85597C4

                    Device Start End Sectors Size Type
                    /dev/nvme0n1p1 2048 194559 192512 94M EFI System
                    /dev/nvme0n1p2 194560 488396799 488202240 232,8G Linux filesystem


                    • look under /dev/disk/? and find that corresponding identifier.

                    • correct your boot files to use this new nvme disk explicitly to boot it.

                    • correct the /etc/fstab on that disk to use that identifier, it will have the text referencing the old disk because you cloned.






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 7 at 15:34









                    ron

                    8861714




                    8861714











                    • I used GParted to change the partition UUIDs on the new drive and edited fstab accordingly. you change uuid with gparted after system is running, but you are NOT changing the UUID of the disk on the disk, it will revert back to it's unique id on next boot or power cycle
                      – ron
                      Dec 7 at 15:46











                    • fstab is part 2 of the fix, part 1 is modifying grub correctly to reference the new disk or in you case nvme
                      – ron
                      Dec 7 at 15:49










                    • changing a disk UUID is a horrible way to solve this problem
                      – ron
                      Dec 7 at 15:52
















                    • I used GParted to change the partition UUIDs on the new drive and edited fstab accordingly. you change uuid with gparted after system is running, but you are NOT changing the UUID of the disk on the disk, it will revert back to it's unique id on next boot or power cycle
                      – ron
                      Dec 7 at 15:46











                    • fstab is part 2 of the fix, part 1 is modifying grub correctly to reference the new disk or in you case nvme
                      – ron
                      Dec 7 at 15:49










                    • changing a disk UUID is a horrible way to solve this problem
                      – ron
                      Dec 7 at 15:52















                    I used GParted to change the partition UUIDs on the new drive and edited fstab accordingly. you change uuid with gparted after system is running, but you are NOT changing the UUID of the disk on the disk, it will revert back to it's unique id on next boot or power cycle
                    – ron
                    Dec 7 at 15:46





                    I used GParted to change the partition UUIDs on the new drive and edited fstab accordingly. you change uuid with gparted after system is running, but you are NOT changing the UUID of the disk on the disk, it will revert back to it's unique id on next boot or power cycle
                    – ron
                    Dec 7 at 15:46













                    fstab is part 2 of the fix, part 1 is modifying grub correctly to reference the new disk or in you case nvme
                    – ron
                    Dec 7 at 15:49




                    fstab is part 2 of the fix, part 1 is modifying grub correctly to reference the new disk or in you case nvme
                    – ron
                    Dec 7 at 15:49












                    changing a disk UUID is a horrible way to solve this problem
                    – ron
                    Dec 7 at 15:52




                    changing a disk UUID is a horrible way to solve this problem
                    – ron
                    Dec 7 at 15:52

















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f486499%2fdrive-wont-boot-from-its-grub-but-will-from-another-drives-grub-after-clonin%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?