LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-17-2014, 09:30 PM   #1
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
Need help setting up bootloader (gpt table on bios motherboard)


Hi, I have two hard disks on my PC. One is with a msdos table and Windows installed on it. I am trying to setup Slackware on The other HD with a gpt table. I did that before and ir was straightfoward: LILO installed fine. However I am not having luck now. LILO setup doesn't complete, it fails to detect Windows properly, it fails to install. I even tried grub but ir didn't work either. When I was trying to setup grub my partition scheme was the following:

/dev/sdb1 - first 2MiB for grub
/dev/sdb2 512 MiB swap
/dev/sdb3 25GiB for root (with btrfs)
/dev/sdb4 rest of the harddisk for /home

Currently I have nothing on that harddisk, looking forward to try it again tomorrow.

Followed this tutorial on my attemps.

Last edited by moisespedro; 11-17-2014 at 09:39 PM.
 
Old 11-17-2014, 09:56 PM   #2
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
First off let's review your partition scheme:

Quote:
/dev/sdb1 - first 2MiB for grub
/dev/sdb2 512 MiB swap
/dev/sdb3 25GiB for root (with btrfs)
/dev/sdb4 rest of the harddisk for /home
You should have the /dev/sdb1 partition labeled as EF02. If it is, then you're spot on. However, /sdb1 should be the /boot partition, not the bios_grub boot partition.

The next question is, how much system RAM do you have, and are you going to be compiling stuff regularly? 512MB is rather small for swap. Unless you have more than 8GB of RAM, you should at least use 2GB at least, with no more than 8GB for swap if you'll be building a lot of software. There's no benefit to going past 8GB of swap though. If you're system has enough RAM, then you'll need less swap space, but generally the recommended average and minimum I've seen personally is 2GB.

Next, btrfs is risky to use still**, you will need a ext2/3/4 formatted /boot partition, however, to use btrfs as /(root). Personally, you could get away with using JFS with just as good a result, so you've been warned. There have been reports of btrfs causing a failure during the installation of Slackware. I have seen and witnessed it firsthand with the 14.1 install, so user beware. You should dedicate at least 50GB to /(root) for growth purposes, especially logs and the aspect of Copy-on-Write shadow copies taking up a deal of space.

/home is fine, but if you have multiple users, you should think about quotas.

Technically, you should have this:

Code:
/dev/sdb1 - 25MB - EXT2 - /boot partition
/dev/sdb2 - 2MB - EF02 grub partition
/dev/sdb3 - 2GB - swap space
/dev/sdb4 - 50GB - JFS/EXT4/XFS* - /(root) partition
/dev/sdb5 - remaining space - BtrFS - /home
*I personally would avoid using BtrFS as the root partition and use JFS, EXT4, or XFS instead and use BtrFS for /home due to the fact, BtrFS is a copy-on-write file system and BtrFS supports shadow copies for file recovery. On /(root) it can actually be very problematic due to the fact it keeps a few file versions in cache. Plus, due to the volatility of BtrFS, /home becomes more sacrificial if anything goes wrong, and you have a stable file system under root user.

**If anything wait until the next release of Slackware to use BtrFS. The current version in 14.1 is not classed as Stable.

Now let's move onto Grub.

You first should setup Grub as follows as root:

Code:
mkdir -pv /boot/grub
Grub will require it's own directory in /boot, so make sure you have ample space by allocating at least 25MB for /boot if you have a /boot partition, which you should have probably with btrfs.

Next, run this as root:

Code:
grub-mkconfig -o /boot/grub/grub.cfg
This should detect all available hard drives and give the proper boot setup. It should give you:

Code:
Slackware 14.1
Slackware 14.1 Advanced Options
Windows Recovery on /dev/sda
Normally the Windows Recovery listing is actually correct. Sometimes it will list as Windows Vista as well, but both are technically limitations of the os_prober package.

Then finalize it by running:

