Lab No 2 Installing Windows 7 and Ubuntu side by side

To install Ubuntu on a computer that already has Windows 7 installed. We will have to accommodate space for our Ubuntu installation. To this end, we will use the GParted partitioning tool to resize (shrink) the Windows installation and create new partitions for Ubuntu. After Ubuntu is installed, we will have to deal with an error - a typical case of unbootable Windows, a common problem that can occur when the Windows installation is changed. We will learn how to deal with this problem simply and efficiently using the built-in tools, fixing the Windows boot issue. Data loss Whenever you're about to change the existing installation, there's a risk of data loss, regardless of which operating system you're about to install. It is important to make sure you have your critical data backed up to external media. You should also verify that your backups are intact and that they can be restored. Boot into Ubuntu live CD session Very fortunately, Ubuntu (as many other Linux distros) comes as a bootable live CD. This means you can boot Ubuntu and test the hardware compatibility, without making any changes to your existing installations on the hard disk. This is an excellent feature that lets you play with the operating system, get the first impression, check different applications, and make sure all your hardware is properly detected. This is what we will do. Boot into live CD, make sure everything works, and then proceed with the installation. Following the instructions in the Ubuntu installation guide should have you logged into the Ubuntu live session in the matter of minutes: Make sure your wired and Wireless network adapters are functioning, make sure your Bluetooth, Web camera, sound card, and possibly the graphics card all work as expected. This is the first step to ensuring smooth and painless installation and post-install experience Now, let's double-click on the Install button. This will begin the Ubuntu installation. Prepare Disk Space (Partitioning) The most important step of the installation is Step 4: Prepare Disk Space. In technical terms, this is called partitioning. Let us first examine the current situation: Windows 7 is installed. Ubuntu wisely informs you that this computer has Windows Vista (loader) on it. Good. This means that Ubuntu recognizes the existing installation. Do not be confused about the Windows Vista terminology. Windows Vista and Windows 7 use the same boot loader, hence the "erroneous" notation. This will definitely change in the coming version of Ubuntu. Take a look at the existing layout. There's a small, 100MB Windows system partition present and another 13.6GB partition in use, plus some free space. We now know that we should not touch or alert the small Windows system partition, but we might be able to resize (shrink) the big NTFS partition in order to accommodate more space for Ubuntu. The default installation choice is to install Windows and Ubuntu side by side. This is what we want. We will perform Partitioning manually and by carefully examining each and every step.So we should choose the third option, Specify partitions manually (advanced). Now, we need to manually edit the partitions. Planning is everything Before you make any change, let's examine the image above some more. Again, it's the same thing from before, only shown in the table form rather than as a graph ribbon. We have two partitions on the disk, sda1 and sda2, both primaries, both formatted as NTFS. There's also some free space. What more, sda2 is also quite free, with less than half occupied by Windows 7 files. We have several options: Install Ubuntu into the free space This is the simplest choice. We will have to create the extended partition and then create three logical partitions inside it, one for the root file system, one for home and one for swap. The 6.3GB free space is enough for Ubuntu installation. Shrink Windows and create a new layout This is also an option, somewhat more complex. Let's say we want more than the free space we have. This means we will have to make the Windows sda2 partition smaller. Luckily, this can be done, because the partition is quite large and mostly unused. We will go for option (b), both because it is harder and because it more closely resembles reality. Recommendation: If you're going to create dual-boot layouts on your machines, then here are some golden rules that should serve you well. • Create partitions using a dedicated partitioning tool like GParted. • Windows needs to be installed into primary partitions. Windows 7 requires that its system partition be primary. The second partition can be logical, meaning it can be placed into the extended partition. • Create partitions large enough so you won't need to enlarge them. • Create separate data partition for Windows files and another for data. • Create separate Linux root and home partitions. • Possibly create a partition for sharing of data between Windows and Linux. Example: Here's the layout I would make. Let's assume a 100GB disk, so we can relate to partition sizes in relative terms (percentage). I will also use generic /dev/sdaX names for the partitions. • Windows 7 system partition - 1GB (sda1) • Extended partition - 99GB (sda2) • Windows partition (Windows files) - 20GB (sda5) • Windows data partition (user files) - 60GB (sda6); you can share it in Linux • Linux root - 10GB (sda7) • Linux swap - RAM size, let's assume 2GB (sda8) • Linux home - remaining space (sda9) This setup does not yield best performance in Linux, because Linux root and swap are toward the end of the disk, which is slower, but it makes sense for a typical dual-boot user. Creating this setup AHEAD of any installation is a wise, healthy move. Can we use this recommended setup in our case? The answer is: no. We did not create the partitions using a third-party tool like GParted. We created the partitions using Windows 7 installer. Unfortunately, Windows 7 creates all new partitions as primary. Here's a reminder: So, we will have to handle the situation a little differently. We still need three partitions for Linux (root, swap, home). There are already two partitions in use by Windows. There can only be a total of four primary partitions on any hard disk. This means we must create the Extended partition in the free space, including the extra space gained by Windows 7 partition shrinking, otherwise we must forgo either the use of separate swap or home in Ubuntu. So, the tasks at hand are: • Resize Windows partition (sda2). • Create Extended partition - will be called sda3. • Create logical partitions (root, swap, home) inside the Extended - will be called sda5, sda6 and sda7. Edit partition Our first task is to edit sda2: Remember the recommendation to use a dedicated partitioning tool? This is what we're going to do. We're going to close the installer and use GParted. Use GParted to create partition layout GParted comes with Ubuntu. It can be found under System > Administration > Partition Editor. OK, let's make sure we have everything we want and need: • Windows 7 data is backed up, check. • We will resize (shrink) Windows 7 partition (sda2). • We will create the Extended partition. • We will create logical partitions. • We will then resume the Ubuntu installation. Resize (Shrink) Windows NTFS partition If you've read my extensive GParted tutorial, you know how to do this. It's rather simple. Highlight the partition and click on Resize/Movein the icon menu. Choose the new size. We'll lake it smaller by some 2GB. Once you approve of the new size, click Resize/Move. Nothing will happen yet. GParted will write down the task, but it will not run it until you click Apply in the main icon menu. This is a good thing, as it lets you make new changes and cancel tasks. Create Extended partition The next step is to create the Extended partition that will span the entire free space, including the new 2GB freed from Windows. Create Linux partitions Next, we will create the root, swap and home for Ubuntu. We'll format the root and home with Ext4 file system. Please refer to the Ubuntu installation guide for more details. Final layout This is the final layout: Apply the changes Triple check the layout; make sure you've done everything as you planned. Once you're fully satisfied, click Apply and let the tool run. GParted will start working. It will first run the shrinking task. GParted is quite friendly. GParted will first run a simulation to make sure it can do the desired task. Then, it will run a consistency check on the NTFS partition and try to fix errors if it finds any, it will then resize the partition and copy all the data over. Depending on the chosen sizes and the disk speed, this can take many hours. Next, it will create the Linux partitions. Success! If everything went as expected, GParted will complete all of the tasks successfully. New layout And here's the desired layout: Resume installation We will close GParted and click on the Install icon once again. In Step 4, we will now be seeing a whole new layout: Again, we will use the third option (Specify partitions manually). Ubuntu recommends yet another shrinking of the Windows 7 partition, but it is not necessary. We have all we need. We will now manually assign mountpoints to our freshly created root, swap and home partitions. Highlight the partitions (sda5-7) and assign them relevant mount points. There's no need to format them again, because we just did that with GParted. Here's the final setup: Warning The installer will warn you that you're not formatting the root file system and that it's going to destroy any existing directories found there. Since we know we've just created the partitions and want to use them for our new Ubuntu installation, this is ok. Our installation is ready. But there's one more thing to configure. Configure boot loader Ubuntu informed us that sda1 contains Vista (loader) on it. This is expected. Every operating system must use some form of boot loader to start. When you're running a dual boot system, you will have two options, using either the Windows boot loader or GRUB, which is the default loader in most Linux distress, including Ubuntu. We'll use GRUB and call on Windows 7 boot loader from it, which will then manage the Windows boot sequence. This is a standard procedure in dual boot systems. The default setting is to install the boot loader, so you need not do anything. We're ready. Click Install and let the procedure complete. Installation complete, enjoy your dual-boot After you reboot the system following Ubuntu installation, you will now see the GRUB menu, showing entries for both Linux and Windows, just as we've expected. Boot Ubuntu Let's first boot Ubuntu. Indeed, everything works fine. Let's make some more checks. For example, if you go to Place, you can see the Windows partitions in the list, called System Reserved and 11.5GB Media. And here are the contents of the 11.5GB drive: Now, let's boot Windows.

Comments

Popular posts from this blog

Magnifier- Magnifying Glass Privacy Policy

Boot Windows Oops, we get this horrible error! new method

Lab. No 8 Shortest Job First Operating System