WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: grub2 lost...  (Read 3192 times)

Offline keithterrill

  • Newbie
  • *
  • Posts: 16
  • Old Timer with Old Boxes
grub2 lost...
« on: April 26, 2014, 03:20:31 PM »
Forgive me, I have been pawing through the forum attempting to learn how to use grub2. I have been to http://www.gnu.org/software/grub/index.html looking for tutorials, help, documentation. It feels as if I am becoming more confused as I go along.

I have been playing with tiny core on an old 486 PC, 256m ram, 38g dirve, 2 cd roms. I wiped out the Windows XP that was on the box. It was a slow and very infected beast given to me by a neighbor.

I also wanted to take a look at some of my old ms-dos programs, etc. So, I created 2 partitions a FAT32 and an ext4. I loaded FreeDOS into one, and TinyCore into the other. After trying to follow the directions for grub2, I reformatted the drive and then created 3 partitions. The first is 100mb specifically for grub, the other two are equally divided for ext4 and FAT32. TinyCore is installed in the second partition. I attempted to put grub in the first partition, which it did... I think.

When I attempt to boot I come up to a command line for grub. I have used my cd copy of TinyCore to boot up into TinyCore and look at the files and attempt to "fix" things.

The first partition mounts as sda1. The second mounts as sda2. In sda1 I have:

/mnt/sda1/boot
/mnt/sda1/boot/grub
/mnt/sda1/boot/grub/fonts
/mnt/sda1/boot/grub/i386-pc
/mnt/sda1/boot/grub/locale

I am not able to find a configuration file, nor create one. One of the GNU documentation sites suggest that I should find a /boot/grub/grub.cfg file which they recommend not to be touched.

So... any guidance  would be appreciated.

Thank-you

Keith
Keith L Terrill

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
grub2 lost...
« Reply #1 on: April 26, 2014, 11:15:31 PM »
Use the commands from the info file in the repo to install grub2 and update the config file


It is likely that your grub.conf file us not configured properly or core.gz and vmlinuz could not be found

core.gz and vmlinuz are best installed to
sda1/boot/
Place at that location before running the grub install or update commands


If that did not fix your issue please upload your grub.conf file


Sent from my iPhone using Tapatalk
« Last Edit: April 26, 2014, 11:17:12 PM by coreplayer2 »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14824
Re: grub2 lost...
« Reply #2 on: April 26, 2014, 11:18:48 PM »
Did you take a look at the grub2 extension info file?

Specifically:
Quote
                howto:
                $ sudo mount /dev/sdc1
                $ sudo grub-install --boot-directory=/mnt/sdc1/boot /dev/sdc
                $ cat /mnt/sdc1/grub/grub.cfg

                insmod ext2
                search --no-floppy --fs-uuid --set=root 3916536c-ab5b-45f4-92de-a6b8af8ec630

                menuentry "core" {
                linux /boot/vmlinuz quiet noswap waitusb=10:UUID="3916536c-ab5b-45f4-92de-a6b8af8ec630" tce=UUID="3916536c-ab5b-45f4-92de-a6b8af8ec630" tz=GMT-4 blacklist=bcma blacklist=ssb blacklist=b43 text
                initrd /boot/rootfs.gz /boot/modules.gz
                }

The above example is for a usb stick boot, but could be modified for your hard drive install.
« Last Edit: April 26, 2014, 11:21:31 PM by Juanito »

Offline keithterrill

  • Newbie
  • *
  • Posts: 16
  • Old Timer with Old Boxes
Re: grub2 lost...
« Reply #3 on: April 27, 2014, 12:26:21 AM »
Thank-you everyone.

I got it working. My problem was understanding the grub system as well as how files are pointed (referred) to.

Coreplayer, as for moving my core.gz to sda1/boot, that was not necessary. Nor, do I believe that would be the correct solution, though it would work. The correct solution was to correctly point to where the core.gz is installed. So, I looked for it, thought through how the naming conventions work and edited the grub.cfg file.

Juanito, I did attempt to follow the howto found in the grub2 extension info file. That is where I began to get confused, and also where I found the clue to solving my problem. It helped to play and experiment a little, too.

My first problem lies with the fact that up until this last week I have not touched Linux and have been almost strictly an NT geek, with a bit of Data General AOS and Rdos back history. I am still not sure why I have not been able to use the cat command correctly, but that did not allow me to create the grub.cfg

After reading the GNU grub documentation, using editor I created sda1/boot/grub/grub.cfg and followed the pattern that I saw in the grub2 extension info file. That gave some results, but grub failed because it could not locate the vmlinuz. So, looking again at the naming conventions I discovered that I needed to name a different path.

Once, I got the grub to launch my Tiny Core, I then loaded the FreeDOS into the third partition. With a little wrestling with the gurb.cfg I was able to launch the FreeDOS. Now, I have a system that works.

The file: sda1/boot/grub/grub.cfg is:
--------------------------------------------------------------------------
# Begin /boot/grub/grub.cfg

set default=0
set timeout=5

insmod ext2
search --no-floppy --fs-uuid --set=root 80e39755-27fd-446c-ad02-c7801ff2067f

menuentry "Tiny Core" {
linux /tce/boot/vmlinuz loglevel=3 cde showapps desktop=icewm waitusb=10:UUID="80e39755-27fd-446c-ad02-c7801ff2067f" tce=UUID="80e39755-27fd-446c-ad02-c7801ff2067f" blacklist=bcma blacklist=ssb blacklist=b43
initrd /tce/boot/core.gz
}

menuentry "Free DOS" {
set root=(hd0,3)
freedos /fdos/bin/KERNEL.SYS root=/dev/sda3
}
--------------------------------------------------------------------------

I am not sure of all that is going on with the commands, but I have a better handle on it now than when I started.

Thank you for your help, any additional help is appreciated. I am documenting as I go along, but it would be nice to not reinvent the wheel, so to speak.

Keith L Terrill
Keith L Terrill

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11643
Re: grub2 lost...
« Reply #4 on: April 27, 2014, 12:40:41 AM »
Hi keithterrill
Quote
blacklist=bcma blacklist=ssb blacklist=b43
Are you blacklisting those modules because you need to or did you just copy that from the example?

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: grub2 lost...
« Reply #5 on: April 27, 2014, 01:37:04 AM »
Also along with the blacklisting, other boot codes are wrong   

Code: [Select]
linux /tce/boot/vmlinuz loglevel=3 cde showapps desktop=icewm waitusb=10:UUID="80e39755-27fd-446c-ad02-c7801ff2067f" tce=UUID="80e39755-27fd-446c-ad02-c7801ff2067f" blacklist=bcma blacklist=ssb blacklist=b43

might be better to remove the cde bootcode especially when tce is also set, besides cde is for for read only cd media 
and waitusb=10: is for slow USB flash drives, not HDD's,
also do you really need the showapps boot code??

Something along the lines of this might be better
Code: [Select]
linux /tce/boot/vmlinuz loglevel=3 desktop=icewm tce=UUID="80e39755-27fd-446c-ad02-c7801ff2067f"
Quote
The correct solution was to correctly point to where the core.gz is installed
Exactly, but the grub2 installer is smarter than you give it credit for and can often find kernels when they are located in places it expects to find them. then during update the grub installer may build the correct paths in the conf file.   there are many ways to accomplish this task,  mostly though it's a path issue.   glad you have the system booted.
« Last Edit: April 27, 2014, 01:54:28 AM by coreplayer2 »

Offline keithterrill

  • Newbie
  • *
  • Posts: 16
  • Old Timer with Old Boxes
Re: grub2 lost...
« Reply #6 on: April 27, 2014, 01:39:45 PM »
Rich, yes, the first menuentry was copied from the TCE information file. I started with that and then modified until things began to work. As, I noted in my thank-you that "I am not sure of all that is going on with the commands". The next step for me is to better understand and tweak as I go along.

I am blacklisting because that was in the example. After creating the second menuentry for the FreeDOS I began to wonder if the blacklist was necessary. But, late last night, I was happy just to have it launch and work.

Coreplayer2, thank you for the advice. My APL instructor at Syracuse University used to fond of "expecting a more eloquent code." This suggestion looks like it may meet his approval.

"Mostly though it's a path issue" also reveals that for me specifically it is a lack of knowledge, and a learning curve.

I woke up this morning dreaming of my old Kaypro II and CP/m system. However, unlike pulling out those old boxes (I have them still along with some TRS-80's) the Linux has future promise.

Also, off topic, I once was a Borland and JRT Pascal programmer on the old CP/m systems, and then ms-DOS. I am intrigued by the Free Pascal that is available. And, I was a Fortran IV programmer on the Data General RDOS and AOS systems. That also may be fun. I do not know if there is any future promise there, though.

Again, thank-you all.
Keith L Terrill

Offline keithterrill

  • Newbie
  • *
  • Posts: 16
  • Old Timer with Old Boxes
Re: grub2 lost...
« Reply #7 on: April 27, 2014, 08:58:21 PM »
coreplayer2, I implemented your suggested change. That works. Of course, you knew it would.

Thank-you.

Keith L Terrill
Keith L Terrill