Code:
grub-install /dev/sdb
Note that if you have a separate hard drive, you probably should use the BIOS boot selection menu, especially if Windows is on /dev/sda and Linux is on /dev/sdb. Usually pressing [ESC] at the POST prompt brings up this menu.

From what I do know, LILO does have some problems at times with certain setups. I don't know the details, but I do know Grub does in fact work a lot better in some cases when LILO has issues.

Last edited by ReaperX7; 11-17-2014 at 10:10 PM.
 
Old 11-17-2014, 10:08 PM   #3
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Original Poster
Rep: Reputation: 195Reputation: 195
OH, I forgot to mention: I do have a /boot partition

I basically copied the scheme from Gentoo Handbook. Also, I have only 4GB of RAM but my system rarely uses swap and when it needs it uses zram so, to be honest, I don't even think I need swap at all. Anyways, isn't a way to make LILO work worh this? ELILO? Does it have/need some special partition like Grub?

Last edited by moisespedro; 11-17-2014 at 10:09 PM. Reason: Stupid iPad
 
Old 11-17-2014, 10:17 PM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
I've done very little with eLILO honestly, but I do know Grub does work because I have a near identical setup:

My partition layout is:

/dev/sdb1 - ext2 - 25MB - /boot - also has noauto in fstab to keep it from being automatically mounted.
/dev/sdb2 - ef02 - 2MB - bios_boot
/dev/sdb3 - swap - 8GB - swap (I do a lot of building and only have 4GB RAM, so it helps)
/dev/sdb4 - jfs - 50GB - /(root)
/dev/sdb5 - zpool/zfs - 425GB - /home using zfs-on-linux.

I think, if I remembered correctly, LILO worked best with MBR partition schemes because it wrote to the MBR. eLILO, I don't know, but I do know it does support EFI partitioning.
 
Old 11-18-2014, 07:00 AM   #5
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Original Poster
Rep: Reputation: 195Reputation: 195
It worked, my partition scheme is the following:
Code:
root@slack:~# parted -a optimal /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA WDC WD5000AAKS-0 (scsi)
Disk /dev/sdb: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name    Sinalizador
 1      1049kB  3146kB  2097kB                  grub    bios_grub
 2      3146kB  137MB   134MB   ext2            boot
 3      137MB   674MB   537MB   linux-swap(v1)  swap
 4      674MB   27,5GB  26,8GB  ext4            rootfs
 5      27,5GB  342GB   315GB   ext4            home
And I've installed it with:
Code:
# mkdir -pv /boot/grub
# grub-install --modules=part_gpt /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg
Thanks Reaper and thanks ruario for this.

I just have a minor issue involving os-prober, sometimes it hangs and it puts all kernels (huge and generic) in the grub menu. So far so good. I liked LILO better but eventually I will get used to this.
 
Old 11-18-2014, 07:49 PM   #6
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Check out documentation on how to setup an /etc/default/grub configuration file as well. You can use it to add graphics, themes, fonts, framebuffer modes, etc.
 
Old 11-18-2014, 07:57 PM   #7
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Original Poster
Rep: Reputation: 195Reputation: 195
Well, I want LILO back. This thing has too many options, configurations, etc
 
Old 11-18-2014, 11:01 PM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Quote:
Originally Posted by moisespedro View Post
Well, I want LILO back. This thing has too many options, configurations, etc
It never hurts to learn new things, IMHO.

Oh and don't try elilo, it can't make boot sectors, it provides EFI bootloader files instead, so it only targets EFI firmwares, not BIOS.
 
2 members found this post helpful.
Old 11-18-2014, 11:12 PM   #9
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Grub can be simple or complex. It's up to you. Personally, I just use it with the default settings, so no fuss.

And editing /boot/grub/grub.cfg isn't hard once you see they layout. It's basically a script of sorts. It looks intimidating, but honestly, it's easy, possibly less a headache than LILO.

