**MY FIRST BLOG POST**

***AN AMAZING WORLD of OPERATING SYSTEMS***

Advertisements

HOW TO INSTALL UBUNTU ON YOUR PC AND TO RUN A C++ PROGRAM THROUGH ITS SHELL??..

FIRST PART….

HOW TO DUAL BOOT A SYSTEM??

HERE,is an example showing dual booting of, WINDOWS 7 AND UBUNTU 14.04

DUAL BOOTING: Its an act of installing multiple operating systems on a computer system

UBUNTU: It is a DEBIAN based LINUX operating system and distribution(linux distro) for computers.

dualbooted

We are taking an example of pre-installed WINDOWS 7 on your system.

LETS GET STARTED…

PRE-REQUIREMENTS:

  1. PC running windows 7 having atleast  30 GB of free space.
  2. A CD/DVD burner or a BOOTABLE pendrive(A Bootable USB is similar to an operating system Installation CD. It helps to boot from the USB PENDRIVE )having an ubuntu ISO image.(An ISO image file is a snapshot of the data and layout of a CD or DVD)
  3. An external HARD DRIVE big enough to store your data.(As in case you lost your data while following these steps,you are already having its backup with you.) NOTE: IF you are a BEGINNER, then its safe to keep a backup of your important data.
  4. Administrative access to the PC.

STEP 1: ..BACKUP WINDOWS..

Go to CONTROL PANEL -> BACK UP or RESTORE YOUR FILE. Now click on SETUP BACKUP and follow the wizard.

2

This is perhaps the most important step. If anything goes wrong with the next few steps, this will allow you to restore your computer to its current state

STEP 2: DISK PARTITION

Click the WINDOWS icon in bottom left and type DISK MANAGEMENT. In the new window that appears you will see all your disks.eg. C: or D:

On your larger partition, ensure that at least 30GB of free space available. Next, right click on this drive and select “Shrink Volume.” It will take a little while for windows to analyze available free space, so be patient. Next, it asks how many MB you would like to shrink your volume. For a typical Linux OS install 30GB should be plenty if you’re not planning on using it to store large files such as movies. So, to shrink by 30GB, convert this to MB (multiply 30 x 1000) and enter this value (30000) into the appropriate field. Next, click “Shrink”.

3

It will create a free space.

“Unallocated” space means that the OS  knows that there’s physical space on the hard drive, but it hasn’t been assigned (“allocated”) to a particular partition (or “logical” drive letter).

“Free” space means that Windows knows you haven’t used up all of the allocated space on a particular drive (physical drive letter) or partition (logical drive letter).

STEP 3: BOOT FROM REMOVABLE MEDIA

5

Note, this step will vary slightly depending you your computer’s make and model.

If your computer’s documentation makes reference to an option to change the boot order, use that method to set the computer to boot from the disk drive or USB drive, depending on what media you used . Reboot and boot into the Linux media, and proceed furthur.

If you can not find this, you need to alter the BOOT order via BIOS(BASIC INPUT OUTPUT SYSTEM).It is a low-level environment the computer goes to before it loads the operating system. From here, many variables relating to the system’s hardware can be modified

Reboot the computer. As it powers up, watch for a screen which says “Settings” or something similar. You will need to press one of the function keys, usually F5 or F12. This will get you into the system’s BIOS and allow you to change the boot priorities.If you miss BIOS, the system will continue booting as usual. If you end up in Windows, shut down and try this step again.

Using the keyboard, navigate in BIOS to “boot options” and select the primary boot device to be the CD drive or USB media, depending on what you burned the ISO

STEP 4: INSTALL OS

If you are going right, you will see this..

7

Click on INSTALL UBUNTU. then it will show,

8

now

Click on SOMETHING ELSE option. then,

qp8cy

Select the FREE SPACE option created by you. AND, click on + sign shown at th bottom.

03_Filesystem

Ext4 journaling file system is for LINUX  as  ntfs is for WINDOWS.Its for storing, retrieving data. Adjust size of your choice, or don’t change it.

On Mount point ,Select /

A mount point is a directory (typically an empty one) in the currently accessible filesystem on which an additional filesystem is mounted

A disk partition is a defined storage space on a hard drive. There are three kinds of partitions: primary partition, extend partition, logical partition

Primary Partition and Active Partition:

A primary partition is in which an Operating System can be installed. One MBR hard disk may contain a maximum of 4 primary partitions. An active partition is based on primary partition. Any one of the 4 primary partitions can be set as active partition. Since there can be 4 primary partitions with 4 different Operating Systems installed, one of the partition that is marked active is used for the initial booting. The active partition contains the boot loader to load operating systems from a disk.

Logical partition and Extended partition

let’s say you want six partitions on a single drive. You’d have to create three primary partitions as well as an extended partition. The extended partition effectively functions as a container that allows you to create a larger amount of logical partitions. So, if you needed six partitions, you’d create three primary partitions, an extended partition, and then three logical partitions inside the extended partition. You could also just create a single primary partition, an extended partition, and five logical partitions — you just can’t have more than four primary partitions at a time.

 

Then, go ahead. Enter your name, password etc. on the next screen complete some simple steps and finally click install.

Ubuntu-on-VirtualBox-16

 

how-to-install-ubuntu-14-04-pic-16

STEP 5: CHANGE BOOT DEVICE

FOIP38CH337KLPR.MEDIUM

Set your BIOS boot order such that once again the hard drive is the primary boot device.

Restart your system and again go to BOOT SETUP as you did in step 3 and now select hard drive.
Note that if you skip this step, your system will try to load an operating system from removable media before looking for Windows. If there is not a disk in the drive, it should proceed to boot into Windows.

Step 6: Reboot and Configure

FJH53JXH337KLWF.MEDIUM

You will now see a choice between Windows and Ubuntu Linux. Go ahead and select Linux, and get yourself familiarized with this great OS.

WELCOME TO THE WORLD OF UBUNTU…..

fgg

*******************************************************************

NOW,THE Next Part……………

HOW TO RUN A C++ PROGRAM ON UBUNTU THROUGH CLI(COMMAND LINE INTERFACE i.e TERMINAL

Screenshot from 2016-02-01 16:35:27

$tep 1: Go to TERMINAL

make a directory let named ,test and then change the directory using commands

mkdir test

cd test

then, go to GEDIT OR VIM …these are the text editors for ubuntu there are
many more also..

you can install these via net or through UBUNTU SOFTWARE CENTER
furthur, write a c++ program in gedit and save it in test.

$tep 2: I AM HERE SHOWING A PROGRAM TO FIND FACTORIAL OF A NO.

Screenshot from 2016-02-07 18:48:55

here, ls command is for seeing list of programs in a particular selected directory…

.cpp is the extension on c++ file…….. I HAD SAVED THE PROGRAM BY NAME fact.cpp

g++ fact.cpp is for compilation

./a.out is for executing the program

…... YOU CAN RUN ANY OF your c++ program in this way, there is another example i m showing you here…

Screenshot from 2016-02-07 18:59:33

NOTE:

TERMINAL is CASE-SENSITIVE…

there is a command, clear used to clear the terminal

$truggles:

These are some of things i don’t know about while doing this, but later on after surfing on net.. I found these tasks quiet easy

  1. HOW TO MAKE A BOOTABLE PENDRIVE..
  2. What is basically an ISO file
  3. How to change our output file name i.e instead of a.out

Hope this will be helpful…. 🙂