Is it possible to create raid-0 without losing data?

5,924

With RAID 0, your data is split in half (evens and odds) between the drives. In other words, there are chunks 1, 3, 5, .... etc. on the first drive, and a second group of chunks 2, 4, 6, etc. are on the second drive. If one of the drives dies, you've instantly lost 50% of the chunks. Imagine opening up your program and deleting every other line out of it. That's what happens when you lose a striped disk. Depending on the stripe size, you may be able to recover some data or even whole files out of the remaining disk (it's very possible that a 10KB file would be completely intact on one disk since your blocks should be larger than that). However, a file that's ten times your block size would have 5 blocks on each disk, meaning you just lost 50% of your file.

Important to note that you can't set up RAID 0 without formatting (initializing) the drives as RAID 0. You would have to back-up your data before creating the raid.

Share:
5,924

Related videos on Youtube

Akhil
Author by

Akhil

https://akhil.io/portfolio

Updated on September 18, 2022

Comments

  • Akhil
    Akhil almost 2 years

    My linux root OS device is /dev/sda, and my external hard drive is /dev/sdb (empty drive)

    I don't want to loss data on /dev/sda, and setup raid level 0.

    Is this possible?

    • frostschutz
      frostschutz almost 6 years
      Possible, but not advisable...
    • Mark Plotnick
      Mark Plotnick almost 6 years
      Raid 0 on ordinary disks is only advisable when you either have good backups or don't care about losing all your data. (I've seen raid 0 on top of multiple small raid 5 arrays, and it was only done because the users couldn't afford a proper large array). It sounds like you care about losing data; do you have backups?
    • Akhil
      Akhil almost 6 years
      Even if we have single disk, data loss is there...so what is the difference having a single disk or having raid-0 with 2 disks...?
    • Jeff Schaller
      Jeff Schaller almost 6 years
      With 2 disks in raid 0, you get twice the chance of data loss!
    • Akhil
      Akhil almost 6 years
      I am using just for testing to increase performance...How much probability can i expect of data loss (ie: 50%)and i which cases it to happen..
    • dr_
      dr_ almost 6 years
      That's impossible to tell. As @JeffSchaller wrote, with two disks on RAID 0 your probability of data loss is the double of what you would risk if you used the disk in a normal way.
    • Kusalananda
      Kusalananda almost 6 years
      Just to clarify, the question is about setting up two disks in a RAID-0 configuration while at the same time not wiping one of the disks, right?
    • Akhil
      Akhil almost 6 years
      Yes ... you are right .. but these are precautions before proceeding with the process ... @Kusalananda
    • ilkkachu
      ilkkachu almost 6 years
      @dr01, or, assuming they have two disks to begin with, using them as RAID-0 means that all the data is lost if either drive fails, while if using them as independent drives, a failed drive will only lose the data on that drive. With software RAID, one could run both a RAID-1 array and a RAID-0 array on a single pair of physical drives, to get redundancy for important data, but an easily accessible common space for non-important data. Of course, everyone will have to weigh the actual probabilities against their own experience, and how important they consider their data to be.
  • Akhil
    Akhil almost 6 years
    So its just same as using single disk(about losing data)....because here raid-0 is just a utility for using them as one.....that's it...so it is not increasing probability of losing data...Its just our fear loss or some tech phobia...right?
  • Admin
    Admin almost 6 years
    Hi @Akhil J. When you create the raid array it will erase the data currently on the drives you are using to build the "odds and evens" so you need to backup the data
  • Admin
    Admin almost 6 years
    By the way. RAID 0 has zero redundancy, meaning if only one of the disks fail, and you have lost all your data. I encourage you to find alternative solution for backing up your data such as RAID 1.where you can just convert your disk to dynamic, add the new disk and mirror it within disk management. You don't lose any data that way, unless you do something wrong.