How do I remove "Ubuntu" in the bios boot menu? (UEFI)
Solution 1
You should be able to do this via a Live Ubuntu CD.
Install efibootmgr:
sudo apt-get install efibootmgr
Then add to the kernel EFI support
sudo modprobe efivars
Then run sudo efibootmgr
to check your boot entries. It will return something like this:
BootCurrent: 0004
Timeout: 2 seconds
BootOrder: 2001,0003,0005,0006,0000
Boot0000* Lenovo Recovery System
Boot0001* EFI Network 0 for IPv6 (B8-88-E3-84-F3-EF)
Boot0002* EFI Network 0 for IPv4 (B8-88-E3-84-F3-EF)
Boot0003* Windows Boot Manager
Boot0004* EFI USB Device (SanDisk)
Boot0005* ubuntu
Boot2001* EFI USB Device
Then delete the option you don't want. In this example, Ubuntu is entry 5. the following could be called to delete entry 5 and remove it from the BootOrder.
(CAUTION: Before executing the following command make sure you enter the correct Boot entry number)
sudo efibootmgr -b 5 -B
Further details described here: http://linux.die.net/man/8/efibootmgr
Note: as for anything that changes your bootloader, please ensure you have a good disk image that you can boot with.
Now you should also delete the ubuntu
subdirectory in the EFI partition to prevent the UEFI firmware from restoring the entry into the BootOrder.
To do that, first find your EFI partition. Run sudo fdisk -l
to see the partitions on all attached drives. The EFI partition has EFI Partition
under the Type column.
Suppose your EFI partition was /dev/sda2
, then mount it on an empty folder anywhere.
sudo mkdir /mnt/efipart
sudo mount /dev/sda2 /mnt/efipart
Now we have to find the directory Ubuntu
or any other distro's name in this partition. It is mostly under EFI/distro_name
.
Remove that directory and its contents by (PLEASE MAKE SURE YOU ARE DELETING THE CORRECT DIRECTORY) sudo rm -r ubuntu
.
Solution 2
This answer borrowed verbatim from here)
- Run a
cmd.exe
procescs with administrator privileges - Run
diskpart
- Type:
list disk
thensel disk X
where X is the drive your boot files reside on - Type
list vol
to see all partitions (volumes) on the disk (the EFI volume will be formatted in FAT, others will be NTFS) - Select the EFI volume by typing:
sel vol Y
where Y is theSYSTEM
volume (this is almost always the EFI partition) - For convenience, assign a drive letter by typing:
assign letter=Z:
where Z is a free (unused) drive letter - Type
exit
to leave disk part - While still in the
cmd
prompt, type:Z:
and hit enter, where Z was the drive letter you just created. - Type
dir
to list directories on this mounted EFI partition - If you are in the right place, you should see a directory called
EFI
- Type
cd EFI
and thendir
to list the child directories insideEFI
- Type
rmdir /S ubuntu
to delete the ubuntu boot directory
Related videos on Youtube
Dave
Updated on September 18, 2022Comments
-
Dave over 1 year
Im super new to programming and trying to get to grips with rails, I'm having trouble getting my head around how to route links to certain pages in my app.
I have a table of users reviews and venues, where a user has many reviews and a venue has many reviews.
The reviews are displayed as partials on the appropriate venues show page and each partial contains info on the user who wrote it.
review partial
<div class="review"> <% link_to @user do %> <div class="reviewer_details"> <div class="reviewer_details_photo"> <%= image_tag review.user.avatar.url(:thumb) %> </div> <%= review.user.username %> </div> <% end %> <div class="review_content"> <div class="review_partial_star_rating" style="width: <%= review.rating*20 %>px;"></div> <h2 class="review_partial_title"><%= review.title %></h2> </div> <% if can? :update, review %> <div class="review_partial_option"> <%= link_to 'edit', edit_review_path(review) %> </div> <% end %> <div class="clearall"></div> </div>
The line <% link_to @user do %> is redirecting to the current page (the venues show page), I want it to redirect to the users show page.
What am I missing here? and where can I read up on this to get it right? I'm confused as when to use @user, :user, user or User.
Thanks for any help its much appreciated!
-
apneadiving almost 13 yearswhat about
user_path(@user)
? -
Dave almost 13 years@apneadiving, thanks for having a look, that tries to direct to a user with the ID of the venue and gives a "Couldn't find User with ID=30" error.
-
apneadiving almost 13 yearsthat's really weird :) what does it display when you do
<%= @user.class %>
? -
Dave almost 13 years@apneadiving, it displays NilClass
-
ExplodingKittens over 8 years@RonnieDroid EasyBCD is a tool for modifying the boot configuration data in Windows (aka, the Windows bootloader). BCD and UEFI are separate because BCD relies on Windows, while UEFI is OS-independent (still present without an OS installed). Modifying the BCD would be useless because, by default, the only option would be Windows, even if another OS is installed.
-
-
Dave almost 13 yearsthanks for the great answer! I'll check it out, using users_path(@user) is directing to the users index page though
-
Matthew Lehner almost 13 yearstype
rake routes
in your Rails project directory and just append _path to the entry corresponding to users_controller#show. Also, have a look here: edgeguides.rubyonrails.org/… -
apneadiving almost 13 yearsof course,
users_path
lead to index,user_path(id)
to show -
Dave almost 13 years@apneadiving, got it, <% link_to user_path(review.user) do %> works
-
apneadiving almost 13 years@Dave: ok, great :) weird your
@user
variable was empty! -
oldfred about 9 yearsUEFI may reinstall entry if /EFI/ubuntu folder not deleted from the efi(ESP) partition on drive. Always best to fully backup efi partition before deleting any files or folders.
-
Major Productions about 7 yearsIn 16.04 I get a 'permission denied' message when trying to access my mounted efi partition, even with sudo. Any suggestions?
-
Oragon Efreet about 7 yearsI think the . at the end or your last sentence is quite dangerous x)
-
Silversonic almost 7 yearsSome answers told me to use
boot-repair
...got no result. Other said runbootrec.exe /fixmbr
...no results. Others said delete just the ubuntu folder....it kept coming back... other said just remove the boot entry withefibootmgr
...that came back too. Nothing worked. But then...suddenly I read your post and I realise have to remove the folder AND the boot entry together? Suddenly it worked! This here is the answer you've been searching for. -
Peter Gloor almost 6 yearsUsing Rufus on Windows 10 I just prepared a USB stick with Ubuntu 18.04 Desktop on it and followed your instructions. It worked like a charm.
-
swingcake over 5 yearsWhat happens to the folder you created at /mnt/efipart?
-
Rick over 4 yearsIs there any way to see on which disk an entry is located when running
sudo efibootmgr
? -
mook765 over 3 yearsUsing
sudo rm -r ubuntu
will only work if youcd
to the correct directory first. Better to use absolute path in the command:sudo rm -r /mnt/efipart/EFI/ubuntu