Can the drives in a RAID 1 array be rotated?

6,282

Solution 1

Yes, this is possible, but not the best possible idea. A far better thing to do would be to purchase a NAS that allows you to connect an external hard drive to write backups to. This way you could connect a drive via USB (or eSATA, or whatever), your NAS could back itself up to the drive, then you could disconnect the external drive again until your next backup.

However, if you're hell-bent on attempting to rotate drives in and out of the array, the safest way to do this is to use the following procedure:

  1. Shut down the NAS
  2. Remove the drive you want to store
  3. Start up the NAS
  4. If your NAS does not allow for hot-swapping drives: Shut down the NAS again
  5. Insert the new drive
  6. If you shut down the NAS in step 4: Start up the NAS
  7. Initiate the RAID rebuild, if it's not possible to do automatically.

Shutting down the NAS in the first step is important to ensure that all your data is consistent.

Starting it back up is vital to ensuring that your rebuild goes correctly. This is what allows your NAS to know that a drive is missing, your RAID is "degraded", and most importantly -- which drive is left. If you put in the replacement drive before the NAS knows this, there's a possibility that it won't know which drive contains the correct data. Remember: The replacement drive you've put in was a member of the same RAID array too. Unless the NAS has some sort of special metadata to let it know which one is "newer" and therefore the "real" drive, it may not know what to do.

Solution 2

I like the D-Link NAS; just bought one a few weeks ago and set it up RAID 1 just like you as well.

It is my understanding that the D-Link NAS RAID 1 operates the primary drive and mirrors to the second in this way; I also notice that apon read it appears it reads off of both drives for speed; however this may be incorrect and it may just be checking for consistancy.

RAID 1 is therefor setup that if either of the drives fail; the second (hopefully working drive) is then used as the primary, until the failling drive is replaced; where by the controller writes all the good info (ie 2nd drive) to the new unformatted or 'other' drive (drive 3 or perhaps if you fixed drive 1 say with SpinRite you could use that). This process would happen automatically with the controller... just don't move drives around until the data is written to the new drive other wise it is possible the controller could loose track and reformate your old drive and your data is gone!

This says to me that yes you could swap in and out 3 or 4 or more drives for additional redundancy as you cannot use a second NAS in any RAID config as of yet (you would need a Network RAID controller; not sure if this exists) and the NAS would just make sure the new drive you inserted is mirrored the same as it's "Primary"

Key notes:

  • don't remove a drive while Writing/ avoid while reading
  • HDD get writen to and read from time and time again on a regular computer usage; think every time you visit a webpage; read email; download; save a file; if you are using one for back-up it is prettymuch 'almost' safe to assume it's being used less than your normal CPU HDD(s) so the life expectancy is higher
  • that's why you are using multiple drives for the redundancy so that if one fails you have backups... not sure that reformat or full data writing lessens the life cycle; it will take longer and longer as your data adds up; You'll have to experiment but a Disk is only magnetized info so putting it on (0's and 1's) and taking it off is what it is designed for.
  • Nice feature with the D-link NAS is that it allows you to enter the disk 'shutdown' time for non use which is nice for back-ups and occasional use as it is still available on the Network all the time but the Drives don't have to be spinning if you not using them!
Share:
6,282

Related videos on Youtube

Nicole
Author by

Nicole

Full stack software engineer. I've mostly used Java, Python, C, Javascript, HTML/CSS, and SQL. I work remotely and live in Utah with my beautiful girlfriend Kerstin (with whom I try to talk about software engineering as little as possible) and our kids. I'm a passionate feminist and social change activist.

Updated on September 17, 2022

