LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Need advice installing slackware to a GPT/UEFI system (https://www.linuxquestions.org/questions/slackware-14/need-advice-installing-slackware-to-a-gpt-uefi-system-4175425718/)

arubin 09-05-2012 02:37 AM

Need advice installing slackware to a GPT/UEFI system
 
I took delivery of a new computer and am having difficulty with the Slackware 13.37 installation. I want to dual boot with windows

Asus P9X79 LE motherboard
Sda 120GB SSD
Sdb 1TB with Windows 7

My problem is that the discs are formatted with GPT and the boot mechanism is UEFI. The system is set to boot to Windows off sdb. I want to install Slackware to the SSD using most of sdb for home.

I managed to partition the disc with gpart. I had a problem with the slackware installation process recognising the partition I had earmarked for swap but this was fixed with makeswap /dev/sdb3. I had thought to install LILO to sda but this stalled.

Assuming that the installation until that point went OK my main problem seems to be how to get this to boot. My understanding now is that LILO will not work with GPT/UEFI systems.

I wonder if either of these will work.

Install Grub2 to sda. Is it possible to get into my uncompleted slackware installation and install Grub2?

If I repartition sda with fdisk will it then accept LILO writing to MBR? Since Windows in on sdb the repartition shouldn’t damage Windows. But will this work?

I suppose a third alternative might be to boot of a usb

( I suppose I need to boot of the slackware DVD and chroot into the installation to get a clue what is going on but I did have to get to bed last night)

TIA

ruario 09-05-2012 02:58 AM

Boot from the Slackware CD/DVD/USB and use the boot prompt to start Slackware from the hard disk (instructions are given above the boot prompt on how to do this). You can then install either Grub2 or the Syslinux package from Slackware 14.0RC4. I wrote about how to use Grub2 or Syslinux with GPT disks on Slackware in this thread.

P.S. I have been meaning to get this info (using GPT partitioning with Slackware) on the SlackDocs wiki but have not had the time yet. If any kind soul wants to do so they have my blessing to reuse anything I have written in that thread in any way they see fit. I require no credit.

ruario 09-05-2012 03:00 AM

I just noticed this comment:

Quote:

Originally Posted by arubin (Post 4773024)
the boot mechanism is UEFI

If you can simulate a BIOS (most UEFI systems can) you can use Syslinux. If not you will need to use Grub2 (or elilo, which I have not yet tested).

ack_iix 09-05-2012 04:42 AM

Hi Arubin,

I have a similar setup with you and have succeed in dual booting Slackware64 and Windows 7 x64 in UEFI mode, you can read my experience on my post here: http://www.linuxquestions.org/questi...t-disk-917864/

And this site: http://rodsbooks.com/ has plenty of information regarding booting Linux in UEFI mode and GPT disk format.

arubin 09-05-2012 05:26 AM

ruario - Thanks. I did try the boot with DVD/ start Slackware at prompt method last night but it woudn't boot. It was late and I was tired so I will try again tonight. I will have a look at the thread you referenced. I don't know anything about syslinux and I am a little wary now of messing with the boot sector of sdb, the disc which holds windows on this PC.

ack_ixix - Thanks for the pointer. It is complicated by the need to compile a 3.3 kernel and I would rather stick with Pat's chosen kernel if possible.

My inclination is to go the grub2 root. I have noticed this on the Slackbuild page

Quote:

If you want to install grub2 on GPT,
you need to put a BIOS boot partition on GPT.

This requires os-prober, gnu-unifont, and help2man
So will I have to create a BIOS boot partition of sda?

ruario 09-05-2012 06:13 AM

Quote:

Originally Posted by arubin (Post 4773155)
So will I have to create a BIOS boot partition of sda?

You only need a BIOS boot partition if you are using a BIOS (or BIOS compatibility booting in UEFI) and Grub2. Also it is worth noting that the BIOS boot partition can be anywhere on the disk (and it only needs to be 1Mb).

ruario 09-05-2012 06:30 AM

Quote:

Originally Posted by arubin (Post 4773155)
ruario - Thanks. I did try the boot with DVD/ start Slackware at prompt method last night but it woudn't boot.

Ok, that is a problem. To boot the DVD you will either need to enable BIOS compatibility mode in EFI (most have this option) or remaster your own Slackware DVD so that works with EFI. The official DVDs do not support EFi booting.

ruario 09-05-2012 06:37 AM

This post is helpful regarding how to master your own EFI capable Slackware DVD.

If you are using Slackware 13.37 (which you said you would) you will also need to recompiled the a kernel with EFI Framebuffer support turned on. If however you decide to use Slackware 14.0RC4 you can skip this step as it is already on in the default Slackware kernels. You will still need to remaster the DVD with elilo though like rwebber explained.

ruario 09-05-2012 07:05 AM

Another option, which would probably work (though I have not tested it) would be to use an EFI boot CD/DVD from another distro. For example, Ubuntu provides "Mac" desktop CDs. The only thing different about these is that they are EFI boot CD/DVD (because Mac's use EFI). They should actually boot on any EFI based PC. At the boot prompt you would then specify the Slackware 14.0RC4 kernel and initrd stored on some other media (e.g. a USB pendrive or something). Once booted you should be able to partition and start the Slackware installer as normal. Skip the Lilo section and install no bootloader. After install chroot into your new Slackware from the Slackware install environment and fetch Grub2 from Slackbuilds (or some other EFI capable bootloader like elilo), then install and configure this.

If all goes to plan you should now have Slackware installed. Or at least that is the theory. This is entirely untested.

arubin 09-05-2012 01:35 PM

Progress.

I have installed Slackware to sda2 and I have installed grub2 to sda

I can boot into my Slackware installation either from the grub2 menu or from a usb drive. I need to figure out how to set the grub menu. I now have a separate problem with startx. Kde starts and you can see the kde screen for a couple of seconds but then it crashes with a sementation fault. kglobaccel:Fatal IO error

Fatal server error:
[ 453.594] Caught signal 11 (Segmentation fault). Server aborting

ruario 09-05-2012 01:45 PM

can you boot a simpler window manager?

TobiSGD 09-05-2012 02:22 PM

Do you use the integrated Intel video or a separate video card?

arubin 09-05-2012 02:24 PM

Quote:

Do you use the integrated Intel video or a separate video card?
Nvidea. I'mm going to try and install the drivers with sbopkg

arubin 09-05-2012 02:54 PM

Well the nvidea driver install failed. Couldnt find the file.

I also having difficulty working out how to get grub.cfg. I have read that I need to run update but this does not appear to exist

arubin 09-05-2012 02:57 PM

Ok. I have now run NVIDIA installer from their site and I am in kde!

Still have grub.cgf to figure out

TobiSGD 09-05-2012 03:00 PM

Quote:

Originally Posted by arubin (Post 4773515)
Well the nvidea driver install failed. Couldnt find the file.

Sorry, but we aren't mind readers. To help you we need to know what exactly you have done and which exact error message(s) you got.

arubin 09-05-2012 03:20 PM

Sorry when I tried to install the nvidea-driver from sbopkg, sbopkg could not find the nvidea bz2 file it was looking for. I the tried doing it manually by running the NVIDIA installer downloaded from the Nvidea site and that worked.

Alan

ruario 09-05-2012 03:22 PM

Have you tried simply doing:

Code:

grub-mkconfig -o /boot/grub/grub.cfg
You may need to rename your initrd or patched /etc/grub.d/10_linux to find it.

arubin 09-05-2012 04:04 PM

Thanks. That does give me a grub menu but the menu will not boot. It stalls at mounting /dev/sda2

I presume grub.cfg needs editing. It does not look right. Initrd is being loaded for huge (perhaps that does not matter) but what about insmod est2? I am running on ext4.

Quote:

menuentry 'Slackware-13.37.0 GNU/Linux, with Linux 2.6.37.6 huge' --class slackware-13.37.0 --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='(hd0,gpt2)'
search --no-floppy --fs-uuid --set=root 61c5fbf6-4a4e-42dd-a6f0-f566e4900fe6
echo 'Loading Linux 2.6.37.6 ...'
linux /boot/vmlinuz-huge-2.6.37.6 root=UUID=61c5fbf6-4a4e-42dd-a6f0-f566e4900fe6 ro
echo 'Loading initial ramdisk ...'
### initrd /boot/initrd-2.6.37.6
}
menuentry 'Slackware-13.37.0 GNU/Linux, with Linux 2.6.37.6 (recovery mode)' --class slackware-13.37.0 --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='(hd0,gpt2)'
search --no-floppy --fs-uuid --set=root 61c5fbf6-4a4e-42dd-a6f0-f566e4900fe6
echo 'Loading Linux 2.6.37.6 ...'
linux /boot/vmlinuz-huge-2.6.37.6 root=UUID=61c5fbf6-4a4e-42dd-a6f0-f566e4900fe6 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd-2.6.37.6
}
menuentry 'Slackware-13.37.0 GNU/Linux, with Linux 2.6.37.6' --class slackware-13.37.0 --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='(hd0,gpt2)'
search --no-floppy --fs-uuid --set=root 61c5fbf6-4a4e-42dd-a6f0-f566e4900fe6
echo 'Loading Linux 2.6.37.6 ...'
linux /boot/vmlinuz-generic-2.6.37.6 root=UUID=61c5fbf6-4a4e-42dd-a6f0-f566e4900fe6 ro
echo 'Loading initial ramdisk ...'
initrd /boot/initrd-2.6.37.6
}
menuentry 'Slackware-13.37.0 GNU/Linux, with Linux 2.6.37.6 (recovery mode)' --class slackware-13.37.0 --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='(hd0,gpt2)'
search --no-floppy --fs-uuid --set=root 61c5fbf6-4a4e-42dd-a6f0-f566e4900fe6
echo 'Loading Linux 2.6.37.6 ...'
linux /boot/vmlinuz-generic-2.6.37.6 root=UUID=61c5fbf6-4a4e-42dd-a6f0-f566e4900fe6 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd-2.6.37.6
}