I have used these in the past though for /etc/default/grub:

GRUB_TIMEOUT="10"
GRUB_TERMINAL_INPUT="console"
GRUB_TERMINAL_OUTPUT="gfxterm,console"
GRUB_CMDLINE_LINUX=""
GRUB_VIDEO_BACKEND="vbe"
GRUB_GFXMODE="1024x768"
GRUB_GFXPAYLOAD_LINUX="keep"

These gave me a nice bootup with the framebuffer console set similar to LILO's vga=792 mode, and 10 second timer for boot selections.

If you need more explanations, check this website:

https://www.gnu.org/software/grub/ma...iguration.html

One suggestion, edit your /boot/grub/grub.cfg file where the kernel is:

/boot/vmlinuz-#insert_name# to simply use the /boot/vmlinuz symlink so you never have to rerun Grub when you update your kernel before you install it to the boot sector. It saves a lot of time and headaches.

Last edited by ReaperX7; 11-18-2014 at 11:38 PM.
 
1 members found this post helpful.
Old 11-19-2014, 04:34 AM   #10
EYo
Member
 
Registered: Jun 2009
Distribution: Slackware
Posts: 190

Rep: Reputation: 153Reputation: 153
Finally I'm digging in and learning more about GRUB, it's kind of fun trying to make it do what I want. I made this crude edit so to see the kernel version on the menu, like "Slackware-14.1-3.10.17" Is there a more elegant way?

Code:
GRUB_DISTRIBUTOR=$( echo -n "`sed 's/Slackware /Slackware-/' /etc/slackware-version`-" && uname -r )
I have a corner case where EFI boot will hang my machine, trying to figure out how to have osdetect.cfg fail gracefully when no EFI partitions exist. Separate topic

Last edited by EYo; 11-19-2014 at 06:09 AM. Reason: Reading comprehension :)
 
1 members found this post helpful.
Old 11-19-2014, 05:22 AM   #11
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Original Poster
Rep: Reputation: 195Reputation: 195
Quote:
Originally Posted by Didier Spaier View Post
It never hurts to learn new things, IMHO.
I agree but in this case I am feeling lazy.

And thanks again Reaper I will take a look at it when I have more time.
 
Old 11-19-2014, 07:23 AM   #12
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by EYo View Post
Finally I'm digging in and learning more about GRUB, it's kind of fun trying to make it do what I want. I made this crude edit so to see the kernel version on the menu, like "Slackware-14.1-3.10.17" Is there a more elegant way?

Code:
GRUB_DISTRIBUTOR=$( echo -n "`sed 's/Slackware /Slackware-/' /etc/slackware-version`-" && uname -r )
I have a corner case where EFI boot will hang my machine, trying to figure out how to have osdetect.cfg fail gracefully when no EFI partitions exist. Separate topic
I'm not sure how well that will work since I don't use grub, but just as an FYI backticks are generally frowned on for running commands within a command. It should be $(command). Knowing this would've saved me some grief on stackexchange when I submitted a bash question a few years ago. You can have nested commands like you had above where backticks don't allow it. It isn't formally deprecated, but it is highly recommended to not use it, and is essentially, in any other sense of the word, deprecated. See more here. If you're already aware of this and chose to use backticks, carry on , but in case you weren't aware, I just wanted to throw the information out.

Code:
$( echo -n "$(sed 's/Slackware /Slackware-/' /etc/slackware-version)-" && uname -r )
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Install with GPT on BIOS ReaperX7 Slackware - Installation 6 10-23-2014 09:54 AM
Install in GPT-BIOS amandus Slackware 8 09-28-2014 11:38 AM
[SOLVED] Fresh install 64 14.1 with GPT without EFI in a BIOS motherboard lupe Slackware 17 11-13-2013 03:28 PM
Gpt Table Questions xerofoify Fedora 0 08-27-2012 12:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration