Results 1 to 6 of 6

Thread: Trying to restore Grub boot loader using chroot

  1. #1
    Junior Member registered user
    Join Date
    Dec 2005
    Location
    Oulu, Finland
    Posts
    11

    Trying to restore Grub boot loader using chroot

    In the book by Kyle Rankin: Knoppix - Pocket Reference on page 38 there is described how I could get my system starting by using the grub-configuration of Suse 10.2 installed earlyer and erroneously overwritten. However, I can not do that while running Knoppix 5.1:

    First succesfully
    Code:
    knoppix@1[knoppix]$ sudo chroot /mnt/hdb3 grub-install /dev/hdb
    But then
    Code:
    knoppix@1[knoppix]$ sudo chroot /mnt/hdb3 grub-install /dev/hdb
    /dev/hdb: Not found or not a block device.
    knoppix@1[knoppix]$ ls /dev/hdb
    /dev/hdb
    knoppix@1[knoppix]$
    What is wrong

    I have beem able to copy the /boot/grub/menu.lst for ex. to a floppy but can not put it into the right place although I try all of the shell command I know

  2. #2
    Senior Member registered user
    Join Date
    Apr 2005
    Posts
    159
    What do you mean by "1st successfully", then...what? I don't see any difference between your two command lines.
    Do you mean it worked once, then failed on later invocations?

    Anyway, hdb would be the primary slave IDE disk, is this really the one you're trying to boot from?
    If so, assumming /dev/hdb3 is mounted on /mnt/hdb3 (recent versions of knoppix would rather use /media/hdb3, btw)
    then, from a root console (say <Alt><F1> from the live CD), try
    # grub-install --root-directory /mnt/hdb3 /dev/hdb
    this will re-install the grub modules to /mnt/hdb3/boot/grub, and install grub in the MBR of hdb

  3. #3
    Junior Member registered user
    Join Date
    Dec 2005
    Location
    Oulu, Finland
    Posts
    11
    Quote Originally Posted by kirol
    What do you mean by "1st successfully"
    Sorry, I have to translate my thoughts from Finnish to English and the result is ...
    This is what happened:
    Code:
    knoppix@1[knoppix]$ sudo chroot /mnt/hdb3 grub-install /dev/hdb
    knoppix@1[knoppix]$
    In the Unix and Linux word, if the Shell does not protest, everything is O.K. (or not O.K.)

    Thank you for your kind advice. I try to proceed

  4. #4
    Junior Member registered user
    Join Date
    Dec 2005
    Location
    Oulu, Finland
    Posts
    11
    I am sorry but I became confused when trying to follow the advice in the "Knoppix Pocket Reference" by Kyle Rankin. The version of Knoppix I have is 5.1. Perhaps I should use an older like 5.0?
    My problem is that I can not get Suse 10.2 to start. It's root directory (/) is on partition hdb3 and there are two other Linuxes on the same hdb, one of them starting. On hda I have WindowsXP and MBR is propably there.

    All this is a bit difficult for me - sorry
    The list hopefully tells what I was trying to do:


    Code:
    knoppix@1[knoppix]$ ls -l /mnt/hdb3
    lrwxrwxrwx 1 root root 11 Jan  6 20:32 /mnt/hdb3 -> /media/hdb3
    knoppix@1[knoppix]$ ls -l /media/hdb3
    total 0
    knoppix@1[knoppix]$ sudo mount -o /dev/hdb3  /mnt/hdb3
    mount: wrong fs type, bad option, bad superblock on /dev/hdb3,
           missing codepage or other error
           In some cases useful info is found in syslog - try
           dmesg | tail  or so
    
    knoppix@1[knoppix]$ sudo mount -o /media/hdb3  /mnt/hdb3
    mount: wrong fs type, bad option, bad superblock on /dev/hdb3,
           missing codepage or other error
           In some cases useful info is found in syslog - try
           dmesg | tail  or so
    
    knoppix@1[knoppix]$ sudo grub-install --root-directory /mnt/hdb3 /dev/hda
    Unrecognized option `--root-directory'
    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
    
    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.
    
    Report bugs to <bug-grub@gnu.org>.
    knoppix@1[knoppix]$

  5. #5
    Senior Member registered user
    Join Date
    Apr 2005
    Posts
    159
    knoppix@1[knoppix]$ sudo grub-install --root-directory /mnt/hdb3 /dev/hda
    Unrecognized option `--root-directory'
    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

    knoppix@1[knoppix]$
    Sorry my bad - I wasn't under linux when replying, and should have double checked the grub syntax (I forgot the equal sign).
    Try
    # mount /media/hdb3
    Then
    # grub-install --root-directory=/media/hdb3 /dev/hda

  6. #6
    Junior Member registered user
    Join Date
    Dec 2005
    Location
    Oulu, Finland
    Posts
    11
    Thank you, now it seems to work :D
    If not, I will report. What I did follows:
    Code:
    knoppix@1[knoppix]$ sudo mount  /media/hdb3
    knoppix@1[knoppix]$ sudo grub-install --root-directory=/media/hdb3  /dev/hda
    Due to a bug in xfs_freeze, the following command might produce a segmentation
    fault when /media/hdb3/boot/grub is not in an XFS filesystem. This error is harmless and
    can be ignored.
    xfs_freeze: specified file ["/media/hdb3/boot/grub"] is not on an XFS filesystem
    Installation finished. No error reported.
    This is the contents of the device map /media/hdb3/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'.
    
    (hd1)   /dev/hdb
    (fd0)   /dev/fd0
    (hd2)   /dev/sda
    (hd0)   /dev/hda
    knoppix@1[knoppix]$

