ComTech: IT Support Stirling
TwitterFacebookGoogle

How to set up software RAID on Ubuntu 12.04


Today I will show you how to set up software RAID on Ubuntu 12.04.  It is always better to use hardware RAID over software RAID as this minimizes system resources but if you are installing Ubuntu 12.04 on a system where there is no hardware RAID available (ie older hardware) then this is the method you need.  This tutorial uses Ubuntu 12.04 but should work on all the major distributions.

For the purpose of this tutorial I will be using 2*500 Gb hard drives and setting up a RAID 1 array.

Boot the system from the Live CD.  Once booted up open up the terminal as we need to check what our two disks are called so type:

sudo fdisk -l

Write down the designations of the two disks (e.g /dev/sda) as we are going to need these later.

Now we need to install a couple of packages.  The first we need to install is gparted so type:

sudo apt-get install gparted

The next is mdadm so type:

sudo apt-get install mdadm

Ok now we need to create partition tables and filesystems on our disks and we do this by using gparted.  In the terminal type:

sudo gparted

which will open up gparted as root allowing you to modify the partitions on the disks.  On both disks create a whole disk partition with ext4 as the filesystem.  This tutorial will show you how.

Once that is done you can close down gparted and we can go about setting up the array.

In your terminal type the following:

sudo mdadm –create –verbose /dev/md0 –level=1 –raid-devices=2 /dev/sda /dev/sdb

NOTE: There are two dashes infront of create, verbose, level and raid

In the above command:

level=1 is the raid level (in this case Mirror)

raid-devices=2 is the number of hard disks in the array

/dev/sda and /dev/sdb are the disks to be used (obtained earlier using fdisk)

If successful then you should get mdadm: array /dev/md0 started

Now we just to check the array so in your terminal type:

mdadm –detail –scan (again using two dashes)

This command should return details of the array we have just set up.

Now on to the install.  You need to install Ubuntu 12.04 the usual way from the CD until you get to the disk partitioning section where instead of using the default “Use entire disk” choose Manual.

When you choose Manual you should see /dev/md0 as one of the available disks.  You will need to specify a mount point (/) and a swap file onto it and then choose it to install Ubuntu 12.04 onto.  Follow the wizard for the rest of the install.

Once Ubuntu 12.04 has been installed reboot the system and you should now have a RAID 1 array set up.

About the Author

P1020114

Hi I am Chris Wakefield the owner of ComTech IT Support. I provide Windows and Linux based IT Support, laptop repairs and computer repairs to both business and personal clients throughout Stirling, Falkirk and Clackmannanshire.

For a list of what I can offer you why not visit my website www.comtech247.net where you will find a list of my services, testimonials, blog and much more!!

 

 

How to format a hard drive using GParted


Yesterday I showed you how to format a hard drive using FDisk but a lot of people are not comfortable using the command line so today I will show you how to use GParted – which uses a GUI.

For the purpose of this tutorial I will be using GParted on Ubuntu 12.04 and formatting a 131Mb USB penstick (remember those!!) with ntfs.  GParted is not installed by default on most Linux distributions so either download and install it using your package manager or open up a terminal and type:

sudo apt-get install gparted

Type your password when prompted.  When you open up GParted you should get a screenshot similar to the one below.

First thing we need to check is that the hard drive is not mounted so highlight it, right click and go to unmount.

Now we need to clear any existing partitions on the hard drive so again highlight the drive and click on Delete the selected partition (shown below).

Now it is time to make a new partition so click on Partition and then New.

For the purpose of this tutorial I will be using the whole device and changing File System to ntfs.  When you are happy click Add.  You will then be asked to confirm your selection.

All that is left to do is apply the operation so click on Apply All Operations (shown below)

GParted will now format the hard drive and install the ntfs file system on it.

About the Author

P1020114

Hi I’m Chris Wakefield the owner of ComTech IT Support. I provide Windows, Mac and Linux based IT Support to small businesses in Stirling, Alloa and Falkirk.

Follow @Comtech247 on Twitter

 

How to increase the size of your hard drive without losing any data


Finally got round to it.  I have managed to increase the size of my hard drive without losing any data.  This was accomplished by using Clonezilla and a newer 160Gb hard drive to replace my old 40Gb hard drive (remember those).  The way my system is set up is that the operating system (Linux Mint 12) sits on a nice little 40 Gb hard drive while all my files are located on a second 500 Gb hard drive.

The Plan

1. Change hard drives over to the bigger 160 Gb drive.

2. Do not lose any settings or programs (All my files are on the second hard drive and are safe)

3. Repartition the new drive to take into account the bigger size.

What happened?

1. I connected up the new 160 Gb hard drive while leaving the old one in place (it will be removed later).

2. The best tool I have come across to take an image is Clonezilla so I decided to use it. The existing Linux Mint 12 image on the 40 Gb hard drive was caught and saved on the 500 Gb drive (10 mins to image a 40Gb hard drive).  You can use this tutorial on how to use Clonezilla to take a system image.

3. I booted the system with the Clonzilla Live CD and restored the Linux Mint 12 image onto the new 160 Gb hard drive.  I then restarted the system and voila everything is there.  All my programs and settings have been copied across to the new hard drive.

4.  All that is left to do is use a Linux Mint Live CD to boot the system and use GParted to  repartition the new drive taking into account the extra space.  Now I had to delete the swap partition (remember the size) resize the system file partition and then recreate the swap partition again.

5. I now have my Linux Mint 12 operating system , with all my programs and settings, running on the new 160 Gb hard drive.  Lovely!!

About the Author

Hi I am Chris Wakefield the owner of ComTech IT Support. I provide Windows and Linux based IT Support, laptop repairs and computer repairs to both business and personal clients in and around Stirling.

For a list of what I can offer you why not visit my website www.comtech247.net where you will find a list of my services, testimonials, blog and much more.

Formatting a hard drive in Linux


Imagine the situation.  You are using Linux and you want to format a particular hard drive.  What tool would you use?  If you like GUI’s then the best tool to use would be GParted.  But what if you think that GUI’s are not your thing and you want to use the command line?  Then you want fdisk.

Ok here goes, open up a terminal and type su.  When prompted enter your root password.

Type fdisk /dev/device (where device is the ID of your hard drive you want to format eg sda)

Next you want to check for any existing partitions on the drive by pressing p.

You now want to delete any existing partitions by pressing d.

Press n to construct a new partition on the hard drive.

When you get the choice of specifying cyclinders use the default for first and last (unless you have a specific need to change them).

Now we need to write the partition to the disk and we do this by pressing w.

It is now time to make the filesystem on the partition.  First off though you have to choose the file system you want.  At the moment the best one to use in Linux is ext4.  If however you intend to use the hard drive with Windows at some point then use NTFS.

In your terminal type mkfs -t ext4 /dev/device (where device is the ID of your hard drive you want to format eg sda).

All that is left to do is mount the hard drive.  If the hard drive is an external one then it will be automatically mounted when you plug it in.  However if the drive is an internal IDE or SATA drive you will need to enter it into the fstab file which is covered here.

About the Author

P1020114

Hi I’m Chris Wakefield the owner of ComTech IT Support. I provide Windows, Mac and Linux based IT Support to small businesses in Stirling, Alloa and Falkirk.

Follow @Comtech247 on Twitter

 

 

 

 

 

CyberChimps
Follow

Get every new post delivered to your Inbox

Join other followers

WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera
WP Like Button Plugin by Free WordPress Templates