Need help setting up bootloader (gpt table on bios motherboard)
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
/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.
*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.
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
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.
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
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.
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.
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:
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.
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?
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 :)
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.