Adding another OS using Grub4DOS

Discussion in 'Acronis Disk Director Suite' started by Earthling, Dec 4, 2008.

Thread Status:
Not open for further replies.
  1. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    A while ago k0lo helped me in separating my XP and Vista installations, and installing Grub4DOS as boot manager. It has been so successful that I have made the mistake of advocating this setup to others, and as a result I am now being asked to help in doing it :argh:

    k0lo's advice on adding a second OS was -

    "So now if you want to add another OS on your machine just create a partition for it, install it, and add another menu item to your menu.lst file. Note that since you have a boot manager, the need for installing operating systems in primary partitions goes away. You can add any other OS, even Windows, to logical partitions and they can be booted from grub4DOS."

    The party in question has a Vista installation and wants to add XP Pro, and I need to know if this raises any special issues. Normally Vista is installed after XP, not before. Also, I was wondering whether doing this would overwrite the MBR, and what to do if it does.
     
  2. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    Hi, Earthling:
    To do this I would advise hiding the Vista partition (and any others containing Microsoft Operating Systems) and un-hiding the soon-to-be XP partition before doing the install. Also, make this new partition active.

    Then install XP. Yes, it will replace the MBR with its own, so after installation the PC will boot directly into XP. To fix, reinstall Grub4Dos, which will replace the XP MBR with its own.

    Next you will need to add a few lines to the menu.lst file for Grub4Dos. Basically, to boot XP:
    1. Hide the Vista partition (and any others with MS OSes)
    2. Unhide the XP partition
    3. Make the XP partition active

    Also, in the menu entry for booting Vista, make sure that you hide the XP partition and make the Vista partition active when booting Vista.

    That should do it. Post the menu.lst file if you run into trouble.
     
  3. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    Mark:

    Thanks for that. It sounds straightforward enough, so let's hope the guy who has to follow my guidance doesn't make any of the mistakes I made at the time!
     
  4. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    While waiting for the other guy I thought I'd install Mandriva 2009 on my XP laptop, partly to see whether I could do it. Of course, it installed Grub as boot loader, but I wanted my Grub4DOS boot loader back, so I booted into XP and reinstalled that.

    Unfortunately I can't now find the right commands in menu.lst to boot Mandriva. Currently I've got -

    title Mandriva
    root (hd0,4)
    # these two lines are OK
    find --set-root /sbin/init
    # that produces a file not found error, but the file exists. Is the syntax wrong?
    configfile /root/grub/menu.lst
    # file does exist, but until line above clears I can't see whether it works.

    TIA
     
  5. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    Earthling:

    Try manual mode. Boot to Grub4DOS and when the menu screen comes up, type a "c" (for command). Enter the following lines manually, pressing the "Enter" key at the end of each line:
    Code:
    root (hd0,4)
    cat /boot/grub/menu.lst (or is it /root/grub/menu.lst)?
    If you enter the correct path to Mandriva's menu.lst file then it should print out on the terminal. Copy down the commands that are used to boot Linux. There should be a line for the kernel and one for the initial RAM disk image file. For example, this is from my Kubuntu distribution:
    Code:
    kernel          /vmlinuz-2.6.15-53-386 root=/dev/sda3 ro quiet vga=795
    initrd          /initrd.img-2.6.15-53-386
    Now, enter each of the two lines manually into the GRUB command terminal. An advantage of doing it this way is that you get to see if there are any error messages. If both lines are accepted then enter "boot". Mandriva Linux should then boot.

    If this works, put the lines in your Grub4DOS menu.lst file.
     
  6. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    Getting late here now Mark, so that will be for tomorrow. Thanks again friend :)

    Bernard
     
  7. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    Mark:

    I got only Grub error messages, but my partition structure was such a mess after four years of messing about I decided first to repartition, retaining only XP on hd0,0 and partitioning the rest more logically. I now have -

    hd0,0 Primary NTFS XP
    hd0,1 Primary FAT32 Data
    hd0.2 Primary NTFS VistaPE
    hd0,3 }
    hd0.4 } Mandriva
    hd0,5 }

    I have to have VistaPE because the DVD drive is so unreliable I can't be certain I can boot the Acronis rescue disk should I need to.

    After installing Mandriva I have the Grub GUI, which has boot entries for XP and Mandriva, but doesn't have one for VistaPE. Trying to add that I can't see how I can add the chainloader /bootmgr command it requires in order to be bootable. If I could solve that I would stick with Grub as bootloader rather than reinstalling Grub4DOS (which can boot VistaPE of course).

    If I reinstall Grub4DOS I can boot XP and VistaPE, but not Mandriva. Using Grub commands like find /vmlinuz and find /sbin/init I just get Error 17 File not found. With Grub4DOS in the MBR it's just as if Mandriva was never installed.

    I really don't care what boot loader I use on this machine as long as it can boot all three. Grub would seem the best bet, but can anyone help with the boot entry for it?
     
  8. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    Bernard:

    I'm at a loss to understand why Grub4DOS cannot see your Mandriva partition. I presume that you currently have things set up to use GRUB, which can see Mandriva OK, correct? If true can you post a copy of the Mandriva boot stanza from GRUB's menu.lst file? Also, could you post the output of sudo fdisk -l when run in a Mandriva terminal?

    You can indeed boot VistaPE from GRUB as follows:
    Code:
    rootnoverify (hd0,2)
    chainloader +1
    To chainload properly the VistaPE partition must have a Vista partition boot record. Depending on how you created the partition, it may not. If you created the partition with DD or with XP, then it will have an XP boot record. You can change it to the Vista style with the bootsect command, which requires a copy of the file bootsect.exe. This file is on a Vista recovery DVD, and is usually included in a VistaPE build that was made with WinBuilder. Check in your VistaPE partition for the file; it will be in the \boot folder as a hidden, system file. If not there, go to your WinBuilder folder and look for WinBuilder\Target\VistaPE\Boot\bootsect.exe

    Bootsect.exe can be run from an XP command prompt, so you could put a copy of the file on your XP desktop and run it from there. You need to know the current drive letter of the VistaPE partition - I'll use E: for this example, which will install the Vista boot record to your E: partition:
    Code:
    bootsect /nt60 E:
    Run the command bootsect /? to see the syntax. After you update the VistaPE partition's boot sector to the Vista style then you should be able to directly boot VistaPE by chainloading from GRUB.
     
  9. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    Thanks Mark, that has worked a treat, and Grub is now booting all three. I did need the Vista style partition boot record for VistaPE as you suggested.

    Bernard
     
  10. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    Bernard:

    Glad that worked. If you're not thoroughly sick of this yet, I would still be interested in figuring out why Grub4DOS was having problems. I prefer it to GRUB since it has added a number of features, including the ability to work with NTFS partitions.
     
  11. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    Extract from menu.lst -

    Code:
    title linux
    kernel (hd0,4)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=12e48e8e-5d68-436d-9b04-e2dbb47640c0 resume=UUID=72e46a0a-f2d7-40e8-8f76-80ac87f3ee9c splash=silent vga=788
    initrd (hd0,4)/boot/initrd.img
    
    title linux-nonfb
    kernel (hd0,4)/boot/vmlinuz BOOT_IMAGE=linux-nonfb root=UUID=12e48e8e-5d68-436d-9b04-e2dbb47640c0 resume=UUID=72e46a0a-f2d7-40e8-8f76-80ac87f3ee9c
    initrd (hd0,4)/boot/initrd.img
    
    title failsafe
    kernel (hd0,4)/boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=12e48e8e-5d68-436d-9b04-e2dbb47640c0 failsafe
    
    and fdisk -l

    [root@localhost ~]# fdisk -l

    Disk /dev/sda: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x2472a791

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 1778 14281753+ 7 HPFS/NTFS
    /dev/sda2 1779 8282 52243380 c W95 FAT32 (LBA)
    /dev/sda3 8283 8366 674730 7 HPFS/NTFS
    /dev/sda4 8367 9729 10948297+ 5 Extended
    /dev/sda5 8367 9385 8185086 83 Linux
    /dev/sda6 9386 9473 706828+ 82 Linux swap / Solaris
    /dev/sda7 9474 9729 2056288+ 83 Linux
    [root@localhost ~]#
     
  12. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    I think the highlighted terms were the problem. Apparently, there is no file at /sbin/init, so the automatic search for the root directory "find --set-root /sbin/init" fails. And the kernel is at /boot, not /root. Since you know where the Mandriva partition is located, this should work:
    Code:
    root (hd0,4)
    configfile /boot/grub/menu.lst
     
  13. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    I don't think that can be right Mark. Every find command failed, not just those two, including find /vmlinuz. Also, init is an executable located in /sbin, so the serach for that shouldn't have failed either should it?

    I need to find out how to do screenshots in Mandriva!

    I'm on a steep Linux learning curve here, but if I can find a window to have another go at booting Mandriva from Grub4DOS I will

    Bernard

    EDIT - btw that /root/grub/menu.lst was simply a typo. Should have been /boot etc
     
  14. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    So Grub4DOS can't find anything? But isn't the file vmlinuz located at /boot/vmlinuz? Try searching for some file that you are absolutely certain of its location in the file system.
    Are you using KDE? If so, most distributions include KSnapshot, a screen capture program. That's the one that I use - it includes a delay feature so that you can take snapshots of the screen with a menu dropped down.
     
  15. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    Can't really answer these questions Mark until I've got a a local image from which I can quickly restore the MBR. I'll get one.

    Thanks for the KSnapshot tip.
     
  16. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    Mark:

    Added your suggested Mandriva stanza in menu.lst and reinstalled Grub4DOS, but it doesn't work - Error 2 Bad file or directory type.

    Tried root (hd0,4) followed by find /boot [TAB] and find /boot/grub/menu.lst [Enter] .... both produce Error 17 File not found

    Now reinstalling Grub, but will do further tests if you want them

    Bernard
     
  17. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    Bernard:

    That's really baffling. From the GRUB documentation:
    I assume that you are using one of the popular Linux filesystems; probably ext3, correct?

    The only thing that comes to mind is that, from checking the Mandriva forum, Mandriva 2009 formats the disk with a 256-byte inode size whereas 128-byte inodes have been the standard in the past. Perhaps Grub4DOS can't decode ext3 partitions with the larger inode size? That's pure speculation on my part. Regular GRUB appears to do OK since it does allow you to boot into Mandriva.

    With regular GRUB installed can you do this:
    Code:
    root (hd0,4)
    find /boot/grub/menu.lst
    without getting any error messages? If so it would point to Grub4DOS having an issue with the file system that is in use on your Linux root partition.
     
  18. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    Looks like you've put your finger on it Mark. Find works in grub, not in grub4DOS. The Linux Ext3 partitions were created during the Mandriva install.
     
  19. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
    Well isn't that interesting. The other surprise that you will have in store is that Disk Director and True Image will probably be unable to decode your Mandriva partition contents with the 256-byte inode size. TI will do a sector-by-sector backup and restore, but not a normal one, so your images will be larger. And I'll bet that if you use Disk Director to explore the contents of one of the Mandriva partitions, you will not see any files. But I'm surprised that Grub4DOS was unable to understand ext3 with 256-byte inodes.

    Paul (MudCrab) informed me that there is a recent update for Grub4DOS, so later tonight I'll look in the change log to see if they've fixed that. A few people on the TI forum have run into this issue with TI, so I don't know when or if Acronis will support ext3 with 256-byte inodes.

    If any of this bothers you there is an alternative. You could use Disk Director to delete the ext3 partitions, then re-create them. They will be created with 128-byte inodes. Then install Mandriva but don't let it format the partitions; just mount the existing ones. If you do this then Grub4DOS and DD and TI will be able to work with the Mandriva partitions.

    Do you mind trying to explore one of your partitions with DD and let us know if you can see files? That would confirm our suspicions.
     
    Last edited: Dec 9, 2008
  20. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    All falling into place! I was wondering why TI was complaining about my partitions and doing a sector-by-sector backup!

    If I believed this laptop's creaking DVD drive would co-operate in a reinstall that's the way I would go, but as it took at least 10 tries to get the Mandriva CD booted this time I just don't want to risk it.

    I'll have a look at DD, though probably not tonight.
     
  21. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,482
    Location:
    California
    Mark,

    The latest build of Grub4DOS can find a file on an Ext3 partition I created with Ubuntu 8.10. DD can't read the partition so I'm pretty sure it's using 256-byte inodes (I think others have posted this too). I setup my 8.10 using Ext3 partitions created with DD to avoid this problem.

    What's the command in Ubuntu/Linux to see what inode value is being used?

    ***EDIT*** Okay, I found it.
    My test partitions are /dev/sdc1 and /dev/sdc2, so the following will display the inode values:
    Code:
    sudo dumpe2fs /dev/sdc1 | grep -i "inode size"
    sudo dumpe2fs /dev/sdc2 | grep -i "inode size"
    /dev/sdc1 was created with Ubuntu 8.10 and uses 256-byte inodes. The latest build of Grub4DOS found a file on it okay.
     
    Last edited: Dec 8, 2008
  22. K0LO

    K0LO Registered Member

    Joined:
    Mar 9, 2006
    Posts:
    2,591
    Location:
    State College, Pennsylvania
  23. Earthling

    Earthling Registered Member

    Joined:
    Nov 5, 2007
    Posts:
    604
    Location:
    UK
    Just to put the cat among the pigeons it seems DD can see the files on my Ext3
     

    Attached Files:

  24. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,482
    Location:
    California
  25. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,482
    Location:
    California
    Interesting. Neither Full or Safe Mode will see my 8.10 Ext3 partition correctly. It even shows up with the red "c" on the partition image. The error message is: Unsupported file system version
     
Thread Status:
Not open for further replies.