GRUB2 solution for dual boot image ( Windows/ Ubuntu)



  • First I want to say hi to everybody in this forum. I’m new to fog project and for my first week with fog I’m really impressed of the work you have done wit it. I’m responsible for a lab with 400 computers and I found FOG is one of the best solutions for me in my lab. I came across FOG after several problems with Clonezilla server drbl and now I’m happy with your product :).
    Now I have one issue which unfortunately I could not find up to now a good solution. All my computers are dual boot windows/Ubuntu with grub2 installed on first partition alone. When I deploy an image it hangs on grub. I red here and on internet for a solution but what I found here for example is really out of date and I was wondering if you have some new solution for grub2 without downgrade to grub legacy. I see others use labels for their hard drive in grub2 instead of UUID which in my opinion is the root of the problem.
    For example what Clonezilla does with this problem is to reinstall grub2 at the end of deployment of the image. I’m not aware you to have option like this.

    I really look forward to find a solution and to keep using FOG because I like it very much.

    I home someone here have a solution…


  • Developer

    @marted Let us know if you need any further assistance. Please describe exactly when steps you take! Not just “delete the windows boot manager and keep only grub2” but give us all the details like commands and such! It seems you are preparing a very custom setup here and we need to know all the details to be able to help you.



  • @Sebastian-Roth it works now 🙂 when I rebuild an image with clean windows and Ubuntu without touching windows partitions just I made a partition for Ubuntu.
    Just now I need to figer out how to delete the windows boot manager and keep only grub2 , but the image was deployed to the other machine without ANY problems!!!


  • Developer

    @marted said in GRUB2 solution for dual boot image ( Windows/ Ubuntu):

    thank you so much. Tell me how you want me to take the image , like Linux OS or Others?
    I’ll make a new image after installed a fresh copy windows/Ubuntu and will post the information today.

    There is no need to make a new image. Start by posting the information requested and we can start working on it.


  • Moderator

    @marted Well I can’t tell you what to repair in grub because we don’t know what is damaged at the moment. But FOG has the ability to call an external bash script that is executed on the target computer. In my environment (Windows mainly) I use this external script to copy hardware specific drivers to the C: drive of the target system also to update the unattend.xml file on the target computer with the target computer’s system name and calculated OU location. So the bash script has the ability to mount partitions on the target computer after the image has been deployed by fog, but before the target OS boots for the first time on the target computer. I have a number of tutorials in the tutorial forum on post install scripts. They are windows focused but could also apply to linux target systems too.



  • @george1421 thanks. I’ll do that today and will post the results.
    Could you tell me more about post install script? If for example I want to repair grub at the end of the cloning image how to run a post installation script? I saw a folder in /images with that name. It should be bash or sh script ?


  • Moderator

    @marted I have not created a dual boot system in a very long time, but with windows 10 and Ubuntu, I would start out by installing windows 10, use the advanced disk options so you can manually set the size of the C: drive to be less than the entire disk. The space you leave unallocated will be for ubuntu. Once windows is installed and happy then boot with an alternate live OS and remove the recovery partition. Since you are using FOG there is no real reason for the recovery partition. Then install ubuntu side by side with windows. If I remember correctly ubuntu will install grub on the boot partition replacing windows boot loader merging the windows boot loader into grub to make the dual boot environment. Once you have a working golden image fog should clone this. It should work rather well if the system is uefi based because the boot up logic is a bit simpler than bios mode.

    If by chance you need to make changes to grub during deployment you should be able to do what is needed with a post install bash shell script.



  • @Sebastian-Roth thank you so much. Tell me how you want me to take the image , like Linux OS or Others?
    I’ll make a new image after installed a fresh copy windows/Ubuntu and will post the information today.



  • @george1421 ok. Thank you


  • Developer

    @marted Yes, some of the wiki content is really old and the mentioned article is not up to date.

    Though we do try to keep up with many things it’s possible that Windows/Ubuntu dual boot cloning is broken at the moment. I have not tested this myself in quite a while. But let’s try to grab all the details and I am sure we can make it work for you or fix FOG.

    Please run ls -alR /images on your FOG server and post output here. As well go to the /images/IMAGENAME folder, get the text file d1.partitions and post contents here.

    Is the partition layout GPT or old school MBR?


  • Moderator

    @marted said in GRUB2 solution for dual boot image ( Windows/ Ubuntu):

    I came across other issues. I tried to activate https SSL and my pxe doesn’t boot anymore and the web access got certification problem (not trusted). I saw a lot here in the forum about that but still can not find a place here where it is explained step by step how to activate SSL and got it to work well with iPXE https and access web trusted certificates. Maybe I missed it, but if you can guide me on how to do it I’ll be so helpful.

    Mod Note: Please start a new thread for this since the issue doesn’t match the title of the thread.



  • @Tom-Elliott I’ve never tried it, but I want to try a simple installation first windows and after that ubuntu without touching the partitions, I’ll see if it work. If not I’ll check the solution proposed in the wiki to downgrade grub to legacy. I’ll post my results here soon.

    I came across other issues. I tried to activate https SSL and my pxe doesn’t boot anymore and the web access got certification problem (not trusted). I saw a lot here in the forum about that but still can not find a place here where it is explained step by step how to activate SSL and got it to work well with iPXE https and access web trusted certificates. Maybe I missed it, but if you can guide me on how to do it I’ll be so helpful.
    Thanks again for all your help!!
    Capture d’écran, le 2019-11-21 à 20.04.24.png


  • Senior Developer

    @marted Yeah, that is an article created January of 2013. Using a dual OS system for that period of time (Ubuntu 11 and Windows 7).

    Maybe that was true for whomever created the original article, but have you tried running this for yourself?



  • @Sebastian-Roth https://wiki.fogproject.org/wiki/index.php/Client_Setup#Dual_boot_Images

    it says : The installation is a standard Linux installation, but the default grub is not supported, so we downgrade to grub-legacy.


  • Developer

    @marted said in GRUB2 solution for dual boot image ( Windows/ Ubuntu):

    I red this in fogwiki .

    Please post the wiki link here so we know what you mean.



  • @Sebastian-Roth Can you explain why grub2 is not supported in FOG and need to be downgraded to grub?
    I red this in fogwiki .



  • @george1421 I install windows and manually delete partitions and leave only the boot and windows OS and after I create third one for example fat32 which when I install Ubuntu I format to ext4. During the Linux installation grub is installed on first partition efi mounted like /boot


  • Moderator

    @marted said in GRUB2 solution for dual boot image ( Windows/ Ubuntu):

    100M/300G/100G.(grub2/Windows/Ubuntu

    Can you explain the steps you used to create this type of disk configuration. Windows itself will not allow only one partition for all of its bits to work correctly (unless your windows version is XP). With Windows 10 you should always have 3 partitions. (I understand it worked before with Clonezilla). 1) boot (which grub can do) 2) System reserved. 3) OS Disk. You can usually discard the recover partition and that would be #4.



  • @Sebastian-Roth no, it’s primary partition. The disk was separated before installation on three partitions 100M/300G/100G.(grub2/Windows/Ubuntu) For example the same disk cloned with Clonezilla works fine when you deploy on other computer but like I said Clonezilla reinstall (repair) grub at the end of cloning, FOG not.
    In wiki it’s written that FOG doesn’t support grub2.
    Is this still valid for the version now?
    If yes why it supports grub but not grub2? Where is the problem?


  • Developer

    @marted said:

    grub>

    Is your Linux installed on LVM?


Log in to reply
 

358
Online

6.4k
Users

13.8k
Topics

130.3k
Posts