Can't install GRUB to HDD, no floppy.

Booting, installing, newbie
Message
Author
Menel
Posts: 20
Joined: Thu 29 Sep 2005, 18:40

Can't install GRUB to HDD, no floppy.

#1 Post by Menel »

When I run the HDD install script it keeps wanting to make a bootable floppy disk. Everytime it tries to access the floppy drive on this computer or the other computers in my lab here at school it craps out. It finishes formatting but fails during verify.

So I need to do it manually. I copied the 3 files according to the "old instructions" but then it says to mount where I have /boot/grub partition. I don't know where that partition is or where those files are. So I looked around on the internet and found some instructions. I typed grub at the terminal prompt and tried to do a root (hd0,0) and a setup(hd0) but then it cannot find stage1? whatever that is.

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#2 Post by rarsa »

From within Puppy execute the following command in an rxvt terminal (The parameter is a lowercase L):

Code: Select all

fdisk -l
and paste the results. That will tell us what partitions you have so we can help you.

Menel
Posts: 20
Joined: Thu 29 Sep 2005, 18:40

#3 Post by Menel »

Certainly, I get this:

Code: Select all

# fdisk -l

Disk /dev/hdd: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1   *           1        2434    19551073+  83  Linux

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#4 Post by rarsa »

Try with root (hd3,0) and a setup(hd3).

You sure have a weird HDD setup. It looks as if your hard drive is connected to the secondary ide as a slave.

If you ever get around fixing your cables and connect the HDD to the primary ide as a master, you will have to change the root and setup to point to hda1.

User avatar
Ian
Official Dog Handler
Posts: 1234
Joined: Wed 04 May 2005, 12:00
Location: Queensland

#5 Post by Ian »

What rasa says is right, you should shut down your machine and remove the hard drive. Have a look at the jumper settings on the end of the hard drive and set the jumper to 'Master' and after you identify the primary IDE cable connect the hard drive to it.

If you reboot and run fdisk -l again you should see your hard drive as /dev/hda1 then follow rasa's instructions.

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#6 Post by rarsa »

Ian, I consciously didn't recommend changing the cabling.

There must be a reazon for such a weird set-up. Maybe the primary ide is broken or there is a BIOS issue, or who knows. Been there done that.

My guess is that the CD is the master on the secondary IDE and the HDD is the slave.

I think that just seting up grub to hdd1 will work without having to open the computer. root(hd3,0) setup (hd3).

Guest

#7 Post by Guest »

Oh jeez, now you've all done it and I have to justify my setup :(

