How do I triple-boot Ubuntu, Fedora and Windows 7?

1,410

Solution 1

I suggest you install Windows first, then Fedora, then install Ubuntu last. Installing Windows first will ensure that Fedora's or Ubuntu's GRUB will detect Windows and allow you to choose between all three operating systems.

  1. Install Windows! (Skip this step if you have it already)

  2. Shrink your Windows Partition using Disk Management by clicking the Start Menu, then right-click Computer, then select Manage. Then Select Disk Management from the sidebar.

    enter image description here

  3. Right-Click the Windows Partition and Choose "Shrink Volume". Decide How many MB's you will want to give to Ubuntu and Fedora. More is better. Remember: 1GB = 1024MB. I suggest shrinking about 20-50 GBs for both Fedora and Ubuntu, since they need at least 6.5 GB for both.

  4. Shut down Windows.

  5. Boot into a Fedora Installation or Live CD and choose "Install Fedora".

  6. Keep going and then stop at this step.

    enter image description here

  7. Choose Create Custom Layout.

    enter image description here

  8. Select the "Free" thing and then click the "Create" button.

    enter image description here

  9. Click Create again. Choose the Mount Point as / and give some space to Fedora in MBs. Remember to leave some space for Ubuntu!

    enter image description here

  10. Go through the rest of the Process.(next, next, next.)

    enter image description here

  11. Restart your machine and setup Fedora.

Fedora is now installed! Have fun with Fedora.

  1. Then reboot into a Ubuntu Live CD.

    enter image description here

  2. Again, stop at this step.

    enter image description here

  3. Choose Something Else.

    enter image description here

  4. Click the Free space and then click Add. Again choose / for the mount point and use a Logical Partition. Choose any Disk size you want.

    enter image description here

  5. Click OK and go through the rest of the process. (next,next,next.)

    enter image description here

  6. A GRUB menu should appear to let you choose Windows, Ubuntu, and Fedora!

Note: If Fedora didn't show up in the GRUB menu, you might have to type sudo update-grub in the Terminal.

Sharing swap on a USB flash drive between Ubuntu and Fedora

Here is how to share swap on a USB flash drive between Ubuntu and Fedora. (Thanks Akshit Baunthiyal!)

For anyone that doesn't know what Swap is, read the SwapFaq in the Official Ubuntu Documentation.

  1. Boot into Ubuntu.

  2. Insert a 4GB+ USB Stick. Use a spare one, because stuff on the USB will be gone soon! Of course, you can ignore these steps, so read the SwapFaq to decide if you really need swap.

  3. Then go to Disk Utility. The USB Stick should show up in the sidebar.

    enter image description here

Because I don't have a spare USB lying around the USB stick that is supposed to show up isn't shown.

  1. Click on the USB Stick, and then select Format Drive. Then choose linuxswap as the format. Remember not to format the wrong drive!!!

  2. After formatting, scroll to the side and look at the Device: column. Note the string that is followed by that. It should be something like "/dev/sdx1". Remember that!

    enter image description here

  3. Fire up a terminal by searching "Terminal" in the dash.

  4. Type sudo mkswap /dev/sdx1 in the Terminal. Enter your password when prompted and replace "/dev/sdx1" with the string that I told you to remember.

  5. Next, type sudo swapon /dev/sdb. Again, replace /dev/sdb with the string.

  6. Then, type sudo gedit /etc/fstab. A window will appear.

    enter image description here

  7. Add /dev/sdx1 swap swap defaults 0 0 to the end of the file.

  8. Save the file and close it.

Apply the same thing with Fedora if you want, but just remember that there is no sudo in Fedora and you will have to switch to a root prompt:

su --login

then type in your password in Fedora and follow the steps without having to type "sudo".

Now you should have a triple-Boot system with Ubuntu, Windows, Fedora, and a swap in Both Ubuntu and Fedora!

Solution 2

Make a backup of your windows 7 install - Imaging the whole disk with clonezilla is a good idea since OEM installs often do wierd bootloader stuff. This also means you can restore the system to factory settings if needed.

Firstly if you have lots of ram, avoid a swap partition ... We'll come to why later.

Plan your partitions - I'd suggest going with 2 system partitions, and initially one or no swap partition - this should simplify things considerably, and there's a good reason for this. I'd also suggest setting slightly different partition sizes for each (For example, 50 gigs for windows, 30 gigs for ubuntu, 28 gigs for fedora, and 2 gigs for swap). Write down the sizes. Make sure you know them. I'd suggest leaving the windows partition as primary, and using extended and logical partitions for linux.

