Menu

Grub problems

Stephen
2014-05-01
2014-05-15
1 2 > >> (Page 1 of 2)
  • Stephen

    Stephen - 2014-05-01

    I followed the docs but I think i need help with the grub config.
    My host is on /dev/sda (slackware using lilo) and the KaarPux is build on /dev/sdb
    at http://kaarpux.kaarposoft.dk/prepare_boot.html all went ok, and you say its ready to boot, but when I boot the host lilo come up of cause, (i'm running vmware and I did a snapshot before I did this). In vmware I remove the first hdd and booted. The boot halted and did not get to login. I presume this is because of the grub was configured for /dev/sdb and now the kaarpux is on /dev/sda.

    I looked at the grub.cfg and I'm totally confused. I coped the section that matters, whats the reference to msdos2 and the insmod lines for, can you produce and more simpler cfg.
    I might edit lilo in slackware and see I can get it to boot from there.
    Update: I tried the lilo in slackware but the boot produced a kernel panic, I know when I was building LFS I had to add extra settings in the kernel for vmware, maybe that caused the panic?

    Steve

    BEGIN /etc/grub.d/10_linux

    menuentry 'GNU/Linux' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-36126fba-cc2f-4773-86f7-0f4935b8c559' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos2'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 36126fba-cc2f-4773-86f7-0f4935b
    8c559
    else
    search --no-floppy --fs-uuid --set=root 36126fba-cc2f-4773-86f7-0f4935b8c559
    fi
    echo 'Loading Linux 3.14.1-kx-88618dc7 ...'
    linux /boot/vmlinuz-3.14.1-kx-88618dc7 root=UUID=36126fba-cc2f-4773-86f7-0f4935b8c559 ro
    echo 'Loading initial ramdisk ...'
    initrd /boot/initramfs-3.14.1-kx-88618dc7.img
    }

     

    Last edit: Stephen 2014-05-01
  • KaarPoSoft

    KaarPoSoft - 2014-05-01

    insmod and msdos

    The insmod lines tell grub to load certain modules. Looks ok.

    msdos simply refers to the disk partitioning scheme, not an operating system.
    The msdos partitioning scheme is also known as MBR (master boot record scheme).
    msdos1 refers to the first partion, msdos2 to the second, and so on.

    grub.cfg

    The grub.cfg file is generated by grub-mkconfig;
    it is not something "build into" KaarPux by hand.

    The section you reference was generated by grub-mkconfig
    while it was executing etc/grub.d/10_linux.

    set root

    The purpose of the set root= and search ... --set=root lines
    are to tell grub on which device it should find the kernel and initramfs.

    Hard disk are numbered starting from 0,
    so maybe replacing hd1 with hd0 would help.

    my grub.cfg

    However, I am surprised to see the hd1,msdos2 references in your grub.cfg.

    My grub.cfg has this:

    menuentry 'GNU/Linux' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f24166de-9684-4801-a729-6de4c5e94413' {
            load_video
            set gfxpayload=keep
            insmod gzio
            insmod part_msdos
            insmod ext2
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root  f24166de-9684-4801-a729-6de4c5e94413
            else
              search --no-floppy --fs-uuid --set=root f24166de-9684-4801-a729-6de4c5e94413
            fi
            echo    'Loading Linux 3.14.2-kx-88618dc7 ...'
            linux   /boot/vmlinuz-3.14.2-kx-88618dc7 root=UUID=f24166de-9684-4801-a729-6de4c5e94413 ro  
            echo    'Loading initial ramdisk ...'
            initrd  /boot/initramfs-3.14.2-kx-88618dc7.img
    }
    

    My grub.cfg only references the UUID, so it should find the disk
    no matter whether it is mounted as hda0, hda1, sda0, or whatever.

    So, it should be fine to boot in VM with the first harddisk set to what was the second harddisk when building.

    why is your grub.cfg different?

    I am at a loss explaining why your grub.cfg is different.
    I was using slackware 14.1, but have also been using Ubuntu and Fedora.
    They all produce a grub.cfg without mentioning set root='hd1,msdos2' and similar.

    Since grub.cfg is created inside the chroot, it should not matter
    what the host OS is anyway.

    However, one question:
    are you sure you ran the grub commands inside the chroot,
    e.g. bootstrap/host_scripts/enter_chroot.sh
    (see http://kaarpux.kaarposoft.dk/prepare_boot.html).

    what exactly went wrong?

    You wrote "The boot halted and did not get to login".
    What exactly went wrong?
    Dit the BIOS write anything?
    Did you get to the GRUB menu?
    Did the kernel start to boot?

    The more detail the better. Screenshot?

    vmware

    I have no experience with KaarPux in vmware, but:

    grep -i vmware master/packages/l/linux.files/config.x86_64 
    CONFIG_VMWARE_VMCI_VSOCKETS=m
    CONFIG_VMWARE_BALLOON=m
    CONFIG_VMWARE_VMCI=m
    
     
  • Stephen

    Stephen - 2014-05-02

    I will send some stuff tomorrow (weekend), I was thinking of grabbing the kernel image I built with LFS and using that and see if it boots ok, what ya think?

    Steve

     
  • Stephen

    Stephen - 2014-05-02

    "However, one question:
    are you sure you ran the grub commands inside the chroot,
    e.g. bootstrap/host_scripts/enter_chroot.sh
    (see http://kaarpux.kaarposoft.dk/prepare_boot.html)."
    Yep, cut and pasted as per docs.

    Steve

     
  • Stephen

    Stephen - 2014-05-02

    BTW what do you do to remove the host from the boot?
    I remove the HDD (in virtual machine) or use the lilo in slackware.

    Steve

     
  • KaarPoSoft

    KaarPoSoft - 2014-05-02

    please try with IDE disk

    I have installed VMware Player 6.0.2.

    Then converted one of my KaarPux qemu/kvm images to vmdk, and started it in vmplayer:

    • grub loads fine
    • grub unpacks the kernel and initramfs fine
    • the kernel start booting
    • at some point it stops for 30 seconds and later for 10 seconds (bit I noticed the same with SlackWare in vmplayer)
    • after about a minute the kernel starts executing init from the initramfs
    • init in initramfs fails, because it can not find the root disk!

    However, if I add the disk to vmplayer as an IDE disk (instead of the default SCSI), KaarPux boots like a charm in vmplayer, and I get a login prompt.

    So: Please try to add the disk to vmware as an IDE disk

    If it does not work, please let me know as much detail as possible about where it fails.

    • did grub come up?
    • did the kernel start booting?
    • where exactly did the kernel panic?

    support for VMware SCSI

    I am trying to figure out which drivers to add to the kernel to get the SCSI disk to work.
    Thought it was CONFIG_PATA_RZ1000, but no.
    Will keep investigating

    what do you do to remove the host from the boot

    I do not understand the question )-:

     
  • Stephen

    Stephen - 2014-05-02

    Screenshot, I used grub on the dev/sda and didn't edit the config
    That last line came up when I was doing the screenshot, still sitting there.

     

    Last edit: Stephen 2014-05-02
  • Stephen

    Stephen - 2014-05-02

    I'll try it on ide, see if that works.

    Damm found a error in the custom_definitions.shinc
    I have sda1 as swap , the file had it different

    ============================================================

    Target definitions - DISKS

    ============================================================

    paths and type of filesystems put into fstab

    KX_FSTAB_DEV_ROOT="/dev/sdb1"
    KX_FSTAB_FSTYPE_ROOT="ext4"
    KX_FSTAB_DEV_SWAP="sdb2"

    Steve

     

    Last edit: Stephen 2014-05-03
  • KaarPoSoft

    KaarPoSoft - 2014-05-03

    If you scroll up (for me it is <shift>+<PageUp>) you should be able to see more of the kernel log. I suspect you will see that the root device was not found.

    At the point where the boot is stuck, you may actually have been dropped into a busybox shell, where you can try some simple linux commands, such as "ls", "lsmod", "lspci", etc.

     

    Last edit: KaarPoSoft 2014-05-03
  • Stephen

    Stephen - 2014-05-03

    I used the lasted git and ide and the bootstrap failed at bootstrap 8 doing the certdata
    KAARPUX: ------------------------------------------------------------
    KAARPUX: Unpacking and preparing CERTDATA
    KAARPUX: ------------------------------------------------------------

    mkdir: created directory '/home/kaarpux/kaarpux/bootstrap/build/bootstrap_8/certdata-ac5db8c74ac0'
    --- --- copy []: [/home/kaarpux/kaarpux/bootstrap/../downloads/certdata-ac5db8c74ac0.txt] -> [/home/kaarpux/kaarpux/bootstrap/build/bootstrap_8]
    cp: cannot stat '/home/kaarpux/kaarpux/bootstrap/../downloads/certdata-ac5db8c74ac0.txt': No such file or directory

    Steve

     
  • KaarPoSoft

    KaarPoSoft - 2014-05-03

    First: When building KaarPux on SlackWare, IDE/SCSI should not matter, as it seems that SlackWare works with SCSI in vmware. However, when you then try to boot KaarPux in vmware, the KaarPux disk should be on IDE, not SCSI.

    Second: My guess on the CERTDATA problem: you updated from git, but did not run download_bootstrap_packages.sh again.

    Third: I am still working on the SCSI problem. Tried looking at the SlacWare modules, building with modallconfig, and what have you. At least 10 different kernels. But I must be too stupid: still no luck ))-:

     
  • Stephen

    Stephen - 2014-05-03

    Yeah I did run the download_bootstrap_packages.sh, I looked at the script but I couldn't see the link to the source, can send the link and I will download manually.

    Steve

     

    Last edit: Stephen 2014-05-03
  • Stephen

    Stephen - 2014-05-04

    Finally got it to boot. yehaaa :)
    couple of things though.
    Minor doc error
    Grub setup you have
    grub-mkconfig -o ${CFG}
    cp ${CFG} ${CFG}.ORIG
    vi ${CFG}.cfg

    should be

    grub-mkconfig -o ${CFG}
    cp ${CFG} ${CFG}.ORIG
    vi ${CFG}

    fstab I have

    root@kaaride:/mnt/kxmnt/etc# cat fstab

    file system mount-point type options dump fsck

    order

    /dev/sdb2 / ext4 defaults 1 1
    sdb1 swap swap pri=1 0 0

    swap line should be
    /dev/sdb1 swap swap pri=1 0 0

    After I login it doesn't like my locale, I get get a error
    -bash: warning: setlocale: LC_ALL: cannot change locale (en_AU.UTF-8)

    Steve

     
  • KaarPoSoft

    KaarPoSoft - 2014-05-04

    Great that you finally got it to boot!

    Thanks for noticing the doc error; now fixed.

    You need to put the full path of the swap partition in KX_FSTAB_DEV_SWAP in custom_definitions. I have added a comment about that in default_definitions.

    You should have a few standard locales available, plus the one defined in KX_LOCALEDEF in custom_definitions. You can see the available locales with locale -a. I have added a few comments in default_definitions.

     
  • Stephen

    Stephen - 2014-05-06

    I have a bit of time today and doing a rebuild, I noticed the GPT style formatting, never used that method before, that's maybe how your doing it, and why you have different grub entry for root=.

    Steve

     
  • KaarPoSoft

    KaarPoSoft - 2014-05-06

    My physical server is partitioned with GPT (and I manually update grub.cfg).
    However, I always build in a kvm virtual machine, and here I use MBR partitioning.
    By the way, you may try master/expert/dangerous_build_bootstrap.sh which is the script I use daily to build KaarPux.

    Anyway, about root in grub:

    When grub loads the linux kernel image, it looks for it on the disk specified in the grub variable called root
    (see http://www.gnu.org/software/grub/manual/grub.html#root).

    However, specifying the disk with e.g. set root=(hd1,msdos2) in grub.cfg requires that the disk are named/numbered in the same way on the host where you create the grub.cfg and the target where you boot with this grub.cfg.
    And to make matters worse, the target may not even name/number the disks the same way between boots if there is more than one disk.

    To make up for this, grub has the search command.
    When you say search --no-floppy --fs-uuid --set=root 36126fba-cc2f-4773-86f7-0f4935b8c559, grub will set root to the partition which has the specified UUID.

    About search --hint=, the manual (http://www.gnu.org/software/grub/manual/grub.html#Platform-limitations) says:
    Hints allow faster disk discovery by already knowing in advance which is the disk in question. On some platforms hints are correct unless you move the disk between boots. On other platforms it’s just an educated guess. Note that hint failure results in just reduced performance, not a failure

    We also have linux /boot/vmlinuz-XXX root=UUID=36126fba-cc2f-4773-86f7-0f4935b8c559.
    The root=UUID is passed to linux and then to the initramfs, which uses it to find the KaarPux partition.

    In any case, the UUID's should stay fixed between hypervisors and boots. You can find the UUID's with the command
    blkid

     
  • KaarPoSoft

    KaarPoSoft - 2014-05-06
     
    • Stephen

      Stephen - 2014-05-06

      Excellent, did a new build, no errors this time. Now for next stage.

      Steve

       
  • Stephen

    Stephen - 2014-05-06

    Spoke too soon, --2014-05-07 15:50:27-- http://www.apache.org/dist/ant/source//apache-ant-1.9.3-src.tar.bz2
    Resolving www.apache.org... 140.211.11.131, 192.87.106.229, 2001:610:1:80bc:192:87:106:229
    Connecting to www.apache.org|140.211.11.131|:80... connected.
    HTTP request sent, awaiting response... 404 Not Found
    2014-05-07 15:50:28 ERROR 404: Not Found.

    Got same thing in by browser
    http://www.apache.org/dist/ant/source/apache-ant-1.9.3-src.tar.bz2
    The requested URL /dist/ant/source/apache-ant-1.9.3-src.tar.bz2 was not found on this server.

    Steve

     
  • Stephen

    Stephen - 2014-05-06

    I'll test the scsi.
    BTW I manually added
    kx_download "http://hg.mozilla.org/releases/mozilla-release/raw-file/${KX_CERTDATA_VERSION}/security/nss/lib/ckfw/builtins/certdata.txt" "${KX_CERTDATA}.txt" 37ee5e82b1d3358c68a50141f942303958ff182e05f1a1a24fe6756eb7b60a7e

    bootstrap/download_bootstrap_packages.sh
    Too make sure I didn't error out.

    Steve

     
  • Stephen

    Stephen - 2014-05-07

    Booted fine this time with scsi disk.
    still stuck at
    --2014-05-08 02:36:42-- http://www.apache.org/dist/ant/source//apache-ant-1.9.3-src.tar.bz2
    Resolving www.apache.org... 192.87.106.229, 140.211.11.131, 2001:610:1:80bc:192:87:106:229
    Connecting to www.apache.org|192.87.106.229|:80... connected.
    HTTP request sent, awaiting response... 404 Not Found
    2014-05-08 02:36:43 ERROR 404: Not Found.

    Steve

     
  • KaarPoSoft

    KaarPoSoft - 2014-05-07

    Arrrghh, yes, they released a new version last week.
    You can download manually here:
    http://archive.apache.org/dist/ant/source/apache-ant-1.9.3-src.tar.bz2

    I will update the package to point at this location.

     
  • Stephen

    Stephen - 2014-05-07

    The script can't log onto ftp.gimp.org
    You think this a temporary problem?
    Steve

    --2014-05-08 06:03:10-- ftp://ftp.gimp.org/pub/babl/0.1/babl-0.1.10.tar.bz2
    => 'babl-0.1.10.tar.bz2'
    Resolving ftp.gimp.org (ftp.gimp.org)... 209.132.180.179
    Connecting to ftp.gimp.org (ftp.gimp.org)|209.132.180.179|:21... failed: Connection refused.
    kaarpux@kaarpux:/mnt/kxmnt/home/kaarpux/kaarpux$

     
  • Anonymous

    Anonymous - 2014-05-07

    May I suggest:

    Whenever you run into a download problem, comment out the offending download in download_all_packages.sh and re-run.

    When done, run again with the full download_all_packages.sh, and repeat commenting out offending packages. (This second repeat step to catch sites like gimp which may have been only temporarily unavailable).

    Then post the names of the offending packages here, and I will either try to find a better download location, or post them somewhere.

    PS: Sorry for the hassle. I actually did a complete download from scratch a week or two ago (and adjusted a few location), so I hoped everything would be OK. But locations change, sites go offline and what have you...

     
1 2 > >> (Page 1 of 2)

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.