Results 1 to 3 of 3

Thread: bash question: howto run a command after chrooting?

  1. #1
    Join Date
    Jun 2009
    Beans
    329
    Distro
    Ubuntu 11.04 Natty Narwhal

    bash question: howto run a command after chrooting?

    i was trying to make a script that i believe will help many people- it is a bash script that will automate (ok, only kind of...) the process of chrooting and then reinstalling grub.

    i have the script on my website here:
    http://mrclark.ath.cx/linux/scripts/grubfix

    as you can see, i canceled (#)the part that was supposed to happen after chrooting. i tested the script myself, and noticed that it just dropped me at a chrooted terminal.

    if you find any other problems with my script, please let me know.

    could someone tell me how to do this?
    always learning more every day.
    this is the best tech community i have ever known.

  2. #2
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,294
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: bash question: howto run a command after chrooting?

    There's no need to chroot to reinstall GRUB, just use --root-directory.
    「明後日の夕方には帰ってるからね。」


  3. #3
    Join Date
    Jun 2009
    Beans
    329
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: bash question: howto run a command after chrooting?

    sorry to bring an old thread back, but i have one more question.


    does grub generate a new grub.cfg (or menu.lst) when it is installed?

    i have (finally) updated the script, and it seems to work. i just don't know if i need to run "update-grub". i tried putting it in the script, but it looks like you must run it after chrooting. i couldn't get it to work.

    any suggestions?
    always learning more every day.
    this is the best tech community i have ever known.

Bookmarks

Posting Permissions

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