Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm new to Linux, am using CentOS 6.3, and am attempting to install CentOS 5.8 ISO to a pen drive following instructions from here.

My pen drive is /dev/sda and partition 1 is vfat. It's mounted on /mnt/usb. Here's what happens when I try to use grub-install:

[root@localhost ~]# grub-install –root-directory=/mnt/usb /dev/sda

More than one install_devices?
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.

-h, --help
       print this message and exit

-v, --version
       print the version information and exit

--root-directory=DIR
       install GRUB images under the directory DIR instead of the root directory

--grub-shell=FILE
       use FILE as the grub shell

--no-floppy
       do not probe any floppy drive

--force-lba
       force GRUB to use LBA mode even for a buggy BIOS

--recheck
       probe a device map even if it already exists
       This flag is unreliable and its use is strongly discouraged.

 INSTALL_DEVICE can be a GRUB device name or a system device filename.

 grub-install copies GRUB images into the DIR/boot directory specfied by --root-directory, and uses the grub shell to install grub into the boot sector.

I don't understand the error message in this context, What am I doing wrong?

share|improve this question
add comment

1 Answer

The problem is that you are copying the commands directly from the webpage and this results in your pasting an em dash (—) instead of two consecutive minus signs (--) which is what you need to use. All long (--foo-bar) options in *nix are given with two consecutive minus signs. So, try this:

grub-install --boot-directory=/mnt/usb /dev/sda

Note the difference between –boot-directory and --boot-directory.

share|improve this answer
    
Got the same error message. The grub I have is version 0.97. How do I install grub2 if this version is not grub2? –  Nate Lockwood Jan 30 '13 at 19:42
    
I chose Centos because I need to install an Advanced Silicon frame grabber and their driver, which I need to install, needs to be installed under SUSE or Redhat and kernel 2.6. The instructions from the vendor broke under Centos 6.3 and I was advised by someone who maintains several Centos machines to fall back to Centos 5.8. I had used Ubuntu bucause of its ease of installation. –  Nate Lockwood Jan 30 '13 at 19:53
    
Personally, @Nate, I would recommend SUSE (or, even better, openSUSE). It will make your life easier. Anyway, have a look at my updated answer, I figured out what was going on. –  terdon Jan 30 '13 at 20:21
    
There should have been a double dash for the option. It may have run correctly and gave me this: This is the contents of the device map /mnt/usb/boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'. (fd0) /dev/fd0 (hd0) /dev/sda (pen-drive) (hd1) /dev/sdb (internal SDD boot} (hd2) /dev/sdc –  Nate Lockwood Jan 30 '13 at 20:27
    
Thanks, our comments are crossing in cyberspace. I need the source code to install the driver and I understood that for SUSE the code must be purchased on a CD and the instructions are in German. If that's not true I'll try it! I'm distro agnostic (or ignorent). –  Nate Lockwood Jan 30 '13 at 20:34
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.