3

I'm trying to migrate to my new NVMe Samsung 950 pro.

chroot /mnt/boot-sav/nvme0n1p3 update-grub
grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.

Process:

  • Copied/pasted via Gparted (lastest gparted live-cd)
  • Ran boot-repair (with 15.10 ubuntu desktop)
  • failed on update-grub

http://paste.ubuntu.com/13244403/

Old drive had:

  • sda1 fat32 EFI
  • sda2 ntfs
  • unallocated (had to shrink a small amount for new drive)
  • sda3 ext4
  • sda4 linux-swap

My first guess is that I'm no longer using an sd, but an nvm prefixed device.

Any thoughts/help is appreciated.

sudo fdisk -l

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048    206847    204800   100M Microsoft basic data
/dev/nvme0n1p2    206848 487878655 487671808 232.6G Microsoft basic data
/dev/nvme0n1p3 487878656 864057343 376178688 179.4G Linux filesystem
/dev/nvme0n1p4 864057344 897484799  33427456    16G Linux swap

Device     Boot   Start     End Sectors  Size Id Type
/dev/sda1  *          0 2301535 2301536  1.1G  0 Empty
/dev/sda2       2279532 2284075    4544  2.2M  c W95 FAT32 (LBA)

Update 11/14/15

This is the latest attempt:

sudo mount /dev/nvme0n1p3 /mnt
sudo mount /dev/nvme0n1p1 /mnt/boot/efi

for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done

sudo cp --remove-destination /etc/resolv.conf /mnt/etc/resolv.conf

sudo chroot /mnt
grub-install --efi-directory=/boot/efi --target=x86_64-efi --uefi-secure-boot 

Results:

Installation finished. No error reported.

$ update-grub
grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.

When I look in /boot/grub I do NOT have a device.map. I read that I don't need one for grub2, but I generated one, ran update-grub and ran into the same message as above.

I attempt to reboot anyway, and my EFI only shows a Windows Boot Manager as a bootable item, for which it lands on a windows recovery screen. The Ubuntu partition isn't listed as a bootable drive in EFI.

kross
  • 747

3 Answers3

0
sudo fdisk -l

then, see what partition you have the ubuntu installed(ext4 filetype) then:

sudo mount -t ext4 /dev/sda6 /mnt 

(admitting that sda6 is my ubuntu partition)

and then

sudo grub-install --root-directory=/mnt /dev/sda

this will reinstall grub and see all the others OS' that you have and organize all of them.

KGIII
  • 4,101
saidc3
  • 1
0

This should definitely work.

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048    206847    204800   100M Microsoft basic data
/dev/nvme0n1p2    206848 487878655 487671808 232.6G Microsoft basic data
/dev/nvme0n1p3 487878656 864057343 376178688 179.4G Linux filesystem
/dev/nvme0n1p4 864057344 897484799  33427456    16G Linux swap

Here I can't see EFI partition nor separate boot partition.

Copying EFI directory to root won't work. You need separate partition of type fat32, around 100MB to hold the EFI directory.

So here my advice is to shrink /dev/nvme0n1p2 from right to create space for the efi partition.

Then boot into a Ubuntu Live Media.

Mount root parition

sudo mount /dev/nvme0n1pX /mnt/

Mount efi partition

sudo mount /dev/nvme0n1pX /mnt/boot/efi

; replace X with the actual device id

Chroot and reinstall Grub

sudo chroot /mnt
grub-install
Gayan Weerakutti
  • 3,830
  • 1
  • 28
  • 39
0

Thanks for all the help everyone. I ended up on this path because Clonezilla wouldn't recognize the nvme properly. I've tried diligently to get all this to work but none of the attempted would work. In the end, I resorted to using dd to get my clone, and it ended up working dd if=/dev/sdX of=/dev/sdY bs=512 count=1 conv=noerror,sync. I really didn't want to take this path but it ended up working.

kross
  • 747