How to install grub on USB flash drive?

 
Thread Tools Search this Thread
# 1  
Old 10-14-2010
How to install grub on USB flash drive?

I wanna install grub on my flash drive for rescue usage.
My computer installs winxp, and I have fedora12 installed in vmware. I did like this:

step1: format the flash drive as FAT in winXP.
step2: in fedora12, mount the flash drive on /media/flash
step3: excute the command: grub-install --root-directory=/media/flash --no-floppy /dev/sdb.

in step3, It says: the file /media/flash/boot/grub/stage1 not read correctly. why?

In fact the command has created the flowing files on my flash drive:
.
`-- boot
`-- grub
|-- device.map
|-- e2fs_stage1_5
|-- fat_stage1_5
|-- ffs_stage1_5
|-- iso9660_stage1_5
|-- jfs_stage1_5
|-- minix_stage1_5
|-- reiserfs_stage1_5
|-- stage1
|-- stage2
|-- ufs2_stage1_5
|-- vstafs_stage1_5
`-- xfs_stage1_5

content in device.map is:
(hd0) /dev/sda
(hd1) /dev/sdb

Last edited by vistastar; 10-14-2010 at 11:40 PM..
# 2  
Old 10-15-2010
Quote:
Originally Posted by vistastar
in step3, It says: the file /media/flash/boot/grub/stage1 not read correctly. why?
I find this error message nowhere else on the entire internet but here. What does it actually say?
# 3  
Old 10-15-2010
It says: "/media/flash/boot/grub/stage1 not read correctly."
the same as what I post above.

You can't find it on internet, because my flash drive mounts on /media/flash/, the path is exclusively in my own computer. You can google "stage1 not read correctly" for some information. And they say it is may be the problem of /etc/fstab of /ect/mtab. But I can't find something unordinary in the two files.

Last edited by vistastar; 10-15-2010 at 02:21 AM..
# 4  
Old 10-15-2010
Try --recheck. Not having a real BIOS may cause it to act strangely when detecting the BIOS boot order.

You could also try the GRUB prompt itself.

Code:
grub> root (hd1,1)
grub> setup (hd1)

...being very sure hd1 is the drive you want before you do so.

Last edited by Corona688; 10-15-2010 at 01:56 PM..
# 5  
Old 10-16-2010
I tried this, it says "Error 1: Cannot mount selected partition"

I think may be there are some hiden partition on my flash drive. In addition, the file system on my flash drive is FAT32. And I also tried formatting it as FAT, but it make no difference.

Code:
grub> root (hd1,0)
root (hd1,0)

Error 18: Selected cylinder exceeds maximum supported by BIOS
grub> root (hd1,1)
root (hd1,1)

Error 18: Selected cylinder exceeds maximum supported by BIOS
grub> root (hd1,2)
root (hd1,2)

Error 18: Selected cylinder exceeds maximum supported by BIOS
grub> root (hd1,3)
root (hd1,3)

Error 18: Selected cylinder exceeds maximum supported by BIOS

Code:
grub> geometry (hd1)
geometry (hd1)
drive 0x81: C/H/S = 1019/60/62, The number of sectors = 3792896, /dev/sdb
   Partition num: 0, 
Error 18: Selected cylinder exceeds maximum supported by BIOS
   Partition num: 1, 
Error 18: Selected cylinder exceeds maximum supported by BIOS
   Partition num: 2, 
Error 18: Selected cylinder exceeds maximum supported by BIOS
   Partition num: 3, 
Error 18: Selected cylinder exceeds maximum supported by BIOS

Code:
[root@fedora/home/alien]:)fdisk -l /dev/sdb

Disk /dev/sdb: 1941 MB, 1941962752 bytes
60 heads, 62 sectors/track, 1019 cylinders
Units = cylinders of 3720 * 512 = 1904640 bytes
Disk identifier: 0x6f20736b

This doesn't look like a partition table
Probably you selected the wrong device.

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   ?      209177      516034   570754815+  72  Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(357, 116, 40) logical=(209176, 19, 11)
Partition 1 has different physical/logical endings:
     phys=(357, 32, 45) logical=(516033, 44, 51)
Partition 1 does not end on cylinder boundary.
/dev/sdb2   ?       45347      565785   968014120   65  Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(288, 115, 43) logical=(45346, 38, 47)
Partition 2 has different physical/logical endings:
     phys=(367, 114, 50) logical=(565784, 20, 42)
Partition 2 does not end on cylinder boundary.
/dev/sdb3   ?      502657     1023094   968014096   79  Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
     phys=(366, 32, 33) logical=(502656, 18, 30)
Partition 3 has different physical/logical endings:
     phys=(357, 32, 43) logical=(1023093, 59, 39)
Partition 3 does not end on cylinder boundary.
/dev/sdb4   ?      775721      775736       27749+   d  Unknown
Partition 4 has different physical/logical beginnings (non-Linux?):
     phys=(372, 97, 50) logical=(775720, 44, 25)
Partition 4 has different physical/logical endings:
     phys=(0, 10, 0) logical=(775735, 39, 33)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

I don't think it is a matter of real BIOS or not,because I had successfully installed grub on a kingston flash drive before. But it lost.
I just used the command: grub-install.

Last edited by vistastar; 10-16-2010 at 12:15 AM..
# 6  
Old 10-16-2010
You may have to put it in your fstab, at least temporarily.
# 7  
Old 10-16-2010
I also add to my fstab the fllowing line:

/dev/sdb /media/flash vfat defaults 0 0

but it make no difference. : (

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Usb Flash in SCO UNIX 5.0.6 moein.mojtaba SCO 1 12-15-2016 07:24 AM
In KDE Copy completed not always mean files were copied to USB flash drive - how to fix it? netwalker SuSE 2 09-22-2012 07:41 AM
Repeated corruption running linux on USB flash drive mij Linux 0 04-17-2012 08:45 PM
Can we specify which grub.conf to use in grub-install. successlin Red Hat 4 12-20-2011 10:45 AM
how to increase cylinders on USB Flash Drive Pkumar Sachin UNIX for Advanced & Expert Users 8 09-30-2011 02:27 AM
Installing Solaris 10 x86 from USB flash drive gabam Solaris 2 08-12-2011 10:49 PM
SCO 5.0.5 & USB flash drive jlodata UNIX for Dummies Questions & Answers 0 09-18-2009 12:39 PM
USB flash drive/keyfob will not automount ropers Ubuntu 4 05-27-2009 04:03 AM
removable usb flash drive seyiisq Solaris 26 03-14-2009 07:27 AM
How to Install Linux os from USB pen drive seshumohan Linux 3 12-02-2008 08:33 AM
USB Flash Drives led3234 Filesystems, Disks and Memory 4 05-27-2008 12:13 PM
Does HPUX 10.2 or 11.i support any USB flash drive? jkend12 UNIX for Dummies Questions & Answers 0 04-01-2008 11:15 PM
mounting USB floppy drive /Flash drive in OSR 6.0 sureshdrajan SCO 5 02-29-2008 12:36 PM
USB flash drive is not mounting what to do...? manoranjan UNIX for Dummies Questions & Answers 5 12-21-2006 12:34 PM
USB flash Drive vr76413 Solaris 4 11-14-2006 11:04 PM