SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-08-17 19:01:58

Joe_2000
New Member
Registered: 2012-07-21
Posts: 4

How to install #! Waldorf on a UEFI machine with preinstalled W7

I was struggling quite a bit to install crunchbang to my new Laptop which has EFI firmware. The crunchbang installer does not seem to support this but only installs itself in the master boot record. This did not allow me to boot crunchbang.

I did not find any easy step-by-step howto, so I though I could post how I finally managed to do it.

1) First, installed #! with standard installer.

2) The EFI partition on my computer already existed, it was shipped with W7 preinstalled.
Chances are the same will be true for your machine as well. If not, there are plenty of sites that tell you how to create it, so I'll skip that here.
In my case, it was on /dev/sda1.
You can check where it is on your machine with gparted, it should be a rather small FAT32 partition.

3) After install, boot into the live CD system of Crunchbang.
Open a terminal, and enter the installed system using chroot with the code below. (Code found on another post on this forum)
You need to know to which partition your system was installed, in my case it was /dev/sda8. Replace this as well as the location of the EFI partition /dev/sda1 in the code below as required.

# enter chroot environment

TARGET=/media/sda8                 # replace sda8 with the location of your installation
sudo mkdir -p $TARGET
sudo mount /dev/sda8 $TARGET
sudo mount --bind /dev     $TARGET/dev
sudo mount --bind /dev/pts $TARGET/dev/pts
sudo mount --bind /proc    $TARGET/proc
sudo mount --bind /sys     $TARGET/sys
sudo cp /etc/resolv.conf $TARGET/etc/resolv.conf   # needed to have network in chroot
sudo chroot $TARGET /bin/bash

apt-get update
apt-get install grub-efi-amd64
grub-install
update-grub

# now copy the grub.efi file that grub created to your efi partition 

mkdir -p /media/efi_part
mount /dev/sda1 /media/efi_part       # replace sda1 with your EFI partition name
mkdir /media/efi_part/EFI/crunchbang/
cp /boot/grub/grub.efi /media/efi_part/EFI/crunchbang/

4) Next thing you need to do is add a menu entry to your firmware. In order to do this you need to boot into the efi shell. Use a usb flash drive for that like so.

Download the efi shell from here:
https://wiki.archlinux.org/index.php/Un … load_links

Take a flash drive, format it in FAT32. Create a directory on it named EFI.
Create a directory BOOT inside. Put the downloaded file into the BOOT directory and name it shellx64.efi.
Apparently this directory structure sometimes varies, so make a copy of the shell and name it bootx64.efi.
Copy both files also to the EFI directory as well. So you should end up with a directory structure on the flash drive like this:

/EFI
    -> bootx64.efi
    -> shellx64.efi
/EFI/BOOT
    -> bootx64.efi
    -> shellx64.efi

Might be a bit of an overkill, but I was too lazy afterwards to find out which of those were unneeded. :-)

Boot from the flash drive. When you are in the EFI setup menu, make sure to select the UEFI mode version of the flash drive. This should bring you into the EFI shell.
Here, type this:

Shell> bcfg boot add 0 fs1:\EFI\crunchbang\grub.efi "Crunchbang (GRUB2)"

I think the fs1: may need to be changed according to where you have your EFI partion.
So if it was on /dev/sda2 it would become fs2. But I am not sure.

5) Now reboot and go into the EFI setup mode again. It should now show the option "Crunchbang (GRUB2)"

I hope this helps other people to get this done quicker than me :-)


Edited Title on 06 FEB 2013 to point out these instructions worked for Waldorf. In Statler the grub installer aborts with an error...

Last edited by Joe_2000 (2013-02-06 19:45:47)

Offline

Help fund CrunchBang, donate to the project!

#2 2012-08-17 22:52:05

swftech
#! CrunchBanger
From: SW Florida
Registered: 2012-06-08
Posts: 106
Website

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

I don't currently have a machine with EFI, but I have been asked by numerous people how to do this. I've passed it on and I am sure it will make a lot of people very happy. Awesome post!!

Offline

#3 2012-08-18 04:43:08

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 1,963

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

This is mynis, and I approve of this thread. My little contribution:
Not all UEFI implementations were created equal. My MSI motherboard has a built in UEFI shell (which I believe follows the intel standards) and I never had to boot from a USB stick or CD in UEFI mode like I always hear other people talking about. I actually had a working system booting in legacy mode from a GPT setup for a month or so and then later set it up to boot in UEFI mode. All I had to do was install grub-efi-x86_64 and then boot into the motherboards built in shell and type

