Linux RAID

  • This guide is a “nutshell” (Brief guides) script that assumes a reasonable level of Linux proficiency & understanding & is not geared to a particular Linux or specific instructions
    Lots of Googleable Entries such as green COMMANDS should help : )_
  • I am assuming an already running LINUX system of recent origin (I use MINT, an Ubuntu/Debian derivative) on a drive all its own, NOT RAID, possibly a small SSD of 64GB and the addition of 2 EMPTY identical drives to be put in RAID1 formation (Mirrored, that is 2 identical drives ‘combined’ redundantly into one for DATA use)
    NOT for Operating System Boot use in this guide.
  • Do not use BIOS RAID or  Hardware Raid this is all Software Raid done by LINUX
  • TEST ALL THE DRIVES that will be used including any Operating System drives using their S.M.A.R.T. facility. IE: GSMARTCONTROL GUI
  • If the drives are over 2TB in size (and perhaps even if they are not) they must be configured, partitioned and formatted using GPT not old style MBR (Master Boot Record) This works even on old PC architecture without EFI else you will not see outside the 2TB boundary : )
  • Using “PARTED” utility (Do not use FDISK) 
  • “label” the disk “gpt” as per instructions. Create conventional ext4 partition on EACH drive using the whole partition ideally,
  • Check whether you have RAID utility: “MDADM” and if not, get it.
  • Check What You Have Got: lsblk AKA: “LiStBLocK”
  • Check whether something raid like is around yet (Not as silly as it sounds while we are experiment:)
    cat /proc/mdstat
  • Know the Device Names then use this command:
    $sudo mdadm –create –verbose /dev/md0 –level=1 –raid-devices=2 /dev/sda /dev/sdb
  • above assumes devices were /dev/sda, /dev/sdb. But you knew that..
  • on another console, run : cat /proc/mdstat
  • This will show you the ongoing Mirroring Process-
  • a new ‘device’ will now exist: /dev/md0 as specified above. You can mount this like so on an existing Mount Point:
  • mount /dev/md0 /mnt/raid
  • I use no Options as things seem to get Auto detected nicely. 
  • TO make it auto mount add entry to /etc/fstab- Use “blkid” to find its UUID which is the correct way to Mount stuff in Linux
  • YOu can use the device IMMEDIATELY after issuing the last “mdadm” command above and mounting the array- It can simultaneously be written to while mirroring but the drives will be VERY VERY BUSY and in my case, overheated while doing so!
  • I use the “HDDTEMP” utility to check drive temperatures:
    Example: sudo hddtemp /dev/sd[a-b]  
  • Use advanced  features of SMARTMONTOOLS to Email or Notify you if SMART monitoring notices drive degradadtion,
    Not Covered Here
  • Use “NETHOG” to watch how the server is being used by the Network
  • To Be Continued. Enjoy!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.