“In order to see truth, we must be able to tolerate it.”
August Sandler

Homemaid RAID (Part4) – Drives, Partitions & Devices


Now that we have the Ubuntu server installed and a graphic interface to feel comfortable we can get on with preparing the hard-drives for setting up the RAID.


I will be addressing devices numerous times, but for now suffice to say that Ubuntu (and Linux in general) seems to have a very straightforward approach for representing devices in the operating system. You will find a directory in the root file-system called ‘DEV’ and in it many files. These files all represent devices. Hard drives are devices, partitions are devices and even the RAID we will create is a device. More on this as we move along.

Hard Drives

I have 5 hard drives installed on my configuration: 1x160GB drive for the Ubuntu Server Operating System and 5x750GB drives for the RAID5 storage. These drives all appear in the operating system as devices called that are prefixed with “sd” (Sata Drive). “sda” is the first hard drive, “sdb” is the second and so on. So I have these devices

  • sda -> 160GB (operating system hard drive)
  • sdb -> 750GB (disk 1 for RAID5 storage)
  • sdc -> 750GB (disk 1 for RAID5 storage)
  • sdd -> 750GB (disk 1 for RAID5 storage)
  • sde -> 750GB (disk 1 for RAID5 storage)

I have encountered one problem which I have not yet resolved. I am mentioning it because it will become important some time in the future and I hope to resolve it by then. The question is how are the hard drive devices mapped to the actual hard drives? Which physical drive is “sdb”? This is important because when hardware maintenance will be required – I will need to know which physical drive is referred to by the devices. Unfortunately it doesn’t seem to be a simple linear match – 1st SATA port -> sda. 2nd SATA port -> sdb.

I know this because I had to first setup the RAID with only 3 RAID hard drives, the 4th was added later. When I installed the 4th hard drive it seemed to shift the drive mapping and it became sdb. I say seemed because I cannot knwo for sure. This may have been caused by the fact that it was already partitioned as a Windows drive and Ubuntu recognized it (I could access all the information on it after hooking it up to the Ubuntu server machine).

So, if anybody has in insight on this I would love to hear it.


As you may already know hard drives are not used as is – they need to be partitioned. Partitions represent a space on the hard-drive. A hard drive can be partitioned into numerous partitions or be left as one large partition. In either case it needs to be partitioned. If you reached this point in the installation successfully – then your first hard drive, the one containing the Ubuntu operating system is already partitioned and formatted. The installation process did this for you.

I would like to bring your attention to one small issue and choice that I made.The question is raised here – how should the partitions be defined – should I (a) use the entire drive or (b) just a part of it? I chose to go with (b) and here is why:

  • You are explicitly telling the operating system to place a partition table on the hard drive. A partition table is a place where information is stored on the hard drive. Though it seems logical that a partition table would exist even if you use the entire drive – I decided to play it safe (the price in actual storage space is neglible).
  • Actual hard drive sizes may vary. that “750GB” measurement is not precise – the actual size may vary – as it is a function of the hard drive architecture (plates, sectors…). So in a few years when I may need to replace one of my hard drives – and purchase a new one – the new one may vary in actual size.

I opted to create partitions that are slightly smaller then the actual space available on the hard drive – I believe my margin was of about 400MB. When I used GParted to do this it did not prompt me for a physical size – instead it asked for what seemed like a count of sectors (I don’t recall exactly what it was!) – so I chose a number (715,000) and used is consistently with all the drives. Make a choice and be consistent with it. Also make a note of it for future reference.

To partition your hard drives you will need some kind of partitioning tool. I chose to use GParted which I invited you to install in the previous post. It is a fairly straightforward tool. You select the device you want to view (and you will see the devices we just discussed) and then you can delete, create and modify partitions on that device as you see fit.

IMPORTANT: A feature to note about GParted is that it doesn’t actually execute your command. When, for example, you ask to create a partition – that command is queued and will appear in the lower part of the application window. It has not yet been executed. You need to actually tell GParted to apply your commands. This is useful because some of the commands can take a while to process – this way you can partition all your RAID hard drives and then just let GParted do it’s thing.

There are of course additional partitioning tools (including some command line classics) – you are welcome to read around and make your own choice. GParted did the job for me.

When your partitions have been created you will find you have new devices. Each partition becomes a device. I have these partitions:

  • sda1 -> created on the sda drive device (by the Ubuntu installation)
  • sda2 -> created on the sda drive device (by the ubuntu installation I didn’t inquire why there are two)
  • sdb1 -> created on the sdb drive device
  • sdc1 -> created on the sdc drive device
  • sdd1 -> created on the sdd drive device
  • sde1 -> created on the sde drive device

You can see all the partition and hard drive devices if you browse the ‘DEV’ folder down to the letter “s” : )

Ready for RAID

Now with the partitions setup on the hard drives we can continue to setup the RAID. The RAID is actually created across the partitions and not directly on the hard drives. So just to recap:

  • We have 4 hard drives (or whatever number you installed – minimum 3 for a RAID5 configuration)
  • We have 4 partition tables (one on each drive). The tables contain information on ->
  • 4 Partitions that have been created on each of the hard drives that we will now ->
  • assemble into a single RAID5 device.

Again I invite you to review this link to prepare yourself for the actual RAID setup. You may find that you wish to proceed with a different RAID configuration. I will walk through the steops that I did for installing RAID5.

Coming next – using ‘mdadm’ to create a RAID5 device.

This entry was posted in Coming Through, outside, Tech Stuff. You are welcome to add your comment

Leave a Reply