fs0:
shellx64.efi

and it added the ARCH_GRUB entry to the boot menu automatically for me. In theory it should be the same for a debian install, you might have to copy some files to /boot/efi (which is where your FAT32 partition should be mounted). Like I said though not all EFI setups work the same, some start counting at one and some at zero. And it seems like OEM desktops and laptops are far less likely to have a built in UEFI shell which results in having to boot from a CD or USB stick in UEFI mode to add the entry to the boot menu like you described. Long story short though, there's a good chance you're going to have to fiddle around with things a bit to get your machine booting in UEFI mode with a given chipset. I hear the newest anaconda (fedora/redhat's installer) actually adds a boot entry to your motherboard's menu, hopefully debian figures something like that out before wheezy goes stable.

Offline

#4 2012-08-18 09:27:47

Joe_2000
New Member
Registered: 2012-07-21
Posts: 4

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

mynis01 wrote:

Not all UEFI implementations were created equal.

Thanks for pointing that out, so as an additional info this solution worked on a ASUS n56vm laptop.

mynis01 wrote:

Long story short though, there's a good chance you're going to have to fiddle around with things a bit to get your machine booting in UEFI mode with a given chipset.

Oh yeah. "Fiddling around" very well describes what I have been doing for three days  :-) Almost frustrating to see how it easy it looks when you actually know how to do it.
Anyways, if anybody is fighting with this and has trouble understanding the instructions above just let me know, I am happy to edit / clarify...

Offline

#5 2012-08-18 10:20:02

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

It's a bit of a disgrace that Debian hasn't prepared Wheezy to do a pure UEFI install.

Offline

#6 2012-08-18 10:48:58

Joe_2000
New Member
Registered: 2012-07-21
Posts: 4

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

el_koraco wrote:

It's a bit of a disgrace that Debian hasn't prepared Wheezy to do a pure UEFI install.

I had the discussion with a colleague the other day, and we saw the positive side about it. This forced me into actually understanding (at least roughly) how it all works. I am sure they will address this sooner or later, but when it then breaks on my machine I will be prepared to fix it manually :-)

Offline

#7 2012-08-19 11:13:54

KrunchTime
#! Die Hard
From: Not Where I Belong
Registered: 2012-03-02
Posts: 1,935

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

el_koraco wrote:

It's a bit of a disgrace that Debian hasn't prepared Wheezy to do a pure UEFI install.

Actually, I think it's more of a disgrace that Linux users have to deal with this at all since it was pushed by Microsoft.

Last edited by KrunchTime (2012-08-19 11:15:30)

Offline

#8 2012-08-19 18:58:18

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 1,963

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

KrunchTime wrote:

Actually, I think it's more of a disgrace that Linux users have to deal with this at all since it was pushed by Microsoft.

UEFI is BSD licensed and is a necessity in order to continue to push the envelope in large scale server platforms. EFI systems have been in use on Itanium based Linux super computers since the mid 90's. While the benefits of it might not be immediately transparent to home desktop users, it makes things a lot easier for system level programmers and enthusiasts. The whole BIOS standard is just ancient and I won't miss it. In time, the various distro maintainers will figure out how to make EUFI installs even simpler than they were on BIOS systems just like the Anaconda devs did. It will be especially cool when we can boot the kernel directly without even using grub, which should be possible in Linux 3.6.

Last edited by mynis01 (2012-08-19 18:59:02)

Offline

#9 2013-02-17 09:11:28

z0id
Member
Registered: 2012-09-22
Posts: 10

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

Hello all.

First of all: Thank you for this contribution. This helped me getting Waldorf to boot very quickly on a machine with W8 preinstalled.

There is only one thing bothering me a little bit:

When the grub boot screen appears and I choose either win 8 (loader) or win 8 recovery mode I get the following message:

"error: unknown command 'drivemap'.
error: invalid EFI file path.

Press any key to continue..."

Has anybody experienced this as well? Any ideas for a fix?

Thanks in advance for any help.

z0id.

Offline

#10 2013-03-08 05:18:07

nsp
Member
Registered: 2012-10-21
Posts: 14

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

Just want to dig this thread up to point out to others (and myself in the future) that there is a more compact way to perform the chrooting. Like so:

sudo -i                           # Makes all future commands, until Ctrl-D, execute with sudo
DEV=sdb4                                  # Only type device name once
MTPT=/media/$DEV
mkdir -p $MTPT
mount /dev/$DEV $MTPT
mount --bind {,$MTPT}/dev         # "{x,y}zed" gets intercepted by the shell and turned into
mount --bind {,$MTPT}/dev/pts   # "xzed yzed" and is useful in lots of situations
mount --bind {,$MTPT}/proc
mount --bind {,$MTPT}/sys
cp {,$MTPT}/etc/resolv.conf
chroot $MTPT /bin/bash

Last edited by nsp (2013-03-08 13:51:12)

Offline

#11 2013-08-10 06:30:37

jcharly2
Member
Registered: 2011-01-14
Posts: 26

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

jejejeje, i followed the steps, it generated me the grub.efi and i copied it to my EFI partition, but... when i added it, and tried to boot it... nothing happened...

could this steps have changed by now?

Offline

#12 2013-09-04 19:52:38

tomk11
New Member
Registered: 2013-09-04
Posts: 6

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

z0id wrote:

Hello all.

First of all: Thank you for this contribution. This helped me getting Waldorf to boot very quickly on a machine with W8 preinstalled.

There is only one thing bothering me a little bit:

When the grub boot screen appears and I choose either win 8 (loader) or win 8 recovery mode I get the following message:

"error: unknown command 'drivemap'.
error: invalid EFI file path.

Press any key to continue..."

Has anybody experienced this as well? Any ideas for a fix?

Thanks in advance for any help.

z0id.


I have the exact same issue,

perhaps you can do something with:

Shell> bcfg boot add 0 fs1:\EFI\crunchbang\grub.efi "Crunchbang (GRUB2)"

but add the windows option instead

Did you have any luck since your post?

Last edited by tomk11 (2013-09-04 19:53:06)

Offline

#13 2013-11-07 18:37:56

obmon
New Member
From: Bahrain
Registered: 2013-11-07
Posts: 9

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

I had to go through all this earlier this year when I bought my dell xps. Windows 8, efi firmware.

all I had to do is use boot repair live CD after I installed both systems. The key was making sure boot repair uses the efi partition that Windows creates on installation.. not working with CrunchBang though..



UPDATE: Try as I might, boot repair was useless. After following the above directions (perfection), distro is included in the bios eufi menu (F12). But as soon as you load windows, it "fixes" the boot order and removes crunchbang.

The answer I found was to use rEFInd. After the above steps, do not go into windows first, go into #! first, and install rEFInd...

