Announcement

Collapse
No announcement yet.

GRUB 2: A Guide for Users

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #46
    Re: GRUB 2: Another update

    Updates
    Added to Reply #1: Dual booting, Windows on non-first HDD

    Dual booting: How to set it up
    Installing two or more Linux operating systems
    RECOMMENDED METHOD
    PROBLEMS
    Messing up the booting -- fixing GRUB without re-installing Kubuntu
    Windows topics
    Installing XP (or 7? or Vista?) & Kubuntu:
    How to set up dual booting (recommended outline)
    Re-installed XP and now can't boot Kubuntu
    XP on a non-first hard drive: (hdx,y), x > 1

    Booting XP on a non-first hard drive
    The drivemap command in GRUB 2



    @MoonRise
    Thanks for that info about how GRUB 2 automatically configured Windows on non-first hard drive (drivemap command in grub.cfg). Good to know. In fact, one could try running
    grub-mkconfig
    and/or
    grub-install
    and see if that might work to generate the proper boot entries for Windows on a non-first HD before going to all the work to do it manually.

    Good tip -- thanks again!
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #47
      Re: GRUB 2: Another update

      Originally posted by Qqmike
      @MoonRise
      Thanks for that info about how GRUB 2 automatically configured Windows on non-first hard drive (drivemap command in grub.cfg). Good to know. In fact, one could try running
      grub-mkconfig
      and/or
      grub-install
      and see if that might work to generate the proper boot entries for Windows on a non-first HD before going to all the work to do it manually.

      Good tip -- thanks again!
      It definitely tries. At least to detect other Linuxes. On my USB install, it detected the Kubuntu on an SDHC and the Ubuntu on the SSD (I didn't try to load those, and the USB drive had a corruption on the partition table so I can't test it quickly).

      Comment


        #48
        Re: GRUB 2: A Guide for Users

        There is a function that I loved in MacOS (not sure if OSX has it... Never tried!). Back in the days of PowerMac's etc. I used to have at least one external harddrive with a separate OS installation. This way, I could use the control panel to tell the system what harddrive to boot from next time. Of course, it was SCSI then, not USB or eSATA.

        I am wondering if it would be possible to install a distro to a USB drive, and then use the UUID in the boot menu so it does not matter what USB port I plug it into, or how many other USB devices that are plugged in? That mean I could have a couple of extra harddrives just for testing other distros. I do have VirtualBox installed, but I think it is better to have a full installation of the OS to really get a feel for it.

        Any thoughts on this? Will an installer allow you to install on a USB drive?
        Regards,
        Oceanwatcher
        Blog: http://www.wisnaes.com/
        Pictures: http://www.oceanwatcher.com/
        Software tips (in Norwegian): http://www.datahverdag.com/

        Comment


          #49
          Re: GRUB 2: A Guide for Users

          Originally posted by Oceanwatcher
          There is a function that I loved in MacOS (not sure if OSX has it... Never tried!). Back in the days of PowerMac's etc. I used to have at least one external harddrive with a separate OS installation. This way, I could use the control panel to tell the system what harddrive to boot from next time. Of course, it was SCSI then, not USB or eSATA.

          I am wondering if it would be possible to install a distro to a USB drive, and then use the UUID in the boot menu so it does not matter what USB port I plug it into, or how many other USB devices that are plugged in? That mean I could have a couple of extra harddrives just for testing other distros. I do have VirtualBox installed, but I think it is better to have a full installation of the OS to really get a feel for it.

          Any thoughts on this? Will an installer allow you to install on a USB drive?
          Yes, you can definitely install onto a usb drive, which is slow as hell (particularly the writes), unless you buy a really expensive, performance drive. Grubn (at least legacy) can use the disk UUID when you specify the root filesystem. The only connection dependent thing (Qqmike, pls correct me if I am wrong) is the specification of the boot partition, which is of hte form (hd1,0). But that, you can edit the grub entry and try the only few combinations (hd0,0), (hd1,0), etc

          In fact, a much easier way is to install a bootloader in the usb drive, and just boot from there. Most mobo's these days have a special key to press at boot time, which will show you a menu of existing drives, and choose where to boot from. On the Dell Mini you press 0. Actually, there is a message indicating that, while the BIOS is being loading on start up.

          Hope this helps!

          Comment


            #50
            Re: GRUB 2: A Guide for Users

            I did some experiments once, and as I recall, a given USB flash drive got assigned a UUID that stayed fixed and stayed with that flash drive, no matter what. You might try a few simple experiments to see how exactly it works.

            Yes you can install a full Kubuntu to a USB flash drive. When the PC boots from the flash drive, it is, of course, seen as hd0 and your other drives get shifted. So hd0 becomes hd1, hd1 becomes hd2, etc. (Unless adrian 15 develops a usbshift function for GRUB 2 Super Grub Disk--which he may very well do soon). Thus, if you also want to use the grub.cfg on that flash drive to boot other OSs, you must take this drive shifting into account. There's a lot of this (good ) stuff in another of my how-to's and the Replies to it:

            -- How To Make GRUB Thumb Drive
            http://kubuntuforums.net/forums/inde...opic=3081748.0

            You might use ext2 to minimize wearout of the flash drive (though I've never read of anyone having that problem, it is possible over time). As a backup, I always clone a flash drive using dd.
            For that, another how-to
            -- dd Command
            http://kubuntuforums.net/forums/inde...opic=3090824.0
            See the Experiments in reply 1.

            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

            Comment


              #51
              Re: GRUB 2: A Guide for Users

              Never have had issues with my USB drive installs. They do come in handy!

              Comment


                #52
                Re: GRUB 2: A Guide for Users

                One of my links/references is
                Grub 2 Basics, by drs305
                http://ubuntuforums.org/showthread.php?t=1195275
                It focuses on the grub.cfg.

                The name has just been changed to
                The Grub 2 Guide
                Looks like topics will be expanded beyond grub.cfg to more general GRUB 2 subjects. I have not read this last update but plan to today sometime. If you're hungry for more reading, there's some, updated 4 hours ago.

                Herman has not yet done anything more (since 8-1-09), nor is there anything new (or substantial) in the official Manual yet. It looks to me that Herman is shooting for a comprehensive, encyclopedic "manual" of sorts. I was hoping that the official Manual would do that (e.g., with links to all the man pages, lists of all the files, etc.).

                http://members.iinet.net/%7Eherman546/p20.html
                http://grub.enbug.org/Manual


                Best to pick a few of these, perhaps half a dozen (as they develop), read them all, and get unique tidbits and twists from each. I believe mine has been/is being translated for the Greek Ubuntu forum (not sure the status of that). Of course, it would be best if we get a good Manual and especially a good GUI!


                Happy reading (if this happens to be your hobby, that is).
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #53
                  Re: GRUB 2: A Guide for Users

                  Not my hobby really :P

                  But you did save the day yesterday, I went to the cheat sheet to see how to change the login delay (it was too long by default for a netbook). It took me about 1 minute to do the whole thing.

                  It might be handy to have the cheat sheet on the top, but that's a matter of preference. It is not very easy to read things in a long post because you can't go to the index and click on a topic and get there. Still very useful though.

                  Thanks for all the work!

                  Comment


                    #54
                    Re: GRUB 2: A Guide for Users

                    Thanks for the feedback, lmilano.

                    "It might be handy to have the cheat sheet on the top..."

                    That's also how I'd like to see things and thought about it before, but I hate to scare folks away with that sort of rather technical summary. Let's see how all this goes as GRUB 2 lands and evolves and we see the official Manual (although I'm beginning to have my doubts about the Manual appearing, down to the wire here). I'd like to see the cheat sheet on top. I copied to OOo Writer and printed one out and keep it next to the PC (on a pile of other "must-have's."

                    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                    Comment


                      #55
                      Re: GRUB 2: A Guide for Users

                      GRUB 2 how-to's, status

                      I'm still playing with GRUB 2 and will be adding to my GRUB 2 Guide as we go along (see the first and second posts of this thread). Lately, I'm looking at some live iso boot issues.

                      I'd say between what I've done and what the following guys have done, you have a pretty decent source of help on GRUB 2 as Karmic hits the scene.

                      The Grub 2 Guide, drs305
                      (formerly Grub 2 Basics), updated 3 hr ago
                      http://ubuntuforums.org/showthread.php?t=1195275
                      Tip: Very good on the grub.cfg! Good on /etc/default/grub options.
                      Recently, he added booting from live iso.
                      I'm in touch with the author, and he's been doing a very nice job explaining GRUB 2 to beginners.

                      GNU GRUB 1.97, updated 10-26-09
                      http://members.iinet.net/%7Eherman546/p20.html
                      Tip: Especially strong on graphical aspects--boot menu, colors, splash images.
                      Also contains a fairly complete cataloging and classifying of commands.


                      HOWTO: Booting LiveCD ISOs from USB flash drive with Grub2, by JustRon.
                      http://ubuntuforums.org/showthread.php?t=1288604
                      Kind of specialized, but also kind of neat.


                      Comment
                      live iso booting --
                      Looks to me like the following author started this topic for GRUB 2:

                      MultiBoot USB with Grub2 (boot directly from iso files)
                      http://www.panticz.de/MultiBootUSB

                      Somehow, he figured out the linux kernel boot options, and since then others are repackaging his work, adjusting and fine-tuning to special use cases. This is interesting stuff. You can put a bunch of iso's on a flash drive and boot them. I'll be posting such a how-to at some point, but for now, you can put it together yourself from panticz and JustRon links.



                      EDIT:
                      No substantial work has been done on the official Manual for quite some time, although it says 10-10-09 last edit.
                      http://grub.enbug.org/Manual
                      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                      Comment


                        #56
                        Re: GRUB 2: Boot from ISO

                        New special topic added to Reply #1; easily extended to other use/applications.

                        (Table of contents in both the original post and in Reply #1 modified to include this topic.)


                        Boot From ISO -- use of GRUB 2 loopback
                        Boot your Kubuntu Live CD ISO from your flashdrive

                        GRUB 2 includes a new command, loopback. Use loopback to make a device from a file.

                        We'll put the Kubuntu Live CD iso file on a USB flash drive and boot the live OS from the iso on the flash drive. So, when done, you will boot your PC from the USB flash drive, get a boot menu, select an option corresponding to your Kubuntu Live CD iso file (which will be located on your flash drive), and you will then be booted into a Live Kubuntu session (corresponding to that iso) ...

                        (... read on in Reply #1)
                        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                        Comment


                          #57
                          Re: GRUB 2: A Guide for Users

                          The last few days I've been testing grub2 with os x 10.6.1. I compiled the latest from svn and created a usb boot disk with grub2 and tried to boot. I had no problems with the compile and grub-mkimage. I copied grub.efi, the mod and lst files to the usb, blessed it and tried to boot. I don't have a multiboot setup yet so the install involves copying files to an OS X volume then use the bless command in os x. I made it to the grub> prompt and no further. It would never find the kernel. I know it's on disk 0, partition 2 but no luck. Someone in the #grub IRC channel said 10.6 isn't supported yet in the main source branch.

                          Below is the menu entry I tried in the grub.cfg file.

                          Code:
                          menuentry "Mac OS X" {
                            set root=(hd0,2)
                            insmod video
                            insmod vbe
                            gfxmode="1280x800x32"
                            xnu_kernel /mach_kernel rd=disk0s2
                            if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
                              xnu_mkext /System/Library/Extensions.mkext
                            else
                              xnu_kextdir /System/Library/Extensions
                            fi
                          }
                          linux && bash = "the future"

                          Comment


                            #58
                            Re: GRUB 2: A Guide for Users

                            Grub gurus : I just upgraded Karmic and I had an issue with grub (legacy, which is not upgraded to grub2). The menu.lst was not properly updated. The workaround was:

                            1st. Boot manually (edit with "e" and make it point to the right place)
                            2nd. Remove the existing menu.lst and regenerate it with "sudo update-grub"

                            I had been customizing my menu.lst, so hopefully it's a one off ... but better to share it in case we need to help someone with this!

                            Comment


                              #59
                              Re: GRUB 2: A Guide for Users

                              Here is my fdisk -lu
                              Disk /dev/sda: 300.1 GB, 300090728448 bytes
                              255 heads, 63 sectors/track, 36483 cylinders, total 586114704 sectors
                              Units = sectors of 1 * 512 = 512 bytes
                              Disk identifier: 0xcff4cff4

                              Device Boot Start End Blocks Id System
                              /dev/sda1 * 63 385559 192748+ 83 Linux
                              /dev/sda2 385560 16016804 7815622+ 82 Linux swap / Solaris
                              /dev/sda3 16016805 406637279 195310237+ 83 Linux
                              /dev/sda4 406637280 586099394 89731057+ 5 Extended
                              /dev/sda5 406637343 507975299 50668978+ 83 Linux
                              /dev/sda6 507975363 519686684 5855661 83 Linux
                              /dev/sda7 519686748 539221724 9767488+ 83 Linux
                              /dev/sda8 539221788 586099394 23438803+ 83 Linux

                              Disk /dev/sdb: 300.1 GB, 300090728448 bytes
                              255 heads, 63 sectors/track, 36483 cylinders, total 586114704 sectors
                              Units = sectors of 1 * 512 = 512 bytes
                              Disk identifier: 0x000e6fa8

                              Device Boot Start End Blocks Id System
                              /dev/sdb1 * 63 307194929 153597433+ 7 HPFS/NTFS
                              /dev/sdb2 307194930 389110364 40957717+ 7 HPFS/NTFS

                              I usually unplug the WinXP HD before installing U/Kubuntu. Afterwards I modify the menu.lst, reconnect the WinXP HD and boot into either WinXP or U/Kubuntu.
                              After installing Kubuntu 9.10 I couldn't boot into WinXP anymore. I tried, several times, Method 1, 2 (for dual booting with Windows) but I would just get syntax errors.
                              My grub.cfg would show something like this for the WindowsXP part:
                              menuentry "Microsoft Windows XP Home Edition (on /dev/sdb1)" {
                              drivemap -s (hd0) $ {root}
                              chainloader +1
                              }
                              I re-read the instructions here and tried
                              :sudo grub-install /dev/sda
                              which gave no errors with hd(0) /dev/sda
                              entering /boot/grub$ sudo grub-mkconfig -o /boot/grub/grub.cfg
                              displayed the check drivemap error for the WinXp partition.

                              Finally,
                              kman@kubunt-9-10-box:/boot/grub$ sudo grub-install --recheck /dev/sda
                              [sudo] password for kman:
                              Installation finished. No error reported.
                              This is the contents of the device map /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'.

                              (hd0) /dev/sda
                              (hd1) /dev/sdb
                              kamn@kubunt-9-10-box:/boot/grub$ cat /boot/grub/device.map
                              (hd0) /dev/sda
                              (hd1) /dev/sdb
                              kman@kubunt-9-10-box:/boot/grub$ sudo grub-mkconfig -o /boot/grub/grub.cfg
                              Generating grub.cfg ...
                              Found linux image: /boot/vmlinuz-2.6.31-14-generic-pae
                              Found initrd image: /boot/initrd.img-2.6.31-14-generic-pae
                              Found memtest86+ image: /memtest86+.bin
                              Found Microsoft Windows XP Home Edition on /dev/sdb1
                              done
                              I guess I should have read the info more thoroughly.
                              Thank you.

                              Comment


                                #60
                                Re: GRUB 2: A Guide for Users

                                Hi kman. I take it that you solved it, then. I did notice this:
                                menuentry "Microsoft Windows XP Home Edition (on /dev/sdb1)" {
                                drivemap -s (hd0) $ {root}
                                chainloader +1
                                where there is no set root= statement (syntax).
                                In the future, let's post this in the regular forum (like 9.10 Installation and Booting); that way this thread won't grow too big with too many details. Nice to have you here participating! --Mike
                                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                                Comment

                                Working...
                                X