Wednesday, October 9, 2013

How to run dual operating Systems

Today I'm going to show you how to install dual OS on your PC. I'm using an Acer Aspire, and my default OS is windows 7; I'm going to install Ubuntu 12.04. So you may want to check your type of laptop as a few step may be different or require different commands. Mind you, this is going to be a bit risky for the system and most expert would not advise having dual OS on one hard disk. So proceed at your own risk. But before you begin you're going to need/do a few things.

STEP 1: Prepare

So you want to have/do the following things:

1. Ensure you have enough space to do this. 
-This should be a given. If you don't have at least a 400 GB harddrive on your computer I would advise against even doing this as there will little space to even work with and all you'll be doing is limiting your resources.

2. Back up every thing important.
-If something bad happens during this process you CAN lose everything.

3.Get your windows 7 product key. 
- If your laptop/computer came with this pre-installed than you should be able to find it at the bottom of your device.
4.Go online and get a windows 7.iso (which should be free to download) and download it to a CD or usb (and make it live) -This will let you make the usb live - mind you it wipes out the usb memory - http://www.microsoftstore.com/store/msusa/html/pbPage.Help_Win7_usbdvd_dwnTool
- Mind you, windows 7 is massive (it's about 4GB) so make sure you get a disk large enough to hold it.

You're going to want these in the case that you crash windows 7 in the process of partitioning your hard drive (which we'll discuss later) so make sure you back up everything important! 

5. Download Ubuntu to a CD or USB (and make it live)
-This will let you make the usb live - mind you it wipes out the usb memory - http://www.pendrivelinux.com/
- You're going to need this to partition the hard disk/ install ubuntu/ and check the state of the hard disk. This should only be around 1 GB in size.
- You can get this here: http://www.ubuntu.com/download/desktop

STEP 2: Optimizing your computer

Now that you have these things, you are almost ready to begin the process. You are now going to want to open your disk drive and power-off your computer and when the Acer logo shows up, press F2 to go to setup. Should look something like this:
Go over to BIOS. BIOS runs before the operating system even begins and shows the system information, and tells the computer what OS to run. Ubuntu on the other hand uses Grub2.
Now, go over to boot and move your dvd drive to the top of the list, this way if a disk is entered it will run the disk prior to running windows.
Now put the ubuntu CD into the disk drive and something different should happen.

That's right, Ubuntu should boot up. The Ubuntu disk what you'd call a live disk. At this moment, windows hasn't even loaded, and won't load unless the disk is removed. Also, it works like a fully functioning OS so if you want to check the internet and such you may.
Once Ubuntu boots up, you're going to want to 'try ubuntu'

Now, go up to the top left corner of the screen and click the symbol there. Then type 'gparted' in the search bar.
The whole point of this is to check the current stat of your harddrive, see how much space windows is taking up and see how the partitions are set up on your computer. Gparted is the most sophisticated system for this and far most user friendly than the window equivalent.
These are your pre-installation harddrive specs. Now to explain a few things. The 'sda' breaks up into this: 's' = harddrive, 'd' = drive, '1' = the partition number. 'ntfs' indicates that this is a microsoft parition.
sda1: PQSERVICE - original data for original OS (windows 7)
sda2: System Reserved - windows7 makes it (I honestly couldn't find a reason)
sda3: ACER - windows partition (this is what we're going to modify)
 There can be up to 4 primary partitions (sda1 - sda4) anything greater than sda4 is a logical partition. We're going to make a extended partition, or a partition that can hold several partitions.  We're going to make a partition for Ubuntu itself, swap space so that when RAM is depleted it can store data there, and a storage partition. All of your data will go into the storage partition, this way, you can share anything between the two OS. We'll discuss this more later.
 When you're done exploring Ubuntu/checking out your harddrive. Turn of the computer, press F2 to go to setup and change the Boot back to IDEO as first priority. This way windows will load.
Alright, so you should know something...microsoft doesn't like it when you try to install other OSs on PCs. Never would've guessed right? Well to prevent this windows likes to place process and objects in interesting places. Imagine the harddrive being a disk, things on the outer rim being closer to the metaphorical top and easier to access while things toward the center are harder to access and take longer to access. Most of windows is towards the top but a good chunk is at the bottom. This prevents you from being able to shrink the partition as you will want and it slows downs windows! But were going to fix this and optimize windows.
Now you're going to want as much space as possible on your computer so delete the files you backed up (we'll put them in the storage partition later. Just make sure they are backed up externally for now). The goal is to get windows as small as possible to where it can still run optimally even with Ubuntu taking up space. This is why personal files should go on a separate drive as keeping them in one area can make this process difficult.


Use this free device to detect and delete the bloat-ware (additional programs that come with other software) on your computer. This will help clear up some space and will help weed out some (or a lot depending on how much bloatware you have) useless programs. Be sure to delete anything you don't use frequently.
Then I would recommend Glary Utilities 3. It can be found here: http://www.glarysoft.com/
Auslogics disk defrag is what I'd reccomend primarily for defragmentation: http://www.auslogics.com/en/software/disk-defrag/download/


Glary is an excellent utility device that can detect and delete malware, analyse space usage on your computer, and defragement your computer. You are going to want to utilize all of these benefits. Click the pie graph at the bottom of the screen to use the disk space analyzer. Check all drives (which at the moment  should only be one) and you'll get something like the picture above. You going to want to delete anything that you don't need that takes up a lot of space (also if your files are backed up externally - like they should be - then delete those, you're going to want all the space you can get.) Then when you're done, go back the main menu then go to the 'advanced tools' tab and go to the 'remove malware' tab. After you're done with that, we can move on with defragmenting your computer.

Step 3: Optimizing your computer: Defragmentation

Defragmentation is when you takes files that are in pieces spread out all over the harddrive and push them closer to each other, this makes the system run optimally, but it also allows you to shrink the harddrive, which will keep the files together as they longer have the space to spread out. However, defragmentation can take a while to do (especially your first time), so we want to do this a few times as possible (yes, we may have to do this more than once) so we'll want to disable some immovable objects first.

Go to Control panel - Systems and Security - Systems - Advanced settings - advanced tab - performance - settings - change - set to no paging file.

Then go from the advanced tab to startup and recovery setting, then change 'kernal memory dump' to none. Restart later. 

Go to the start menu - search 'cmd', right click cmd and choose run as administrator, type in this command 'poweroff crg.exe -h off' This will disable hibernation, so if you close your computer, data will be lost.


Go to computer - right click 'properties' - system protection - configure - turn off system protection - delete all restore points.

Now your computer is in a very fragile state where if it crashes or is hacked it will not be able to recover lost information and it doesn't save on hibernation. But now you're ready to defragement the disk.

Go into Glary and go to advanced tools and click defragment. You should get something like the picture above. This is my computer after 3 years of use and no defragmentation. Files were every where and my computer was extremely slow (it even took about an hour for it shut down most times so I had to force it to shut down) So first click the down arrow next to defrag and analyze the system, then click the down arrow again and click 'defrag and optimize,' this takes much longer, but is worth it as windows will be optimized. The goal is to get all those files that are in a line spaced away from everything else and push them closer to everything else.
Now when you're done your screen may look something more like this. While optimized, quite a few things are still towards the bottom of the harddrive. To be able to effectively defrag the system, we're going to want everything as close as possible and nothing important, towards the bottom of the harddrive. This is where Auslogics comes in. Auslogics was better at moving files than Glary was. Plus it moved the master files which most defrag systems cannot do. Now for Auslogics to move files they cannot currently be in use so things that run a boot up will hinder it. So now we have to go into safe mode, a mode of the computer where it runs on the bear minimum, not running any external programs. Safe mode is good for removing viruses like trojans that load at boot time. To enter safe mode you just hold either delete or insert when the windows symbol appears on the screen, the go to alternate boot method and choose safe mode.

Now, when you run Auslogics in safe mode everything will appear as if it wasn't defragmented. I don't know know if this is due to the different softwares or if it's because just a way to make the program look like it's doing more work than it is; either way it gets the job done.
I've found that defragmenting often won't move as much as you'd hoped for, so I tried defragmenting multiple times and each time it moved a little more, based on some other peoples experiences. I'd say it really depends on how much space you're using. If you're using a relatively new computer and have nothing on it than it may move everything the first time whereas if you've been using your computer for years and have several programs it may take a few tries. The wait doesn't get much shorter each subsequent time so I'd get a non-computer related hobby in the meantime.

STEP 4: Partition and install Ubuntu
Okay, now that you're there you need to decide the space you will allocate for windows, unbuntu, swap space, and storage.

Now here's some tips for how you should go about allotting space: Consider how much space windows is taking up (this will be the default 'Acer' drive) and give it about 40 or so extra Gbs of space for programs. Give ubuntu about 90 gb of space. Make 5 gb for swap space, then the rest will be storage (personal files.)
I had 78 Gb of used space on Windows so I shrunk it to 125 Gb (12800 Mb), I gave Ubuntu 95 Gb of space, made 5 Gb for swap space, and the rest (225 Gb) were for storage/personal files.
Right click Acer - click resize - then shrink it to the size you want it.
These numbers are by MB and not Gb. You can use Google to convert Gb into Mb. Note that this won't re-size immediately so you have time to change everything to how you want it.


Now you should have some unallocated space, right click unallocated and make free space proceeding the size you will use for Ubuntu and the free space following the size for the swap space. This should create the partitions for both.
Once you've made a partition for storage you should have everything being used except for 90 Gbs of space. This is where Ubuntu goes! Go back to desktop and click install Ubuntu.



Install with all the other updates and when you get to installation type choose other.

Now click 'free space' and make the mount point: / (this stands for root)
Then click install now. Congratulations! You now have Ubuntu! Once it's installed it will be fully functional off the bat.


Next would be to reset the things you changed in windows back to normal - it should be pretty simple to change everything in windows back, but I'll go into more detail in my next post.
In my next post I'll detail clean up and how to optimize usage between windows and Ubuntu. I'll also briefly describe Ubuntu for those new to the OS.

I would also like to give a huge thanks to Nick Stafford who helped me figure all this out.


2 comments:

  1. Great Job Mark. Glad to help out. But one thing I would Change, You do not need 400 GB of memory to do this. What we did was very much overkill. Windows 7 only needs about 31 GB of Memory out of the box. This swells up due to bloatware and other crap, but with 100 GB, you should have enough room for all your future applications. Ubuntu takes up like 12 GB but I would give it at least 20 GB. If you have 150 GB of storage, that is more than enough to dual boot with a shared storage location. Since we had the extra space we were extra liberal with the memory, but this is unnecessary.

    ReplyDelete
  2. Very thorough and informative. The only revisions I'd suggest would be maybe to replace the photos with screenshots whenever a screenshot would be possible.

    Also, like Nick said, you don't need a 400GB hardrive, but due to cache, swap, and Windows's page file, I wouldn't make the partition less than 50gb (to be safe). 25 for Ubuntu.

    ReplyDelete