[Solved]Deleted Windows, Linux boot option gone

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Linux_User157

[Solved]Deleted Windows, Linux boot option gone

Post by Linux_User157 »

I wiped the hard drive Windows was on. The Linux boot option is now gone. How do I fix this?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
WharfRat

Re: Deleted Windows, Linux boot option gone

Post by WharfRat »

Linux_User157 wrote:I wiped the hard drive Windows was on. The Linux boot option is now gone. How do I fix this?
Can you boot the live media and paste back sudo blkid

Also was there a reason for deleting windows :?:
Linux_User157

Re: Deleted Windows, Linux boot option gone

Post by Linux_User157 »

Well really I was just reinstalling.
/dev/sda1: UUID="2E8A113C202BF891" TYPE="ntfs" PARTUUID="ede8775b-3e8b-41c1-95c5-eaad01363c0e"
/dev/sdb1: UUID="F1EB-C6B5" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="8edbf8fb-035e-4208-b754-2c28e693f8a3"
/dev/sdb2: UUID="ad047bf5-3eaa-443f-8fcc-b041d65a2996" TYPE="ext2" PARTUUID="7b626308-41bd-4306-8ebf-ee088ecb1a10"
/dev/sdc1: LABEL="LINUX MINT" UUID="7822-87C9" TYPE="vfat" PARTUUID="00bcd87b-01"
/dev/loop0: TYPE="squashfs"
/dev/sdb3: UUID="929618b9-6932-4b46-958d-dd84d0a4cd4f" TYPE="crypto_LUKS" PARTUUID="da9af6bc-c451-449a-a213-03b732252c73"
WharfRat

Re: Deleted Windows, Linux boot option gone

Post by WharfRat »

Can you now paste back sudo fdisk -l

Do you intend to reinstall windows :?:

If so do that first.
Linux_User157

Re: Deleted Windows, Linux boot option gone

Post by Linux_User157 »

I already reinstalled Windows. It did something to the boot-loader, correct? Not the re-installation, it did this before that.

Code: Select all

Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/loop0: 1.7 GiB, 1757536256 bytes, 3432688 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


Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 8709048E-8941-44B6-A6CA-63183848C8B7

Device     Start       End   Sectors   Size Type
/dev/sda1   2048 250068991 250066944 119.2G Microsoft basic data


Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: D8C25CFC-BC65-4F87-AC7B-FB3A250CBF37

Device       Start        End    Sectors  Size Type
/dev/sdb1     2048    1050623    1048576  512M EFI System
/dev/sdb2  1050624    2050047     999424  488M Linux filesystem
/dev/sdb3  2050048 3907028991 3904978944  1.8T Linux filesystem


Disk /dev/sdc: 7.5 GiB, 8015314944 bytes, 15654912 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: dos
Disk identifier: 0x00bcd87b

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdc1  *     2048 15654911 15652864  7.5G  c W95 FAT32 (LBA)
Last edited by Linux_User157 on Sun Dec 03, 2017 9:00 pm, edited 1 time in total.
Reason: Added code tag
WharfRat

Re: Deleted Windows, Linux boot option gone

Post by WharfRat »

I'm not an expert with UEFI, but this is the only way I know of to repair grub. https://sites.google.com/site/easylinuxtipsproject/6

You might want to try https://sourceforge.net/p/boot-repair/home/Home/ if you're not comfortable with the above.
Linux_User157

Re: Deleted Windows, Linux boot option gone

Post by Linux_User157 »

It keeps saying /mnt/boot/efi does not exist. The part where I need to mount my efi partition.
Linux_User157

Re: Deleted Windows, Linux boot option gone

Post by Linux_User157 »

WharfRat

Re: Deleted Windows, Linux boot option gone

Post by WharfRat »

Here's where not being an expert with UEFI comes into play.

If you reinstalled windows, then it should have created the the efi partition, but apparently not :?

Try creating an EFI partition /dev/sda2 from my screenshots
Screenshot at 2017-12-03 20-24-33.png
Screenshot at 2017-12-03 20-24-47.png
Screenshot at 2017-12-03 20-29-27.png
Linux_User157

Re: Deleted Windows, Linux boot option gone

Post by Linux_User157 »

Sorry for the confusion, I do have an EFI system partition. It just won't mount.
WharfRat

Re: Deleted Windows, Linux boot option gone

Post by WharfRat »

Sorry, my goof Your EFI partition is /dev/sdb1 and your linux partition is encrypted.

Device Start End Sectors Size Type
/dev/sdb1 2048 1050623 1048576 512M EFI System

Do this setup

Code: Select all