Comments

  • Nicole
    Nicole over 1 year

    As a follow-up to my question https://superuser.com/questions/247070/disaster-recovery-backup-of-files-photos-for-personal-use, it sounds like for personal disaster-safe backup, multiple rotated hard drives is the way to go.

    One of the answers suggested a NAS RAID setup, so after some searching I found a very affordable product that looks really cool, the D-Link 2-bay network storage enclosure.

    However, this NAS has some pretty cool features that I would love to use and not just lock away in a box, such as becoming my streaming location for Xbox, etc. It is a 2-bay enclosure, so what I am thinking is that I can buy 3 drives, and keep two of them in the NAS, and one in the fire-proof safe. I would rotate them weekly.

    Is this possible with a RAID-1 array? Would it have to wipe the whole drive to rebuild it every time? Does the rebuilding happen automatically? And last question, if it does have to rebuild the whole partition on the drive every time, would this excessive writing reduce drive life?

    • Rex
      Rex about 13 years
      what are you trying to accomplish with this? RAID is not a backup solution..
    • Nicole
      Nicole about 13 years
      @Rex How is RAID-1 not a backup solution? Feel free to follow the link in the first paragraph to find out what I'm trying to accomplish.
    • Rex
      Rex about 13 years
      serverfault.com/questions/2888/why-is-raid-not-a-backup That being said, from your previous post, you are using the NAS as a backup device and what you are really looking for is a backup to the backup. Why not look to buy cloud storage (EC2/etc) from somewhere and host your NAS backup there?
    • Nicole
      Nicole about 13 years
      @Rex thanks for the link, that makes sense and it's good to be aware to make sure all angles are covered. As far as EC2, it's simply way too expensive. I'm looking to back up 300GB for personal use and growing, and even though, since it's backup, it would be mostly writes and not reads, it's still just not worth the monthly storage cost compared to how many hard drives I could backup to locally. In addition, the initial upload would take forever, and I might get a call from my ISP wondering WTF I am doing.
    • Rex
      Rex about 13 years
      Can also look at crashplan - If you want to look at swapping disks and letting your mirror rebuild all the time, i suppose that could work - problem is it's a manual process prone to forgetfulness or laziness.. I would agree with afrazier below that it would better to find a NAS that allows backup to external disk and take that disk into your safe rather than rotate drives in the mirror
    • Johnny
      Johnny over 9 years
      @rex - RAID is not a backup solution, but it can be part of an implementation - years ago I used triple RAID-1 mirrors as part of a backup solution -- quiesce the database, break off one of the mirrors, then I could let the database continue to run while I did my 18 hour tape backup. I could have just as easily taken out the drives for that mirror and put them in a cabinet as a valid backup, putting in a new set of drives for the next backup.
  • afrazier
    afrazier about 13 years
    @Iceking007: There's no concept of a "primary" or "secondary" in RAID-1 -- all drives are peers. Writes should go to both drives simultaneously. In a good implementation, reads should be done from both drives with half the data coming from each drive for increased performance. If the data on one of the drives is corrupted somehow, the array has no way of knowing which drive has the correct data unless the drive itself returns an error.
  • Broam
    Broam about 13 years
    The other line of thought on reads is to always read off of one drive so that you only shorten one drive's lifetime - if it weren't an issue Raid 0+1 & 1+0 wouldn't exist. :) How much reads are actually going to shorten a drive's life are up for debate, but there is a difference.
  • afrazier
    afrazier about 13 years
    @Broam: Power on hours and cycle counts (head load/unloads) probably account for more "lifetime loss" than reads/writes. RAID-10 exists to try to increase write speeds over RAID-1 while giving the user the reliability that RAID-0 lacks.
  • Iceking007
    Iceking007 about 13 years
    +1 afrazier has it right here the D-Link NAS does not 'support' persee and external drive; the USB is meant for a printer, although there is some debate on this on the web. However you can hook up your external drive (or hotswap "toaster" cradle) and just use a back up software from the NAS Drive to the external; this is the best idea. FYI the D-Link NAS does support 'HOT Swap' that's why I mentioned not removing during writing! But shutdown is always the best and safest; just make sure the drive stops spinning before moving it!
  • afrazier
    afrazier about 13 years
    @Iceking007: Where'd you read that about the D-Link NAS? I can't find it in the manual. RE: RAID-1 read striping -- good implementations (high-end hardware controllers, Linux & Solaris soft-RAID) will do it, but it's not required. Source This includes the NAS referenced by the OP, since it runs Linux.
  • Nicole
    Nicole about 13 years
    Thanks, great answer. Quick questions: 1) Will it be safe if that #3 step has been taken, or should I also wipe the other drive first to prevent it from acting as "the real" drive? 2) Any ideas on lifetime reduction using this strategy?
  • afrazier
    afrazier about 13 years
    You shouldn't need to wipe the disk -- it should know that the array was last on port 1 only (for example) and rebuild correctly. However, this forces a full rebuild every time. If you backed up to a USB drive, you could use something like rsync or robocopy to only send the changed files to the USB drive. It saves a lot of wear and tear, time, and most importantly, doesn't require you to shut down your NAS (twice) every time you want to rotate a drive.