[Top][All Lists]
[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: |
Mon, 8 May 2006 23:24:05 +0800 (CST) |
Hi adrian15,
Sometimes ago I tried to install grub on USB pendrive making it
bootable. Unfortunately the BIOS of the PC failed to find the pendrive
during booting.
Booting options on BIOS
USB HDD
USB ZIP
USB Floppy
etc.
I could not discover the mistakes committed then.
> > How do I install GRUB on the flash and get the correct params for
> the
> > target, without destroying /dev/hda on the installation system?
>
> For instructions on how to install grub on a pendrive,
> please check #6 on:
>
> http://adrian15.raulete.net/grub/tiki-index.php?page=EnFaq
Now according to above URL I made another test as follows;
On FC5_64 PC
============
# fdisk /dev/sdb (USB pendrive)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1023, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1023, default 1023):
+500M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (510-1023, default 510):
Using default value 510
Last cylinder or +size or +sizeM or +sizeK (510-1023, default 1023):
Using default value 1023
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): 6
Changed system type of partition 1 to 6 (FAT16)
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 6
Changed system type of partition 2 to 6 (FAT16)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or
resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
address@hidden ~]# fdisk -l /dev/sdb
Disk /dev/sdb: 1007 MB, 1007419392 bytes
31 heads, 62 sectors/track, 1023 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 509 489118 6 FAT16
/dev/sdb2 510 1023 493954 6 FAT16
# mkfs -t vfat /dev/sdb1
mkfs.vfat 2.11 (12 Mar 2005)
FC5_64
======
# ls -l /boot/
total 7616
-rw-r--r-- 1 root root 57360 Apr 19 17:29 config-2.6.16-1.2096_FC5
-rw-r--r-- 1 root root 57360 May 5 09:29 config-2.6.16-1.2111_FC5
drwxr-xr-x 2 root root 1024 May 8 08:26 grub
-rw-r--r-- 1 root root 1076110 Apr 21 15:53
initrd-2.6.16-1.2096_FC5.img
-rw-r--r-- 1 root root 1076098 May 8 08:26
initrd-2.6.16-1.2111_FC5.img
drwx------ 2 root root 12288 Apr 20 22:54 lost+found
-rw-r--r-- 1 root root 1050658 Apr 19 17:29
System.map-2.6.16-1.2096_FC5
-rw-r--r-- 1 root root 1050351 May 5 09:29
System.map-2.6.16-1.2111_FC5
-rw-r--r-- 1 root root 1681097 Apr 19 17:29 vmlinuz-2.6.16-1.2096_FC5
-rw-r--r-- 1 root root 1680536 May 5 09:29 vmlinuz-2.6.16-1.2111_FC5
address@hidden ~]# ls -l /boot/grub/
total 203
-rw-r--r-- 1 root root 63 Apr 20 15:15 device.map
-rw-r--r-- 1 root root 7456 Apr 20 15:15 e2fs_stage1_5
-rw-r--r-- 1 root root 7328 Apr 20 15:15 fat_stage1_5
-rw-r--r-- 1 root root 6592 Apr 20 15:15 ffs_stage1_5
-rw------- 1 root root 753 May 8 08:26 grub.conf
-rw-r--r-- 1 root root 6592 Apr 20 15:15 iso9660_stage1_5
-rw-r--r-- 1 root root 8032 Apr 20 15:15 jfs_stage1_5
lrwxrwxrwx 1 root root 11 Apr 20 15:15 menu.lst -> ./grub.conf
-rw-r--r-- 1 root root 6752 Apr 20 15:15 minix_stage1_5
-rw-r--r-- 1 root root 9056 Apr 20 15:15 reiserfs_stage1_5
-rw-r--r-- 1 root root 7028 Mar 1 12:41 splash.xpm.gz
-rw-r--r-- 1 root root 512 Apr 20 15:15 stage1
-rw-r--r-- 1 root root 102332 Apr 20 15:15 stage2
-rw-r--r-- 1 root root 6944 Apr 20 15:15 ufs2_stage1_5
-rw-r--r-- 1 root root 6144 Apr 20 15:15 vstafs_stage1_5
-rw-r--r-- 1 root root 8768 Apr 20 15:15 xfs_stage1_5
# 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/grub.conf /mnt/boot/grub/menu.lst
# ls -l /mnt/boot/grub/
total 120
-rwxr-xr-x 1 root root 753 May 8 22:26 menu.lst
-rwxr-xr-x 1 root root 512 May 8 22:24 stage1
-rwxr-xr-x 1 root root 102332 May 8 22:24 stage2
# cat /mnt/boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this
file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda3
# initrd /initrd-version.img
#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
At this juncture I have no idea how to edit this file. Please advise.
TIA
# echo abc > /mnt/myusb
# cd /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 fat, partition type 0x6
grub> setup (hd1,0)
setup (hd1,0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/fat_stage1_5" exists... no
Running "install /boot/grub/stage1 (hd1,0) /boot/grub/stage2 p
/boot/grub/grub.conf "... succeeded
Done.
grub> quit
quit
# ls -l boot/grub/
total 120
-rwxr-xr-x 1 root root 753 May 8 22:26 menu.lst
-rwxr-xr-x 1 root root 512 May 8 22:24 stage1
-rwxr-xr-x 1 root root 102332 May 8 22:24 stage2
Where is /boot/grub/grub.conf ?
Is there any change made after running "setup (hd1,0)"?
TIA
B.R.
SL