Its an insane project :( The robotic autonomous sub team uses a PC104 stack running Puppy Linux. Professor wants to use the same system for the land based robotic system which I am in charge of Central Control of. Except we get the old reject/backup PC104 stack that has had many components nad documentation bits lost...etc etc. Nightmare for me basically.

The PC104 stack has only one IDE channel and there is a IDE -> CF adapter there with a 320MB drive. It has a connection for a slave drive, but ATAPI devices don't work there, I don't have the floppy drive adapter, and its so old it can't boot to USB for a usb floppy, usb cdrom adapter, usb key.

Now to cabling reason. In order to get Puppy on this thing I have very limited options. So I brought the old 20GB drive to my school and opened up one of their computers and all the cables are bundled tight. There is a WinXP drive on the Primary MAster and the primary slave is bundled up real tight. And there is a cdrom on the Secondary MAster that I need to boot the Puppy Live CD. And the Secondary Slave connector was in a real convenient place to locate the harddrive while I setup uppy to boot on it.

My plan was to hopefully get the ability to boot to this harddrive. Then plug it into the PC104 stack as slave and boot to it and install puppy using that installtion to the CF card.

Nightmare :(

So it sounds like when I get grub installed I'll have to change its boot setting to boot from Primary Slave.. to get it to boot when plugged into the PC104 board and then once its installed to the CF/IDE card on the PC104 will be finally booting normal on a Primary Master....

uggh.

Menel
Posts: 20
Joined: Thu 29 Sep 2005, 18:40

#8 Post by Menel »

---^ that was me.

So when you say once I install GRUB using setup(hd3) do I just need to then change its grub.conf file to hdb1 to get it to boot from primary slave? and then when mirrored or installed over to the CF set to hda1 ?

keenerd
Posts: 176
Joined: Sat 20 Aug 2005, 19:24

#9 Post by keenerd »

Why not just install the CD/IDE module in another computer, install Puppy on it, and swap it back to the sub?

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#10 Post by rarsa »

Now that it's clear what you are doing, Here is my advice:

Before you move the cables around:
- When installing grub, use
root (hd3,0) <--- This corresponds to hdd partition 1
setup (hd3) <--- This corresponds to hdd

- In grub.conf you need to use the following

title Puppy Linux
root (hd3,0)
kernel /boot/vmlinuz root=/dev/hdd1

That should boot to puppy on hdd. I'd be surprised if it does not.

If you fix your cabling
- Start the Live CD
- Open an rxvt console
- Verify the device name for your hdd with fdisk -l
- Execute grub. In grub execute the root and setup commands using the appropriate device/partition name.
So, if fdisk-l shows that the device is hda1 then use setup (hd0,0), if it shows hdb1 then use setup (hd1,0) etc.

Menel
Posts: 20
Joined: Thu 29 Sep 2005, 18:40

#11 Post by Menel »

keenerd wrote:Why not just install the CD/IDE module in another computer, install Puppy on it, and swap it back to the sub?
The CF/IDE module thingy is surface mount and not removeable from the PC/104 board. The CF modules is, but not its IDE adapter. I guess I could always buy some new hardware...but I would really prefer not.
rarsa wrote:Now that it's clear what you are doing, Here is my advice:

Before you move the cables around:
- When installing grub, use
root (hd3,0) <--- This corresponds to hdd partition 1
setup (hd3) <--- This corresponds to hdd

- In grub.conf you need to use the following

title Puppy Linux
root (hd3,0)
kernel /boot/vmlinuz root=/dev/hdd1

That should boot to puppy on hdd. I'd be surprised if it does not.

If you fix your cabling
- Start the Live CD
- Open an rxvt console
- Verify the device name for your hdd with fdisk -l
- Execute grub. In grub execute the root and setup commands using the appropriate device/partition name.
So, if fdisk-l shows that the device is hda1 then use setup (hd0,0), if it shows hdb1 then use setup (hd1,0) etc.
LOL the cabling is not per set and will not necessarily ever be "fixed" since it is only temporarily connected to this PC in order to prep it to be connected to the PC/104 board. And it will only be connected to the PC104 board long enough for me to boot and perform this entier procedure on its CF card in the Primary Master position.

So what I don't understand is the commands then. If the setup (hd0,0) is telling grub where the device will be when its booted from, what is telling Grub where to install itself to?

What im trying to accomplish is to setup grub now in this computer as the Secondary Slave, and then move it over to the PC/104 board and boot it in the Primary slave position. So which part of the command is telling GRUB where to install to and which part is telling GRUB where it will be booting from?

Ah lightbulb just went off in my head. I'll have to cut some cable ties in the school computer but if I put this harddrive in the primary slave position just like it will be in the PC104 board then I'll likely make this much easier on myself!

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#12 Post by rarsa »

So what I don't understand is the commands then. If the setup (hd0,0) is telling grub where the device will be when its booted from, what is telling Grub where to install itself to?
Here is the explanation of each instruction

When you setup grub:
root (hd3,0) --> Tells grub where to find the stage files.
setup (hd3) --> Tells grub where to install itself to the MBR

Once grub starts, here is the meaning of the lines in the grub.conf:
title Puppy Linux ---> It is the menu entry that will show on the grub menu
root (hd3,0) ---> Tells grub what partition contains the kernel
kernel /boot/vmlinuz root=/dev/hdd1 --> Tells grub the kernel file name and the location of the root partition.

I hope it was clear.

If you are going to be moving this HDD to be a master in a primary partition, you don't need to reinstall grub as it is already installed in the correct MBR.

Just change the grub.conf file to the following before unplugging the HDD.

title Puppy Linux menu
root (hd0,0)
kernel /boot/vmlinuz root=/dev/hda1


that's it.

Menel
Posts: 20
Joined: Thu 29 Sep 2005, 18:40

#13 Post by Menel »

Today I also have my USB key attached, it has my pup001 file so it will remember all my configs for everytime I reboot.

I decided I wanted to start on a new fresh clean drive so first I used cfdisk to wipe the parition, rebooted the computer, created a new one using cfdisk, it defaulted to type: linux so I kept that seeting, I toggled on the bootable, and hit [write]. It seemed to write successfully. Then I used the following command to format the partition:
mkfs -t ext2 /dev/hdd1

Then I mounted the new partition hdd1 and copied over image.gz, user_cram.fs and vmlinuz into /mnt/data where it said that hdd1 was mounted.

Then I went to the rxvt terminal:

Code: Select all

# fdisk -l

Disk /dev/sda: 1037 MB, 1037615104 bytes
255 heads, 63 sectors/track, 126 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         126     1012063+   6  FAT16

Disk /dev/hdd: 20.0 GB, 20020396032 bytes
16 heads, 63 sectors/track, 38792 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1   *           1         581      292792+  83  Linux
# 
Then:

Code: Select all

    GNU GRUB  version 0.96  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub> root (hd3,0)

Error 21: Selected disk does not exist

grub> root (hd
 Possible disks are:  hd0 hd1

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83

grub> root (hd1,0)
 Filesystem type is fat, partition type 0x6

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0,0)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... no

Error 15: File not found

grub> 
As you can see, hd1 that is a fat partition must be my little USB stick. And the only other harddrive attached must be HD0 the ext2 formatted partition I created. But it doesn't seem to work. I'm still lost.

I'm on campus again today and will be working on this project on and off until 6pm EST, maybe later. I also created a directory on the partition named boot and put the 3 files in it and tried grub again, with no success.

HELP! :(

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#14 Post by rarsa »

woow, Now it's clear, you are doing a type 1 installation (just copying the files from the CD).

What I was explaining was a type 2 installation, where it creates the directories in the HDD.

Of course in your HDD you don't have a /boot directory, that's why it's not finding anything.

I have another comment. The setup command only needs the drive, not the partition

Setup (hd0)

I haven't used grub with a type 1 installation, I will investigate and let you know.

Bruce B

#15 Post by Bruce B »

Just to validate a few things:

GRUB sees the hard disk as hd0 and your newly created linux partition as hd0,0

GRUB is giving you the answer (in part), (hd0,0)/boot/grub/stage1 actually does not exist.

If you are booting from the default Puppy floppy disk, an install attempt won't work because there are not the files necessary to install grub from that that floppy disk.

It's not going to boot as I'm sure you have deduced. :(

I've trying to understand precisely what you want.
  • * You want grub to boot automatically from the hard disk
    * You want an option 1 install on the hard disk
It this is true you might try the following:
  • Pull the USB stick if it is easy - I should think so

    Boot Puppy from CD disc and do not let it install or mount anything on the hard disk. (on ver 1.04 it is the F3 key I think, or the 3 key)

    Then install with Option 2, because it won't force you to make a floppy disk, and more importantly, it gives you the GRUB install option.

    Let it install GRUB to the MBR.
If all goes well you will have a self booting Option 2 Puppy. If you don't want an Option 2 Puppy then delete all the directories, except /lost+found and /boot.

In order to delete them you will want to boot with CD disc and mount the partition manually.

--------------

Then

You can copy usr_cram.fs, image.gz to the the hard disk. I recommend putting image.gz in /boot with vmlinux and usr_cram.fs on /
  • You will have to modify menu.lst along these lines:

    title Puppy on hdd1
    kernel (hd0,0)/boot/vmlinuz root=/dev/ram PFILE=pup001-none-512288 PHOME=hdd1 vga=normal
    initrd (hd0,0)/boot/image.gz
The reason I recommended pulling the USB stick is so not to confuse the Puppy GRUB install. I've found that the simplier the setup the more likely it will install successfully.

Bruce B

#16 Post by Bruce B »

rarsa wrote:I haven't used grub with a type 1 installation, I will investigate and let you know.
rasa, it works fine, really fine. what I don't do much of if any at all, is boot from floppy or cd disc.

I recently made a option 1 install of version 1.05 without even burning a cd disc. I extracted the necessary files from the .iso and added a grub menu item for it

Guest

#17 Post by Guest »

Wow Bruce!, the installation finally worked, no errors, and setup. When it got to making the menu.lst file it said file not found ....and never seemed to complete the script..

I rebooted and it said Operating Ssystem failure when I tried to boot to drive....looking back over procedure and trying again. Will report back

Thanks everyone!!!

Menel
Posts: 20
Joined: Thu 29 Sep 2005, 18:40

#18 Post by Menel »

I went back through the procedure fresh and it works, completed the script and everything. When I tried to boot it gave an error about could not locate usr_cram.fs. I'm gonna look into it now (I put it in /boot/ and not in just /). So excited ^_^

Menel
Posts: 20
Joined: Thu 29 Sep 2005, 18:40

#19 Post by Menel »

I put the newly installed harddrive in the Primary Slave position on our PC/104 stack. I changed the menu.lst file appropriately to get it to boot in this new position.

Now I need to partition and format the CF device. Problem, when I run the install to hardrive script it asks for the CDROM. There is no CDROM capability of this PC104 board. I need toby pass that step and pull from hdb1 :(

I have an idea, if I copy all files from that harddrive to this CF card and then rerun the GRUB installer......maybe that will work?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#20 Post by MU »

save this file to /usr/sbin/installfuncs (overwrite existing file)

http://noforum.de/tests/installfuncs

Make it executable:
chmod 755 /usr/sbin/installfuncs

Edit line 64-68 in beaver so that they point to the files on your harddrive:

Code: Select all

cp -f /mnt/home/puppylinux1.0.5/vmlinuz ${DESTDIR}/  #/root/tmp
sync
 cp -f /mnt/home/puppylinux1.0.5/image.gz ${DESTDIR}/  #/root/tmp
 cp -f /mnt/home/usr_cram.fs ${DESTDIR}/  #/root/tmp/
Now the setup-script will not look for the CD, but take those files from your harddrive :)

Mark

Post Reply