Did the trick, now I got a working bootloader (it can even launch #! directly, bypassing Grub).

...and now to get them both working using secure boot.

Last edited by obmon (2013-11-20 10:31:56)

Offline

#14 2013-11-21 19:45:32

jmenace13
New Member
Registered: 2013-11-20
Posts: 2

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

Hey all,

so I'm trying to work through the coding here, and i'm getting to the line

sudo chroot $TARGET /bin/bash

and getting the error chroot: failed to run command `/bin/bash': No such file or directory

I looked through the directories and in my /media/sd9 directory there is a bin directory with a bash whateverthatis inside it.

what am i missing?

Thanks for your time guys.

Offline

#15 2013-11-25 19:30:18

crunchyinterrobang!?
New Member
Registered: 2013-11-25
Posts: 1

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

Hi everyone!

I am new to Crunchbang, but I like the live CD a lot.  My issue is that I got through the install just fine, and it says it installed GRUB in the MBR, but I have Win 8, so EFI does not load from MBR, right?  I tried the method listed here, and got to the part where you make the USB with  bootx64.efi and shellx64.efi in it.  shellx64_v2.efi, actually.  It was recommended by the Arch Linux forum. 


I booted using the USB in UEFI mode, like instructed, and I got a command line that started with Grub> instead of Shell>

I put in

Shell> bcfg boot add 0 fs1:\EFI\crunchbang\grub.efi "Crunchbang (GRUB2)"

but it came back with an invalid command.

Can anyone help me out? I'll provide more info if needed.  Thanks a bunch!

Offline

#16 2013-12-30 14:25:42

latgarf
New Member
Registered: 2013-12-30
Posts: 1

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

I like booting without a boot manager - no grub, no rEFInd. 
Here's how I achieved this with CrunchBang.
My EFI partition is /dev/sda1
I ran standard CB install, root file system on partition /dev/sda8.  I even wanted to decline grub installation, but missed how I could do that.
After CB install, I rebooted into another linux distro, which I had on the same machine. This was just for convenience - I believe the same process can be reproduced with chrooting from LiveCD as described in the above posts.
I mounted my EFI and CB partitions:

# mount /dev/sda1 /boot
# mount /dev/sda8 /mnt

My EFI partition's directory structure is:
/boot/EFI/windows
/boot/EFI/ubuntu
...
I created a new subfolder for crunchbang:
/boot/EFI/cb
Then I copied into /boot/EFI/cb  all 4 files from /mnt/boot :
vmlinuz-3.2.0-4-amd64
initrd.img-3.2.0-4-amd64
config-3.2.0-4-amd64
System.map-3.2.0-4-amd64
I suspect that only the first two files where necessary (would love to get someone's confirmation on this wink )
I renamed vmlinuz-3.2.0-4-amd64 into vmlinuz.efi  and  initrd.img-3.2.0-4-amd64  into initrd.img.

Efibootmgr utility was installed on my other linux, in which I was doing all this.  So, I first reviewed my current EFI boot menu options by running

# efibootmgr -v

and then I created a new menu entry for CB:

# efibootmgr -c -p 1 -g -L "cb" -l /EFI/cb/vmlinuz.efi -u "root=/dev/sda8 rootfstype=ext4 initrd=\EFI\cb\initrd.img"

Here's explanation of the parameters:
-c = Create a new EFI boot manager entry.
-p = specifies the ESP. In my case it is /dev/sda2 because that's how it came with Windows 8 preinstalled.
-g = Force disk with invalid PMBR to be treated as GPT.
-L = The name of the boot entry.
-l = Specify the kernel image.
-u = Arguments to pass to the kernel image such as the initrd, root device etc.

I checked current boot order by

# efibootmgr

BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001,0002,0000
Boot0000* cb
Boot0001  Windows Boot Manager
Boot0002  ubuntu

Boot order could be manipulated like this:

# efibootmgr -o 0000,0002,0001
$ man efibootmgr

lists all useful available options for this utility.

Rebooting took me immediately into CrunchBang, without any boot managers! smile

On those rare occasions that I need to boot into one of my secondary OS, I simply hit 'Esc' when powering up my Asus Zenbook laptop, and it shows me the menu of all possible boot options to choose from. This is necessary because I like timeout=0 as you saw above (no delay in booting whatsoever), but efibootmgr's option -t allows you to specify your desired timeout - I believe this would give you some seconds to select the desired menu item to boot into, just like grub or other boot loaders.

Warning: When kernel gets updated in the future, I will probably need to manually repeat the copy and rename procedure, which I described here.  To avoid this, using a boot manager is probably the only option (I'd love to know if/how I could avoid this update-copy-rename in my setup!)  Someone recommended to use gummiboot boot manager, which supposedly adds only 14 milliseconds to boot time.

Offline

#17 2014-03-14 21:06:58

rafael
New Member
Registered: 2014-03-14
Posts: 1

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

Hello!

I followed the instructions in the first post but got stuck trying to access the UEFI shell (there was no way to do it, from USB, copying it to the UEFI partition, nothing worked), so i ended downloading a ISO image of ALT Linux (which has a UEFI Shell option :-) and finished the job.

I am extremely thankful for the information posted in this thread because after installing crunchbang in my Asus q200e Vivobook (i wanted to install a lightweight distribution to make the most of it) and finding out that there was no way of booting it i got really frustrated and worried.

Now UEFI can start both Windows 8 or GRUB 2, the only problem is that GRUB 2 can not start Windows 8 (it offerst the option since the crunchbang installer deteted the windows partition and offered to keep it), this is extremely low priority but i still wanted to ask you if you think this could be fixed and how.

Anyway, thanks very much!

Offline

#18 2014-04-17 13:05:24

Ak_0
#! Member
Registered: 2011-05-14
Posts: 58

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

EDIT: Grub works now, UEFI Boot enabled, Secure boot disabled. Toshiba Satellite C55D. Here is the rescue disk i used  http://en.altlinux.org/Rescue

Last edited by Ak_0 (2014-06-03 09:47:07)

Offline

#19 2014-04-21 20:41:13

scwinn
New Member
Registered: 2009-05-11
Posts: 2

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

Why doesn't someone create an automated script that is tested and bulletproof.

I would love to rub\n Crunch Bang but my stupid UEFI computers won't let me do it.

I am NOT a command line kind of guy. I just want to use Crunch Bang alongside Windows 8.1 and enjoy both.

Offline

#20 2014-05-04 04:25:49

coffee_guy
Member
Registered: 2013-10-30
Posts: 35

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

mynis01 wrote:

UEFI is BSD licensed and is a necessity in order to continue to push the envelope in large scale server platforms. EFI systems have been in use on Itanium based Linux super computers since the mid 90's. While the benefits of it might not be immediately transparent to home desktop users, it makes things a lot easier for system level programmers and enthusiasts. The whole BIOS standard is just ancient and I won't miss it. In time, the various distro maintainers will figure out how to make EUFI installs even simpler than they were on BIOS systems just like the Anaconda devs did. It will be especially cool when we can boot the kernel directly without even using grub, which should be possible in Linux 3.6.

Thanks for clearing that up.  I knew BIOS needed to be replaced but I thought of UEFI as a way of locking out other operating systems by making it a pain in the ass.  I'm not buying a UEFI board until they get it straightened out though.

Offline

#21 2014-06-03 05:32:31

Choven
Member
Registered: 2013-01-13
Posts: 31

Re: How to install #! Waldorf on a UEFI machine with preinstalled W7

Thanks for the post.  Everything seemed to work with a few caveats mentioned below.

System: Toshiba Satellite C55D-A5108
Processor/Graphics: A6-5200
BIOS: v1.80
EFI: v2.31

Caveat #1
I had trouble booting into the UEFI shell.  I tried two thumbdrives: a 512mb drive did not work but a 2 gig drive did work.  Both were formatted FAT32.  I don't know why the 512mb drive would not work as a bootable drive.  Also, I could only get to the UEFI shell using Shell 1 (from Arch page), but this shell lacks the bcfg command.  I then tried the modified Shell v2 binary and it worked.  I'll note that I had to turn on UEFI boot before the USB stick would boot to the shell.

Caveat #2
I now have trouble dual-booting.  There is no option to boot windows or grub; the UEFI sequence goes straight to GRUB.  I tried to boot from my USB drive, but it seems that the motherboard boot menu doesn't have an effect on the boot order.  In other words, GRUB is not an option in my boot menu but it starts before the USB/Optical drive.  I changed my UEFI boot to CSM, tried to boot (no boot media), reverted back to UEFI, and GRUB is gone.  I'm going to keep working on this problem to figure it out, but at least I managed to get CB installed and updated.

[EDIT] I figured it out on my system.  First, switching to CSM and back to UEFI effectively wiped my boot options (partition remained unchanged, but GRUB is no longer an option).  Second, using 'add 0' in the OP's command makes GRUB boot first.  This makes it impossible to boot anything else.  Even using the boot menu to select USB did not work.  So after issuing the add command, I used 'bcfg boot dump' to see the available boot options and order.  As expected, GRUB is listed as the default (0).  To change the order, I used 'bcfg boot mv {#1} {#2}' to move #1 option to #2 option.  For example, I wanted USB (originally #2) to be listed first and GRUB second (originally #0).  To do this I issued the command 'bcfg boot mv 2 0'.  This moved USB to the default and bumped everything else down.  This was listed in the Arch page linked by the OP.  As long as GRUB2 is listed before Windows, then GRUB will be the default boot manager for my linux kernels.

[EDIT]  The second thing that I figured how to get to the Windows/GRUB option so that I can properly dual boot my system.  "Crunchbang (GRUB2)" doesn't appear boot menu, but my HDD does.  Once I click on my HDD, a new menu opens that let's me pick GRUB2 or Windows.  Problem solved for now, which is until I start distro hopping on a separate 50 gig partition and have to add a new entry to the grub menu.

NOTE:
My EFI system is installed on the second partition (sda2), but I couldn't tell if fs0 or fs1 should be used.  The mapping table lists fs0 as being GPT.  To check, I typed 'fs0:' and the 'ls' to see if there's an 'EFI/' directory.  If so, then I used 'fs0:' in the commands provided by the OP.

Choven

Last edited by Choven (2014-06-03 06:11:02)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo