InstallUbuntu

From FreekiWiki
Revision as of 10:12, 11 July 2012 by Kurtk (talk | contribs) (revision, not final yet)
Jump to navigation Jump to search

How to install Linux

This document explains how to install the Linux operating system on a new disk. And explores a few other options.

Upgrading to a new disk, Linux already installed on existing drive

If there is a functional operating system on an existing disk, the new disk can be installed as a second drive and there is no need to reinstall Linux. The process involves partitioning the disk (Wiki page coming, skeletal instructions follow in the document), and (optionally) linking the new disk to a folder on the existing disk.

If a good copy of Linux exists on the old drive all that's required is to move everything to the new drive, many times a new drive will come with a bootable migration CD. Not all support Linux, but many do. There are also downloadable tools that can do the job if the migration CD won't, or the migration CD is missing.

Many times the best bet is to install a fresh copy of Linux onto the new drive and then copy any needed data files from the old disk to the new. This will also mean that programs and packages will need to be reinstalled in the fresh copy.

To install Linux from scratch

It is recommended that any hard drives not involved in the installation be disabled, since the imaging (installation) procedure wipes the disk. Accidentally installing on the wrong disk can ruin one's day.

At Free Geek

Boot from the internet and choose to install the desired version of Linux from the menu that is presented. You may be asked a question or two during the installation process. YES is usually the right answer.

At home or some other location

It will be necessary to burn an installation disk from an .iso file. An .iso file is in a format that is a bit by bit representation of the CD to be burned. Using an .iso file will create a bootable CD. Most CD burning programs recognize an .iso file and will automatically burn it correctly. Some programs require that an option be selected to burn a disk image.

The .iso file can be obtained from the Linux distribution website. For Ubuntu, it is [1]www.ubuntu.com. Download the file and burn it to a CD. The CD can be burned on any operating system.

Then boot from the CD and follow the instructions.


Installing a Linux/other dual boot system

Refer to Wiki (in progress)

Trouble shooting

CD won't boot

The burning program didn't burn in image mode. Loading the CD into in a functional machine will display a single file with an .iso extension. Burn it again making sure the burning program knows it is burning an image.

Burn failure that wasn't reported.

Burned to a R/W disk and computer doesn't support booting from R/W disk (older machine).

Confusion answering questions and Linux didn't install correctly

Boot from the CD again and start over. If it asks to allow it to erase partitions (or format the disk, or something else along these lines) say Yes.

Addendum

The following information has not been tested and is therefore likely in error!

TODO

How to determine the name of the new drive/partition. I think I used df. How to explain the drive you booted from (I called it the running drive, but there's got to be a

better term).

Partitioning a disk to use as a second drive

Several programs exist for this task. Some even on different operating systems. A very popular one is Partition Magic. To use a partioning program on a different computer, just temporarily install the new drive, and then move it to the Linux machine after the partition is created.

For Linux use, most programs are a variation of either parted or fdisk. A nice graphical version is GParted, available for installation via synaptic or apt.

Start the application and choose the new drive. Most partitioners will not allow modifications to the drive the machine is running from. But attempting operations on the running drive can cause a warning that the file system will be destroyed. Believe them, they are telling the truth.

The best bet is to make the entire drive a single partition. Use the msdos type partition table. Use ext4 as the type if supported, otherwise ext3. Don't make the drive bootable, don't create a swap partition, don't enable RAID. If something doesn't make sense, don't select it. GParted defaults work just fine.

Making the new drive appear

The new drive won't appear until it is mounted. To make it mount each time the machine is booted, it's required to add the drive to a mount table. The simplest way is to add it to /etc/fstab.

Exercise extreme care, only add the line for the new disk and don't change anything else. Editing /etc/fstab requires root privileges. Making a backup copy (with the cp command) will be done first in case something disastrous happens.

sudo cp /etc/fstab /etc/fstabBAK <provide password when asked> sudo nano /etc/fstab

Add the following line:

/dev/sda1 /newDrive ext4

A bit of explanation of the above. /dev/sda1 is the name of the new drive. It might vary.

/newDrive is the name of a directory where the drive will be mounted (known as a mount point). The naming of a mount point is arbitrary, /newDrive is used for illustration purposes.

After exiting nano, it's necessary to create the mount point. <userid> should be the default user of the machine. Text after # are comments and need not be entered:

sudo mkdir /newDrive #creates mount point sudo chown <userid> /newDrive #makes the owner of the mount point <userid> rather than root

The next step is to actually mount the drive. This also serves to test the change made to fstab.

sudo mount /dev/sda1

If this fails, something is wrong with /etc/fstab. It must be fixed before the next steps can betaken. The backup copy (/etc/fstabBAK) can be used to start over.

Linking the new drive to the existing drive

It's possible to just use the new drive as a totally separate drive and there's nothing to say one shouldn't. But many times it is more convenient to use the second drive as an extension of the primary drive. To accomplish this:

Note that folder and directory mean the same thing. Command line users tend to use the term directory and it's reflected in the (abbreviated) names of the commands.

cd #this changes to the home directory. Link can be created in any directory desired
ln -s <name you chose> <mount point name>

Example, links a new folder in your home directory (named moreDataStorage) to the new disk

cd
ln -s moreDataStorage /newDrive


The example will create a folder named moreDataStorage in the users home directory that is in reality using the new drive.

The folder moreDataStorage can now be used just like it lived on the primary drive, but the entire new drive is available for its data.