Similar Threads

  1. Boot loader problem with XP Pro/Knoppix Dual boot
    By destro in forum MS Windows & New to Linux
    Replies: 4
    Last Post: 04-01-2007, 11:08 PM
  2. grub boot loader read the boot file from a windows partition
    By cli168 in forum Hdd Install / Debian / Apt
    Replies: 3
    Last Post: 06-20-2005, 03:57 AM
  3. Grub boot loader not finding ipod
    By killem in forum Hardware & Booting
    Replies: 0
    Last Post: 06-17-2005, 06:45 AM
  4. Lilo loader failed to install...now how to load from GRUB>
    By nxumdon in forum Hdd Install / Debian / Apt
    Replies: 1
    Last Post: 01-22-2004, 03:38 AM
  5. Grub loader question
    By iamanewbie in forum Hdd Install / Debian / Apt
    Replies: 5
    Last Post: 10-24-2003, 12:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G picture

A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G

$13.99



Samsung 16GB 2Rx4 PC4-2133P DDR4-17000 1.2V RDIMM ECC Registered Server Memory picture

Samsung 16GB 2Rx4 PC4-2133P DDR4-17000 1.2V RDIMM ECC Registered Server Memory

$16.29



HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin picture

HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin

$12.90



Samsung  8 GB PC4-17000 DDR4-2133 1Rx8 DDR4 Desktop Memory HP P/N  798034-001 picture

Samsung 8 GB PC4-17000 DDR4-2133 1Rx8 DDR4 Desktop Memory HP P/N 798034-001

$10.00



A-Tech 8GB PC3-12800 Desktop DDR3 1600 MHz Non ECC 240-Pin DIMM Memory RAM 1x 8G picture

A-Tech 8GB PC3-12800 Desktop DDR3 1600 MHz Non ECC 240-Pin DIMM Memory RAM 1x 8G

$13.99



A-Tech 16GB 2 x 8GB PC3-12800 Laptop SODIMM DDR3 1600 Memory RAM PC3L 16G DDR3L picture

A-Tech 16GB 2 x 8GB PC3-12800 Laptop SODIMM DDR3 1600 Memory RAM PC3L 16G DDR3L

$27.98



Kingston HyperX FURY DDR3 8GB 16GB 32G 1600 1866 1333 Desktop Memory RAM DIMM picture

Kingston HyperX FURY DDR3 8GB 16GB 32G 1600 1866 1333 Desktop Memory RAM DIMM

$13.25



32GB (4X8GB) DDR3 PC3-12800 1600 NON ECC LOW DENSITY MEMORY F3-12800CL10Q-32GBXL picture

32GB (4X8GB) DDR3 PC3-12800 1600 NON ECC LOW DENSITY MEMORY F3-12800CL10Q-32GBXL

$32.00



A-Tech 256GB 4x 64GB 4Rx4 PC4-19200 ECC Load Reduced LRDIMM Server Memory RAM picture

A-Tech 256GB 4x 64GB 4Rx4 PC4-19200 ECC Load Reduced LRDIMM Server Memory RAM

$287.96



A-Tech 64GB 4x 16GB 2Rx4 PC4-17000R DDR4 2133MHz ECC REG RDIMM Server Memory RAM picture

A-Tech 64GB 4x 16GB 2Rx4 PC4-17000R DDR4 2133MHz ECC REG RDIMM Server Memory RAM

$87.96