ComTech » fdisk http://comtech247.net Need your computer or laptop fixed? You have come to the right place!! Thu, 04 Apr 2013 10:47:55 +0000 en-US hourly 1 http://wordpress.org/?v=3.5.1 How to set up RAID 1 on an existing Linux system http://comtech247.net/2013/01/07/how-to-set-up-raid-1-on-an-existing-linux-system/?utm_source=rss&utm_medium=rss&utm_campaign=how-to-set-up-raid-1-on-an-existing-linux-system http://comtech247.net/2013/01/07/how-to-set-up-raid-1-on-an-existing-linux-system/#comments Mon, 07 Jan 2013 13:58:11 +0000 Chris http://comtech247.net/?p=3862 Continue reading ]]> Recently I did a tutorial on how to set up RAID 1 on a new Linux system.  Today I will show you how to set up RAID 1 on an existing system.  Why I hear you ask on an existing system? It is true that, if possible, you should set up RAID on a server during installation however there are times that you can’t (only one hard disk present or the person installing didn’t know the correct procedure so chose not too instead).


The method I am going to show you involves using a piece of software called Clonezilla, which is opensource cloning software, so you will need to get your hands on it. You can download it from the Clonezilla website.

For the purpose of this tutorial I will be using Ubuntu 12.04 installed on a 500 Gb hard drive.  I will clone the installation using Clonezilla and then set up a RAID 1 array on two new 1 Tb hard drives.  Once the RAID 1 array has been set up I will then copy the Ubuntu image onto it.

Lets get started.  First thing to do is to BACKUP ALL YOUR DATA.  Even though you are effectively backing up your data when you image it I always recommend you backup your data using a different method just incase something happens.

Now onto imaging your system.  I have already written a tutorial which covers the required steps so rather than repeat myself please refer to the Clonezilla Tutorial for the method.

Once you have imaged your system connect your two new 1 Tb hard drives and disconnect the old 500 Gb one and again reboot the system using the Clonezilla Live CD.  Go through the menus the same as before until you get to the screenshot below.

Clonezilla1

 

This time instead of choosing Start_Clonezilla choose Enter_Shell.  Once at the shell we need to check our two new disks 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 create partitions and filesystems on the two disks and we do this by using fdisk.  The steps required to accomplish this are covered in How to format a hard drive on Ubuntu 12.04 using fdisk.

Now we need to install a package called mdadm which we shall use to set up the RAID 1 array so type:

sudo apt-get install mdadm

Once installed 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.

All that is left to do is to exit the shell and resume Clonezilla so in your terminal type:

exit

which should return you to the screenshot we had earlier.  This time choose Start_Clonezilla.

Follow the wizard to install your saved image onto the new RAID 1 array.

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.

 

 

 

 

]]>
http://comtech247.net/2013/01/07/how-to-set-up-raid-1-on-an-existing-linux-system/feed/ 0
How to format a hard drive on Ubuntu 12.04 using Fdisk http://comtech247.net/2012/07/04/how-to-format-a-hard-drive-on-ubuntu-12-04-using-fdisk/?utm_source=rss&utm_medium=rss&utm_campaign=how-to-format-a-hard-drive-on-ubuntu-12-04-using-fdisk http://comtech247.net/2012/07/04/how-to-format-a-hard-drive-on-ubuntu-12-04-using-fdisk/#comments Wed, 04 Jul 2012 19:51:45 +0000 Chris http://comtech247.net/?p=2662 Continue reading ]]> Today I will show you how to format a hard disk using Fdisk.  Fdisk comes already installed on most modern Linux distributions by default.

For the purpose of this tutorial I will be using Fdisk on Ubuntu 12.04 to format a 16Gb USB penstick with the ntfs file system.


First we need to see what our 16Gb USB penstick is mounted as so open up a terminal and type:

sudo fdisk -l

and type your password when prompted.  You should get a screenshot similar to the one below.

In this case my 16Gb USB penstick is mounted at /dev/sdc1.

Next type:

sudo fdisk /dev/sdc1

and you should get the command prompt shown below.

Now we need to check the existing partitions on the penstick so type:

p

to get the screenshot below.

Now we know what is on the drive it is time to delete it so type:

d

You will then be asked for the partition number (1-4).  In my case I have 4 partitions on the disk and I need to delete them all.  So I will type 1 and this will erase the 1st partition only.  I would then be left with partitions 2 – 4 and to remove these I would repeat the procedure until all the partitions have been erased.

We now need to set up the new partition so in your terminal type:

n

Because this is the first partition on the drive type:

p

You will now be asked for a partition number.  Choose 1 and then press return.  When asked to specify the First Sector choose the default by pressing Return.  Again accept the default Last Sector by pressing Return.

Now that the partition parameters have been specified we need to write them to the hard drive and we do that by typing:

w