arubin 09-05-2012 04:32 PM

Sorry. Ignore the above. I was an idiot and had created an initrd for ext3 instead of ext4.

So I now have a functioning system and my initial question is solved.

Thanks everyone.

ruario 09-06-2012 12:28 AM

Quote:

Originally Posted by arubin (Post 4773590)
created an ext3 for ext3 instead of ext4.

Did you mean "created an initrd for ext3 instead of ext4"?

As a side note for anyone else needing to install on a GPT/UEFI system I ran a quick test last night and indeed it seems you can use the EFI capable install CD/DVD of another distro to bootstrap the Slackware installer, as I hypothesized earlier. Before I went to bed last night I setup VirtualBox to simulate an EFI system (there is an option to do this) and then did the following:

1. Booted from an openSUSE 12.2 x86_64 install DVD (which I already had because it just came out and I have been meaning to test it :) )
2. Switched to a virtual terminal
3. Brought up the network
4. Used wget to fetch the initrd.img from the slackware64-current/isolinux directory of a nearby mirror
5. Unpacked this into a newly created directory (using zcat and cpio)
6. Chrooted into that directory (after first using mount to bind /dev, /sys and /proc from the host system and copying over /etc/resolv.conf)
7. Setup the $PATH and other variables needed to run the installer (by sourcing the chooted system's profile, i.e. ". /etc/profile")
8. Partitioned with gdisk
9. Started Slackware's setup script and performed a network install using the nearby mirror

Since it got late I stopped there but so far so good. My intention tonight would be to try finishing this off with the following steps:

10. Exit the install chroot and then chroot into Slackware
11. Fetch, compile and install Grub2 (and dependencies), then configure it
12. Reboot into Slackware 14.0RC4

Whilst I have yet to do steps 10-11, I don't foresee any major obstacles, since I already did the seemingly 'hard' parts. In summary, the two things that complicate install of Slackware on GPT/EFI are the lack of official EFI-capable install media and boot loader. The provided setup tools and kernel support GPT/EFI.

P.S. I tried it this way to see what was possible. However a better/neater way would be to do what rwebber did and make your own EFI-capable Slackware install media (copy the contents of the Slackware install DVD [or USB], create a new "efi/boot" directory and add to this the elilo.efi program and an appropriately configured elilo.conf, pointing at the huge kernel+initrd from the install media).

arubin 09-06-2012 03:14 AM

Quote:

Did you mean "created an initrd for ext3 instead of ext4"?
Yes of course. In all the hassle of re-booting and tweaking I end up writing nonsense.

I will try and summarise what I did in a few days for the list but I will be away from my home PC for a few days. My next problem is very poor and intermittent ethernet connectivity which I suspect is a driver issue (see thread below).

ruario 09-11-2012 02:20 AM

Quote:

Originally Posted by ruario (Post 4773803)
Since it got late I stopped there but so far so good. My intention tonight would be to try finishing this off with the following steps:

10. Exit the install chroot and then chroot into Slackware
11. Fetch, compile and install Grub2 (and dependencies), then configure it
12. Reboot into Slackware 14.0RC4

Ok, it took a few nights before I had the time to finish this off but last night I had a spare moment to give it a go. However rather than setup Grub2, I decided to use Elilo, since it was less work then fetching and compiling Grub2 (also I hadn't tried Elilo yet and wanted to give it a try).

I mounted and switched into the the UEFI System Partition (a FAT32 filesystem you have to create during install, if not already present. You just need to make it big enough to hold your kernel(s) and associated files. Use gdisk to create it with type code EF00 and format with mkdosfs). There I created the directory structure ./EFI/BOOT and placed three files in it. Firstly an elilo.conf that looked like this:

Code:

prompt
timeout=50
default=huge

image=vmlinuz-huge-3.2.28
  label=huge
  read-only
  root=/dev/sda2

(Note: I have the UEFI System Partition as the first partition on the disk, hence root is on /dev/sda2)

Then I copied over vmlinuz-huge-3.2.28 alongside elilo.conf. Finally I downloaded elilo-3.14-all.tar.gz, extracted elilo-3.14-x86_64.efi and moved it into the UEFI System Partition next to the other two files but renamed to BOOTX64.EFI (./EFI/BOOT/BOOTX64.EFI is the name and path of the "default" bootloader on x86_64 UEFI System Partitions).

Upon reboot, Slackware started up. I then made an appropriate initrd.gz and copied this, along with vmlinuz-generic-3.2.28 over to the UEFI System Partition as well (in the same directory as the other two files). Next I tweaked the elilo.conf to look like this:

Code:

prompt
timeout=50
default=generic

image=vmlinuz-generic-3.2.28
  label=generic
  initrd=initrd.gz
  read-only
  root=/dev/sda2

image=vmlinuz-huge-3.2.28
  label=huge
  read-only
  root=/dev/sda2

The next reboot, brought Slackware up with the Generic kernel instead. Done!

P.S. Anyone else wanting to test all of this can use VirtualBox if you don't have an EFI-based machine. There is an option using EFI for booting rather than BIOS in the guest configuration.

ruario 09-11-2012 02:43 AM

As a further side note, yet another way to install Slackware on EFI hardware would be to do the following:

1. Boot with another distro's EFI-capable install media
2. Do all the partitioning and formatting of your hard disk (including creating the UEFI System Partition if needed)
3. Mount the UEFI System Partition
4. On the UEFI System Partition, under the ./EFI/BOOT/ directory, copy over elilo-3.14-x86_64.efi (renamed to BOOTX64.EFI), bzImage and initrd.img.
5. In the same directory create an elilo.conf that looks like this:

Code:

prompt
timeout=50
default=install

image=bzImage
  label=install
  initrd=initrd.img
  append="load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 SLACK_KERNEL=huge.s"

6. Reboot into the Slackware install environment from your hard disk
7. Unless you want to do an network install, insert a Slackware64 install DVD (this will be found later by the setup script)
8. Perform the install with two small alternations: don't format the UEFI System Partition; don't do the automatic lilo configuration.
9. Before rebooting, chroot into the new install, and make an initrd.gz.
10. Copy over vmlinuz-huge-3.2.28, vmlinuz-generic-3.2.28 and the initrd.gz into the ./EFI/BOOT/ directory on the UEFI System Partition.
11. Change the elilo.conf to something like the following (adjusting the root= values to match your own configuration:

Code:

prompt
timeout=50
default=generic

image=vmlinuz-generic-3.2.28
  label=generic
  initrd=initrd.gz
  read-only
  root=/dev/sda2

image=vmlinuz-huge-3.2.28
  label=huge
  read-only
  root=/dev/sda2

image=bzImage
  label=install
  initrd=initrd.img
  append="load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 SLACK_KERNEL=huge.s"

12. Reboot into Slackware.

ruario 09-11-2012 02:53 AM

The following are great sources of information on booting Linux on UEFI-based systems:

Archwiki's Unified Extensible Firmware Interface
Archwiki's UEFI Bootloaders
Rod Smith's Managing EFI Boot Loaders for Linux

ruario 09-11-2012 03:34 AM

The easiest way to make your own Slackware EFI-capable install media would be to create a USB boot disk. Partitioning it with a GPT partitioning scheme and include a UEFI System Partition (FAT32 filesystem, created with gdisk, using type code EF00, at least 50Mb and formatted with mkdosfs). Add a ./EFI/BOOT/ directory structure to this partition, into which place BOOTX64.EFI (extract elilo-3.14-x86_64.efi from elilo-3.14-all.tar.gz and rename it), bzImage, initrd.img and an elilo.conf that looks like this:

Code:

prompt
timeout=50
default=install

image=bzImage
  label=install
  initrd=initrd.img
  append="load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 SLACK_KERNEL=huge.s"

With this disk you should be able to boot into the Slackware install environment.

ruario 09-11-2012 03:53 AM

@arubin: Since you got this working and there are various options in this thread, you might want to mark the thread as solved. It will help other people searching for a solution to this.

arubin 09-11-2012 05:20 AM

ruario - I marked this solved last week.

ruario 09-11-2012 05:33 AM

Quote:

Originally Posted by arubin (Post 4777547)
ruario - I marked this solved last week.

opps! :( Shame on me!

arubin 09-11-2012 05:58 AM

My summary of how got my system going.

My PC has

sda SSD 120GB
sdb hard drive 1TB

I had originally partitioned the disks using Windows
to

sda1 ready for slackware14
sda2 for slackware 13.37
sda3 data

sdb1 Windows Boot UEFI
sdb2 small Windows hidden partition
sdb3 main Windows installation
sdb4 swap
sdb5 /var
sdb6 /home
sdb7 /shared windows Linux data

I prefered to prepare the original partition scheme with Windows because I believe that Windows positions the partitions correctly for SSDs without any hassle.

I installed Slackware 13.37 to sda2. The first time I attempted the installation I tried LILO. This was a mistake. LILO froze. I did the installation again omitting LILO.

At this stage I could only boot into Slackware by using the installation DVD or USB.

I was advised that I needed a small FAT partition on sda for GRUB2. I found that there were 3MB spare at the end of sda. So sda4 was partitioned and labelled EF00.

I created a Grub2 installation package on my old PC using the slackbuild and installed that by booting with the DVD and chrooting into my new installation.
Quote:

grub-install /dev/sda
Created initrd.gz as advised in the README and named that initrd-2.6.37.6.gz as advised by ruario

Then

Quote:

grub-mkconfig -o /boot/grub/grub.cfg
Configure the UEFI/BIOS to boot off the SSD.

Can then boot straight into GRUB2 then slackware

ruario 09-17-2012 04:19 PM

I added a summary of my own findings to the Slackware Documentation Project:

http://docs.slackware.com/howtos:ins..._uefi_hardware

arubin 10-17-2012 04:31 PM

I have tried creating a USB EFI disk as described but it doesn't seem to work.

When I try and boot the boot manager appears to recognise it as a UEFI boot but when I select it the lilo screen does not come up and the boot passes to whatever is next on the list.

Alan

Alien Bob 10-17-2012 05:13 PM

Quote:

Originally Posted by ruario (Post 4782666)
I added a summary of my own findings to the Slackware Documentation Project:

http://docs.slackware.com/howtos:ins..._uefi_hardware

The page was moved to http://docs.slackware.com/howtos:sla..._uefi_hardware

Eric

arubin 10-18-2012 03:47 PM

Well I am part of the way there.

My mistake was that I had used the elilo ia64.efi file.

Now I can boot with a kernel on the USB disk but

I do not get an elilo menu and I cannot get it to boot using the kernel on my hard drive.
This is elilo.conf

Quote:

prompt
timeout=50
default=generic

image=vmlinuz-generic-3.2.29
label=generic
initrd=initrd-3.2.29
read-only
root=/dev/sda1

image=vmlinuz-huge-3.2.29
label=huge
initrd=initrd.gz
read-only
root=/dev/sda1
It occurs to me shouldn't it be image=/boot/vmlinuz-generic-3.2.29 ?

ruario 10-19-2012 12:31 AM

No it shouldn't. You need to copy the kernel (and any initrd) over to the esp (efi system partition) and place them in exactly the same directory as elilo. elilo cannot read linux partitions, so the kernel has to be copied onto the esp with it.

You won't see a menu. To choose between the kernels you type the label at the boot prompt (e.g. type generic or huge) and hit enter, or just hit enter for the default (in your case generic). If you type nothing then after 5 seconds ("timeout" is in tenths of a second) it would boot generic.

ruario 10-19-2012 12:35 AM

Quote:

Originally Posted by arubin (Post 4809415)
My mistake was that I had used the elilo ia64.efi file.

I am not sure that was a mistake. I don't think you can buy a motherboard for a Desktop/Notebook PC with EFI that isn't 64-Bit compatible. It is important that you follow the steps on the wiki and rename it and place it in the correct directory with the other files.

jtsn 10-19-2012 07:43 AM

Quote:

Originally Posted by ruario (Post 4809660)
I am not sure that was a mistake. I don't think you can buy a motherboard for a Desktop/Notebook PC with EFI that isn't 64-Bit compatible.

IA64 is a 64 bit architecture, but it is not to be confused with AMD64. The first is the ISA of Intel's failed Itanium, while the latter is also known as x86-64, which is the instruction set of the usual PC CPU today.

arubin 10-19-2012 08:13 AM

Quote:

No it shouldn't. You need to copy the kernel (and any initrd) over to the esp (efi system partition) and place them in exactly the same directory as elilo.
So if I want to run Slackware on sda1 I need to copy kernel and initrd to the usb/efi and specipy root=/dev/sda1?

Actually this is looking less useful than I thought. I was hoping elilo would automatically bring up a menu to choose slackware or windows. I am not sure that I can boot windows from elilo and if anyway I would have to tab for the menu in elilo I might as well stick with my present set up of using grub from slackware and F8 for the BIOS/UEFI menu for windows.

damgar 10-21-2012 11:31 AM

Quote:

Originally Posted by arubin (Post 4809415)
Well I am part of the way there.

My mistake was that I had used the elilo ia64.efi file.

Now I can boot with a kernel on the USB disk but

I do not get an elilo menu and I cannot get it to boot using the kernel on my hard drive.
This is elilo.conf



It occurs to me shouldn't it be image=/boot/vmlinuz-generic-3.2.29 ?

This was my experience following the how-to as well. Everything works great from the USB stick, just as is expected, but when I create the EF00 partition on the hard drive and copy over elilo the bios doesn't recognize anything as EUFI ready and I get a message that there is no boot media. I tried everything I could think of even just mirroring the entire working USB stick to the hard drive as a proof of concept. Same result. I'm stumped.


All times are GMT -5. The time now is 06:59 PM.