bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross installation of GRUB


From: Stephen Liu
Subject: Re: Cross installation of GRUB
Date: Wed, 10 May 2006 20:01:27 +0800 (CST)

Hi adrian15,

Tks for your advice

> Reread my howto and you will see that in this step it is read:
> setup (hd1) and not setup (hd1,0).

Where is the howto located?


Reinstalled the pendrive;

# fdisk /dev/sdb
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1017, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1017, default 1017): +50M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (402-1017, default 402):
Using default value 402
Last cylinder or +size or +sizeM or +sizeK (402-1017, default 1017):
Using default value 1017

Command (m for help): p
Disk /dev/sdb: 127 MB, 127139840 bytes
4 heads, 61 sectors/track, 1017 cylinders
Units = cylinders of 244 * 512 = 124928 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         401       48891+  83  Linux
/dev/sdb2             402        1017       75152   83  Linux

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.


# mkfs.ext2 /dev/sdb1
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
12240 inodes, 48888 blocks
2444 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=50069504
6 block groups
8192 blocks per group, 8192 fragments per group
2040 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.


# mkfs.ext2 /dev/sdb2
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
18800 inodes, 75152 blocks
3757 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
10 block groups
8192 blocks per group, 8192 fragments per group
1880 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.


FC5_64
======

# mount /dev/sdb1 /mnt/
# mkdir /mnt/boot
# mkdir /mnt/boot/grub
# cp /boot/grub/stage1 /mnt/boot/grub/
# cp /boot/grub/stage2 /mnt/boot/grub/
# cp /boot/grub/*stage1_5 /mnt/boot/grub/
# cp /boot/grub/grub.conf /mnt/boot/grub/menu.lst
# ls -l /mnt/boot/grub/
total 192
-rw-r--r-- 1 root root   7456 May 10 16:14 e2fs_stage1_5
-rw-r--r-- 1 root root   7328 May 10 16:14 fat_stage1_5
-rw-r--r-- 1 root root   6592 May 10 16:15 ffs_stage1_5
-rw-r--r-- 1 root root   6592 May 10 16:15 iso9660_stage1_5
-rw-r--r-- 1 root root   8032 May 10 16:15 jfs_stage1_5
-rw------- 1 root root    753 May 10 16:22 menu.lst
-rw-r--r-- 1 root root   6752 May 10 16:15 minix_stage1_5
-rw-r--r-- 1 root root   9056 May 10 16:15 reiserfs_stage1_5
-rw-r--r-- 1 root root    512 May 10 16:12 stage1
-rw-r--r-- 1 root root 102332 May 10 16:12 stage2
-rw-r--r-- 1 root root   6944 May 10 16:15 ufs2_stage1_5
-rw-r--r-- 1 root root   6144 May 10 16:15 vstafs_stage1_5
-rw-r--r-- 1 root root   8768 May 10 16:15 xfs_stage1_5
* End *


# echo abc > /mnt/myusb
# umount /mnt/
# grub
Probing devices to guess BIOS drives. This may take a long time.

    GNU GRUB  version 0.97  (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> find /myusb
find /myusb
 (hd1,0)
grub> root (hd1,0)
root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83
grub> setup (hd1)
setup (hd1)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd1)"...  15 sectors are
embedded.
succeeded
 Running "install /boot/grub/stage1 (hd1) (hd1)1+15 p
(hd1,0)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded
Done.
grub> quit
quit
#

# qemu -boot c -hda /dev/sdb
It prompted a "QEMU" window;
......
grub>
* End *

Something unexpected here.  The mouse point disappeared compelling me
to switch to "runlevel 3" and run "shutdown -r now" to reboot the PC.


# cat /mnt/boot/grub/menu.lst
.....
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.16-1.2111_FC5)
        root (hd0,0)
        kernel /vmlinuz-2.6.16-1.2111_FC5 ro root=LABEL=/ rhgb noapic
quiet
        initrd /initrd-2.6.16-1.2111_FC5.img
* End *

Tried editing;
- root (hd1)
- root (hd1,0)
- root (hd1,1)
- commented out "splashimage=(hd0,0)/grub/splash.xpm.gz"
respective.

all without booting the HD.  The pendrive booted with grub prompted
waiting for input.

grub>


What shall I key in herer to boot the HD, /dev/sda

# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux (/boot)
/dev/sda2              14        1734    13823932+  83  Linux (/root)
/dev/sda3            1735        3008    10233405   83  Linux
/dev/sda4            3009        9729    53986432+   5  Extended
/dev/sda5            3009        3262     2040223+  82  Linux swap /
Solaris

Disk /dev/sdb: 127 MB, 127139840 bytes
4 heads, 61 sectors/track, 1017 cylinders
Units = cylinders of 244 * 512 = 124928 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         401       48891+  83  Linux
/dev/sdb2             402        1017       75152   83  Linux


> About the menu.lst... what do you want to do when you do boot it? 

If an OS installed on /dev/sdb2 (pendrive) and I want to boot it, what
shall I enter on the menu.lst.

TIA


B.R.
SL




reply via email to

[Prev in Thread] Current Thread [Next in Thread]