LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-17-2013, 04:15 PM   #1
slack_
Member
 
Registered: Oct 2013
Distribution: Slackware, Arch
Posts: 105

Rep: Reputation: Disabled
Trouble installing GRUB


Hello I'm slack_ glad to be here. I'm currently working on a little project, if you can call it that, and I'm running into some trouble. Basically what I'm trying to do is create a key to get into my computer. I'm trying to set up /boot on /dev/sdb1(my usb) and install GRUB on said device as well. The desired effect is that you would't be able to get into my computer at all unless this usb device was plugged in. I've tried this with LILO and it doesn't want to work, and I've seen a method on the Arch wiki using GRUB so I figured I'd try that instead. I will explain the steps I've taken:

First off, I'm intending on running a dual-boot with Win7. So my partitioning scheme is as follows:

/dev/sda1(Windows boot)
/dev/sda2(Windows)
/dev/sda3(Partition shared between Win and Nix)

Then, using fdisk, I create a Primary partition /dev/sda4. This will be mounted as /. Next, I create a new Primary partition on /dev/sdb1(usb) and make it bootable. This will be mounted at /boot. Both partitions are ext4. So now my partitioning schemed looks like this:

/dev/sda1
/dev/sda2
/dev/sda3
/dev/sda4 Linux

/dev/sdb1 (bootable) Linux

Now, I go through the setup. I don't create a SWAP. I set the target partitions. As I said, /dev/sda4 target is /. Target for /dev/sdb1 is /boot. I skip creating a boot disk. I do a full install, and I skip installing LILO. Here's where I run into trouble.

After I configure the system, instead of starting over. I open up a new TTY and download grub-0.97-i486-9.txz from http://packages.slackware.com/ in extra/grub under the Slackware 14.0 32bit release. Then I run these commands:

installpkg grub-0.97-i486-9.txz (works successfully)

slackpkg update (can't resolve mirrors)
I've made sure to enable only one mirror under the US Slackware 14.0 section. I've tried multiple different ones, and even though I'm connected to the internet, the mirrors always fail.

However, just last night this part worked for me successfully. So, let's pretend that it works for me now. The next step after that I would run is:

slackpkg install grub

This is the error I get with that:

Code:
Looking for grub in package list. Please wait... DONE

No packages match the pattern for install. Try:

/usr/sbin/slackpkg reinstall|upgrade
Running the recommended command doesn't work for me.
 
Old 10-17-2013, 04:57 PM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,718

Rep: Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674
You wouldn't happen to have installed slackware 64 and trying to use a package from slackware 32 bit? If so, I don't think that will work without setting up for multilib. If your running slackware64 installing grub2 from current would probably work.
 
Old 10-17-2013, 05:56 PM   #3
slack_
Member
 
Registered: Oct 2013
Distribution: Slackware, Arch
Posts: 105

Original Poster
Rep: Reputation: Disabled
I am running Slack64 in fact. Although I believe I've tried to install GRUB2 before and it didn't work either. You say I need to get grub2 from current? Which mirror should I be using?
 
Old 10-17-2013, 09:28 PM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,564
Blog Entries: 15

Rep: Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118
All the mirrors in slackpkg's mirrors list should all have it.

If you are using Slackware 14.0 distribution you should get the packages from SlackBuilds.org, not the -current repository.

You'll need all the respective dependencies also for Grub2 as well:

os-prober-1.63
gnu-unifont-5.1
help2man-1.40.11
locale-gettext-1.05

Install order is as such:

locale-gettext-1.05
help2man-1.40.11
gnu-unifont-5.1
os-prober-1.63
grub-2.00

Then setup Grub using this method:

Code:
mkdir /boot/grub
grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sda
Because you added /boot as a USB drive on /dev/sdb you may need to check the /boot/grub/grub.cfg to make sure the bootloader is set properly to auto-detect the bootloader and kernel being set on a removeable drive.

Not to poke and shoot down your idea, but you very much so, over-complicated the system by using a /boot partition off the main drive. It's not a bad idea, but it's just over-complicated and setting up Grub2 is often very problematic as the USB drive must be bootable and read-ready at startup. Some ways around this might be to install grub to /dev/sdb and have the USB drive as the 1st bootable device with the HDD boot disabled.

You could have simplified your security by placing a password in the CMOS/BIOS for the hard drive so that without the password it won't boot, and protecting the CMOS with a password also.
 
Old 10-17-2013, 09:40 PM   #5
slack_
Member
 
Registered: Oct 2013
Distribution: Slackware, Arch
Posts: 105

Original Poster
Rep: Reputation: Disabled
So, assuming I still wanted to go ahead and test out my method despite the fact that you say it's overcomplicated(I'm not arguing with you) then, using your grub setup instructions could I do:

Code:
mkdir /boot/grub
grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sdb1
Correct? I'm also assuming that making the directory /boot/grub should be done on the USB, given that I'm still attempting that method. By the way, when I'm running these commands should I be doing everything with /dev/sdb1 or /dev/sdb?
 
Old 10-17-2013, 10:33 PM   #6
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,564
Blog Entries: 15

Rep: Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118
It would be /dev/sdb as Grub would be installing to the master boot record of the drive, not the actual partition itself.

The /boot directory should be mounted for /dev/sdb1 and so all directories will in fact be on /dev/sdb1.

Basically you'd want to do something such as this to more or less ensure the /boot directory is in fact set for /dev/sdb1 for files to be properly placed (note this also assumes you're using an ext4 partition scheme, but this can be changed:

Code:
mount -v -t ext4 /dev/sdb1 /boot
mkdir /boot/grub
grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sdb
Your Slackware entry in Grub.cfg should read somewhat(?) similar to this:

Code:
menuentry "Slackware64 14.0 GNU/Linux" {
  set root=(hd0,3)
  linux /boot/vmlinuz root=/dev/sda3 ro
}
Note that the root= entry will have to be checked before you run grub-install. Make sure all the variables are set to ensure that it specifically reads correctly.

For further security you should also comment out the entry in fstab for your /boot partition as well so that the /boot partition and device /dev/sdb remains hidden. Be warned that udisks and udev could automount the device as well.

By enforcing the boot to the USB device you shouldn't require anything else... at least I hope so. Grub-2.00 is very tricky to work with at times and I'm still having issues with certain functions of it.
 
Old 10-17-2013, 10:48 PM   #7
slack_
Member
 
Registered: Oct 2013
Distribution: Slackware, Arch
Posts: 105

Original Poster
Rep: Reputation: Disabled
Thank you so much for your replies, you've been immensely helpful. I'll be sure to take your advice and I'll let you know if it works out well.
 
Old 10-17-2013, 10:51 PM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,718

Rep: Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674
This is the better way
Quote:
If you are using Slackware 14.0 distribution you should get the packages from SlackBuilds.org, not the -current repository.
I just gave it a try using current, one can get it work if just the grub package is installed, but just because I got it to work on my system doesn't mean it will work on a different system. The os-prober from current will cause Slackware 14.0 to lock-up hard.

Last edited by colorpurple21859; 10-17-2013 at 10:54 PM.
 
Old 10-18-2013, 12:04 AM   #9
slack_
Member
 
Registered: Oct 2013
Distribution: Slackware, Arch
Posts: 105

Original Poster
Rep: Reputation: Disabled
Well the packages from SlackBuilds worked out for me...I think. I'm very new to Slackware and I'm still getting the hang of installing packages and things like that. I extracted and built it using ./configure, make, and make install. Then I ran the commands I was told to run earlier:

Code:
mount -v -t ext4 /dev/sdb1 /boot
mkdir /boot/grub
grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sdb
However, when I got to grub-mkconfig, it said that the command grub-mkconfig doesn't exist.
 
Old 10-18-2013, 12:15 AM   #10
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,564
Blog Entries: 15

Rep: Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118
Technically using ./configure, make, make install isn't needed as often you end up installing packages inside /usr/local and lack management of those packages in pkgtool.

Most SlackBuilds are installed using this similar methodology:

Code:
tar -xzf grub2.tar.gz
mv -v grub-2.00.tar.xz grub2
cd grub2
ARCH=x86_64 ./grub2.SlackBuild
installpkg /tmp/grub-2.00-x86_64-SBo.tgz
This builds packages in a fakeroot-like environment, then fakeroot-installs, and repackages them, and all necessary files into their proper directories so that the pkgtool system can install them to their correct directories in /(root) or /usr.

Last edited by ReaperX7; 10-18-2013 at 12:18 AM.
 
Old 10-18-2013, 12:54 AM   #11
slack_
Member
 
Registered: Oct 2013
Distribution: Slackware, Arch
Posts: 105

Original Poster
Rep: Reputation: Disabled
This method worked for me up until the second to last step. After building the package the last message I see is:

find: '/tmp/grub-2.00-x86_64-SBo.tgz' file not found

So obviously when I ran the installpkg command nothing installed.. I'm sorry I can't be more helpful with my error messages. It's hard to get error messages into a .txt from my chrooted environment in a LiveCD to my shared partition to windows in order to copy/paste them here.
 
Old 10-18-2013, 01:04 AM   #12
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,564
Blog Entries: 15

Rep: Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118Reputation: 2118
Check the /tmp directory for what files it lists:

Code:
ls /tmp
Often it can be labeled as -SBo and _SBo as well. Don't follow the example exactly though as I haven't been working with a Slackware system actively for a while now except on my laptop which hasn't been updated in a while now.

What LiveCD are you using? SalixOS, Gentoo, or one of the Debian/Ubuntu based Live disks?

Last edited by ReaperX7; 10-18-2013 at 01:06 AM.
 
Old 10-18-2013, 01:37 AM   #13
slack_
Member
 
Registered: Oct 2013
Distribution: Slackware, Arch
Posts: 105

Original Poster
Rep: Reputation: Disabled
Hmm. Interestingly enough, the /tmp directory looked like this:

/tmp/SBo/grub-2.00/..

Then there was a bunch of files and an install file and such. I couldn't really install it will installpkg because there was no .tgz or txz files. So the only thing I could have done was ./configure, make, make install...

Either way grub-mkconfig still doesn't exist. Grub has proven to be notoriously hard to try to install in Slackware 64.

I'm just using a slackware iso I downloaded from the website and burned to a dvd. Not sure if I understood your question properly.

Last edited by slack_; 10-18-2013 at 02:35 AM.
 
Old 10-18-2013, 06:38 AM   #14
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,718

Rep: Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674Reputation: 1674
The package should be in this directory.
Quote:
/tmp/SBo/grub-2.00/
These
Quote:
locale-gettext-1.05
help2man-1.40.11
gnu-unifont-5.1
os-prober-1.63
need to be installed first before installing grub2 to keep from getting errors.
 
Old 10-18-2013, 01:28 PM   #15
slack_
Member
 
Registered: Oct 2013
Distribution: Slackware, Arch
Posts: 105

Original Poster
Rep: Reputation: Disabled
Ah I see. I figured I didn't install them right. Well, whenever I figure out how to install those packages I guess this will work. I don't know what I did wrong but only one of the packages installed. One said, ./configure no such file or directory, and the other wouldn't let me run make install. I can't remember the error.

EDIT: By the way according to Slackbuilds, grub doesn't require the locale-gettext package.

Last edited by slack_; 10-18-2013 at 01:30 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Grub freeze and trouble installing Mads Holscher Linux - General 2 02-26-2011 04:44 AM
GRUB trouble - installing to unbootable logic partition / other options Ill-Phil Linux - General 9 12-12-2008 05:20 AM
Trouble installing fd9 and now fd8, wont bring up grub config bigmart01 Linux - Newbie 13 06-02-2008 11:56 AM
Trouble installing Grub jacatone Puppy 5 03-28-2007 08:59 AM
Trouble installing grub rastiazul Linux - Newbie 3 05-15-2006 06:06 PM

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

All times are GMT -5. The time now is 06:35 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