sudo -i
/sbin/cryptsetup luksOpen /dev/sdb3 crypt
mount /dev/mapper/mint--vg-root /mnt
mount /dev/sdb2 /mnt/boot
mount /dev/sdb1 /mnt/boot/efi
mount -t proc none /mnt/proc
mount --rbind /sys /mnt/sys
mount --rbind /dev /mnt/dev
modprobe efivars
/usr/sbin/chroot /mnt /bin/bash
source /etc/profile
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
export PS1="\[\033[1;33m\]chroot to ->\[\033[1;31m\](system) #\[\e[0m\] "
Then follow from 8. Re-install Grub. Copy and paste the following command line into the terminal:
Linux_User157

Re: Deleted Windows, Linux boot option gone

Post by Linux_User157 »

Only sudo umount /mnt/boot/efi worked when unmounting. The other to returned

Code: Select all

mint ~ # for i in /sys /proc /dev/pts /dev; do sudo umount /mnt$i; done
umount: /mnt/sys: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)
umount: /mnt/dev/pts: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)
umount: /mnt/dev: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)

mint@mint ~ $ sudo umount /mnt
umount: /mnt: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)
WharfRat

Re: Deleted Windows, Linux boot option gone

Post by WharfRat »

Did you get to the point of running apt-get install --reinstall grub-efi-amd64 (step eight)

If so just try to reboot normally
Linux_User157

Re: Deleted Windows, Linux boot option gone

Post by Linux_User157 »

It isn't there.
WharfRat

Re: Deleted Windows, Linux boot option gone

Post by WharfRat »

Linux_User157 wrote:It isn't there.
What wasn't there :?
Linux_User157

Re: Deleted Windows, Linux boot option gone

Post by Linux_User157 »

The boot option.
WharfRat

Re: Deleted Windows, Linux boot option gone

Post by WharfRat »

Maybe try boot repair :?:
Linux_User157

Re: Deleted Windows, Linux boot option gone

Post by Linux_User157 »

I did. It didn't work. I'm not sure if it's because it's encrypted or what. Also, I don't know if this is worth mentioning, but in advanced options options for Grub and things like that were grayed out. So I could only change the options on the very right and left. I assume that means that it didn't read Linux. Maybe I should just try re-installing Grub again?
WharfRat

Re: Deleted Windows, Linux boot option gone

Post by WharfRat »

Linux_User157 wrote:I did. It didn't work. I'm not sure if it's because it's encrypted or what. Also, I don't know if this is worth mentioning, but in advanced options options for Grub and things like that were grayed out. So I could only change the options on the very right and left. I assume that means that it didn't read Linux. Maybe I should just try re-installing Grub again?
That could be the problem although I've never used boot repair on an encrypted system so I can't be sure.

Try this one line at a time from the live media. If you get an error paste it back here.

Code: Select all

sudo -i
/sbin/cryptsetup luksOpen /dev/sda3 crypt
mount /dev/mapper/mint--vg-root /mnt
mount /dev/sda2 /mnt/boot 
mount /dev/sda1 /mnt/boot/efi
mount -t proc none /mnt/proc
mount --rbind /sys /mnt/sys
mount --rbind /dev /mnt/dev
modprobe efivars
/usr/sbin/chroot /mnt /bin/bash
source /etc/profile
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
export PS1="\[\033[1;33m\]chroot to ->\[\033[1;31m\](system) #\[\e[0m\] "
apt-get install --reinstall grub-efi-amd64
umount -l /dev/sda1
umount -l /dev/sda2
reboot
Linux_User157

Re: Deleted Windows, Linux boot option gone

Post by Linux_User157 »

I must not have caught the errors last time. Lots of the same warning.

Code: Select all

chroot to ->(system) # apt-get install --reinstall grub-efi-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 26 not upgraded.
Need to get 0 B/65.9 kB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 232821 files and directories currently installed.)
Preparing to unpack .../grub-efi-amd64_2.02~beta2-36ubuntu3.14_amd64.deb ...
Unpacking grub-efi-amd64 (2.02~beta2-36ubuntu3.14) over (2.02~beta2-36ubuntu3.14) ...
Setting up grub-efi-amd64 (2.02~beta2-36ubuntu3.14) ...
Generating grub configuration file ...
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
Found linux image: /boot/vmlinuz-4.13.0-16-generic
Found initrd image: /boot/initrd.img-4.13.0-16-generic
Found linux image: /boot/vmlinuz-4.4.0-53-generic
Found initrd image: /boot/initrd.img-4.4.0-53-generic
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
Adding boot menu entry for EFI firmware configuration
done
Processing triggers for shim-signed (1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1) ...
Secure Boot not enabled on this system.
Locked

Return to “Installation & Boot”