All that is left to do is to make the filesystem on the hard drive and to do that we type:

sudo mkfs -t ntfs /dev/sdc1

Next time I will show you how to accomplish the same task using GParted (for those who like a GUI).

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.

 

 

 

 

 

 

]]>
http://comtech247.net/2012/07/04/how-to-format-a-hard-drive-on-ubuntu-12-04-using-fdisk/feed/ 2
How to recover data using a Linux Live CD http://comtech247.net/2012/01/03/how-to-recover-data-using-a-linux-live-cd/?utm_source=rss&utm_medium=rss&utm_campaign=how-to-recover-data-using-a-linux-live-cd http://comtech247.net/2012/01/03/how-to-recover-data-using-a-linux-live-cd/#comments Tue, 03 Jan 2012 07:38:07 +0000 Chris http://comtech247.net/?p=376 Continue reading ]]> I have touched on this in a previous post but today we will have another more detailed look at how to recover data using a linux live CD.  Live cd’s can be easily downloaded off the internet and most distributions now have one.  For the purpose of this tutorial I have used a Linux Mint 11 live DVD which acts in exactly the same way.

The data recovery procedure is as follows:

1. Load a live CD / DVD and wait until the desktop environment is visible.

2. Open up a terminal and type sudo fdisk -l.  Write down where your partition is installed e.g /dev/sda1.

3. Next type sudo mkdir realroot.  This will make a directory on the desktop.


4. Next type sudo mount /dev/sda1 realroot (replace /dev/sda1 with the ID of your device obtained in No 1 above).  You should now be able to see your hard drive on the desktop.

5. Browse your hard drive to find the folders where your data is saved.  Locate your data and save to an external hard drive.

About the Author

Hi I am Chris the owner of ComTech. I provide IT Support, Laptop repairs and Computer repairs to both personal and business 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 my blog, testimonials, services and much more.  Start supporting a local business today so I can start supporting you.

If you found this blog useful then why not sign up to my RSS Feed for news, tutorials, views and general techie stuff!!

 

 

]]>
http://comtech247.net/2012/01/03/how-to-recover-data-using-a-linux-live-cd/feed/ 2
Formatting a hard drive in Linux http://comtech247.net/2011/12/01/formatting-a-hard-drive-in-linux/?utm_source=rss&utm_medium=rss&utm_campaign=formatting-a-hard-drive-in-linux http://comtech247.net/2011/12/01/formatting-a-hard-drive-in-linux/#comments Thu, 01 Dec 2011 12:53:13 +0000 Chris http://comtech247.net/?p=232 Continue reading ]]>

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

Hi I am Chris the owner of ComTech. I provide IT Support, Laptop repairs and Computer repairs to both personal and business 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 my blog, testimonials, services and much more.  Start supporting a local business today so I can start supporting you.

If you found this blog useful then why not sign up to my RSS Feed for news, tutorials, views and general techie stuff!!

 

 

 

 

]]>
http://comtech247.net/2011/12/01/formatting-a-hard-drive-in-linux/feed/ 1
How to restore the grub bootloader http://comtech247.net/2011/11/29/how-to-restore-the-grub-bootloader/?utm_source=rss&utm_medium=rss&utm_campaign=how-to-restore-the-grub-bootloader http://comtech247.net/2011/11/29/how-to-restore-the-grub-bootloader/#comments Tue, 29 Nov 2011 11:30:10 +0000 Chris http://comtech247.net/?p=134 Continue reading ]]>

You know that feeling. You turn on your computer and it attempts to load but nothing happens.  It just hangs.  This tutorial will teach you how to restore the grub bootloader so that everything works again.

Ok the first thing we need is a Linux live CD, any distribution will do.  Insert the Live CD and allow it to load.  Once loaded you need to open a terminal.  We need to find out where your linux partition is installed so type sudo fdisk -l.  You will get a response similiar to;

Device         Boot Start     End     Blocks Id System
/dev/sda1     1    60801   48838  4001  83 Linux

Make a note of this as we will use this later.

Next we need to make a directory on the desktop and mount the partition where Linux is installed

so type sudo mkdir realroot.  Then sudo mount /dev/sda1 realroot.  You should now see your partition mounted on the desktop.

Last thing is to re-install grub into the partition.  We do this by typing sudo grub-install –root-directory=realroot /dev/sda.

And that is it.  Make sure you type sudo where stated above as you need to perform these commands  as root.  Close down the system and reboot.

If you found this blog useful then why not sign up to my RSS Feed for news, tutorials, views and general techie stuff!!

At ComTech I work with both Linux and Windows.  I can advise on setting up servers, networks (home and business) or sort out those little gremlins you might have.  Go to www.comtech247.net/contact-us for some good old fashioned advice.

]]>
http://comtech247.net/2011/11/29/how-to-restore-the-grub-bootloader/feed/ 6