Resize the windows partition, making sure its the first partition - i'd use the tools in the first linux distro you install to resize. Install, reboot, and check both OSes work. Ideally, i'd make a second image of the drive at this point

Install the second distribution. Reboot and retest.

At this point you have two OSes and ONE swap partition. Sharing a swap partition is messy - so i'd suggest setting up a swap file. There's no real performance issues with modern partitions.

For each distro, you will need to do the following things as root (su for fedora, sudo su for ubuntu will work). Instructions adapted from cyberciti

Firstly, you will want to create a disk image for your swap file - for a 512 mb swap file

dd if=/dev/zero of=/swapfile1 bs=1024 count=524288 - replace the value of 'count' with the size you want in bytes.

mkswap /swapfile1 format the swapfile as a swap partiton

chown root:root /swapfile1 Give ownership of the swap file to root chmod 0600 /swapfile1 Give read-write permissions to the file to root only.

swapon /swapfile1 activate swap file

Now, you will need to edit fstab to load up the swapfile for the system on boot

to do this nano /etc/fstab opens up the fstab file in nano (you can do this with the text editor of preference)

Add the line /swapfile1 swap swap defaults 0 0 to it, and remove any other lines referring to swap.

If the other linux boot has no swap file, repeat - you can rename the swap file if you choose.

This should give you a neat triple boot, with as simple a partition layout as possible.

Share:
1,410

Related videos on Youtube

swabs
Author by

swabs

Updated on September 18, 2022

Comments

  • swabs
    swabs almost 2 years

    I am working on a project that requires the use of curl commands to load a file to a specific site. I want this to be implemented using C#. From looking at similar questions on SO I have not found anything that seems to work for me, unless I am doing this wrong.

    This is the curl command I successfully use with Cygwin:

    curl -i -u user:password -F 'file1=@\Users\User\Desktop\test.jpg' -F 'json={"content": {"type": "text/html", "text": "<body><p>look at me, look at me</p></body>"}, "type": "document", "subject": "Document with Attachment"};type=application/json' http://someurl
    

    Right now I am trying to make this work with a WebRequest, as I've read that this was possible on other posts. This is what I have thus far.

     WebRequest request = WebRequest.Create("http://someurl");
                request.PreAuthenticate = true;
                request.ContentType = "application/json";
                request.Method = "POST";
                string authInfo = Convert.ToBase64String(Encoding.UTF8.GetBytes("user:password"));
                request.Headers["Authorization"] = "Basic " + authInfo;
    
                //what do I set my buffer to?
    
                Stream reqstr = request.GetRequestStream();
                reqstr.Write(buffer, 0, buffer.Length);
                reqstr.Close();
    
                WebResponse response = request.GetResponse();
    

    What do I set my buffer to here to write the curl command which in turn should send the file test.jpg? Also, I tried using libcurl without success either. Any pointers in the right direction are greatly appreciated!

    • Davide Icardi
      Davide Icardi over 11 years
      You must write a content of type multipart/form-data (the -F parameter of curl send 2 field, a json and a file). Here an example: stackoverflow.com/a/3890955/209727
    • Sam Axe
      Sam Axe over 11 years
      dump all that auth stuff. request.Credentials = new NetworkCredential(user,pass);
  • Blah
    Blah almost 12 years
    Now THIS is a great post! Props!
  • Akshit Baunthiyal
    Akshit Baunthiyal almost 12 years
    Also, since swap is usually necessary, you should give some space for it too. Better still, plug in a pen drive (minimum 4GB recommended), format it as linuxswap from the Disk Utility and execute this command mkswap /dev/sdb (where 'sdb' is the mountpoint of your USB drive).
  • Akshit Baunthiyal
    Akshit Baunthiyal almost 12 years
    And swapon /dev/sdb. Finally execute sudo nano /etc/fstab and add the following line at the end - /dev/sdb swap swap defaults 0 0.
  • George Udosen
    George Udosen almost 7 years
    Great post and archive material
  • s.r
    s.r almost 4 years
    What is the reason for doing Fedora first and then Ubuntu? I've Windows and Ubuntu already on my laptop. I want to install Fedora along side windows and ubuntu. Is the process going to be same? Please advise.
  • Emerson Hsieh
    Emerson Hsieh almost 4 years
    @r.s In my experience, installing Fedora then Ubuntu worked well out of the box, whereas the other way around required modifying the Fedora grub config to detect Ubuntu. This answer is also 8 years old, so things might work just as fine installing Fedora after Ubuntu. If the Grub after installing Fedora is still the Ubuntu Grub, you can use this to add/remove boot configs: launchpad.net/grub-customizer