DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-04-29 12:49:45

hawse
Member
Registered: 2008-04-29
Posts: 5

How can I check that Raid 1 is actually mirroring?

Hi.

Edit: added results of df -k from ssh as root

I'm new to the forum, and the DNS 323, but have managed to get ssh and sftp running.

I have been reading some of the disturbing posts regarding issues with Raid 1, which made me think... is it possible to browse each drive separately in a Raid 1 (mirrored) configuration? I notice /mnt/HD_a2 and /mnt/HD_a4 directories, but only the HD_a2 directory seems to contain my files and the HD_a4 just contains .lpd and .systemfile Is ths correct? Should I be able to browse each drive independently from an ssh shell as root user?

Even if it is troublesome to restore an array on disk failure, I would at least like to be able to mount the remaining good drive in my PC to performe my own restore to another disk before attempting a Raid array rebuild.

I am currently using v1.04 firmware and $cat /proc/scsi/scsi returns:

~ # cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: WDC      Model: WD7500AAKS-22RBA Rev: 30.0
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: WDC      Model: WD7500AAKS-22RBA Rev: 30.0
  Type:   Direct-Access                    ANSI SCSI revision: 03

EDIT:
running $ df -k reveals:
/mnt/HD_a2 # df -k
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/ram0                 9911      7273      2126  77% /
/dev/md0             719391440  12155412 707236028   2% /mnt/HD_a2
/dev/sda4               497861        23    497838   0% /mnt/HD_a4
/dev/sdb4               497861        18    497843   0% /mnt/HD_b4

does anybody else using Raid 1 see /dev/md1 (or /dev/mdx, come to that)?

Cheers for a great forum and wiki.

Mike

Last edited by hawse (2008-04-29 14:14:09)

Offline

 

#2 2008-04-29 19:17:40

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: How can I check that Raid 1 is actually mirroring?

hawse, you are bringing up some very good questions smile...
Your data is important to you, and if something would happen, like a hard
drive failure, you want to be sure to be sure you can recover your data.

One of the best ways I know of determining the correct disaster recover procedure, is to
simulate the failure and prove to yourself you can recover your data  to your satisfaction.
This is failure simulation is best done before the unit is put into general service.

I see you only have 2% of your 750 disks used, so now would be a good time (I would think)
to formulate (and practice) a disaster recovery procedure.

There are three partitions on each of your drives

/ # fdisk -l /dev/sda

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sda1               1          66      530113+ 82 Linux swap
/dev/sda2             131        9729    77103967+ 83 Linux
/dev/sda4              67         130      514080  83 Linux

Your data is contained on the /dev/sda2 (or /dev/sdb2 for the second disk) partition.  There is a
software RAID package called mdadm which is used to create the RAID1 (in your case) array of
/dev/md0 consisting of the two partitions /dev/sda2 and /dev/sdb2.  The /dev/md0 RAID array is
then mounted to the /mnt/HD_a2 directory

If you do a Google search on mdadm you will find many tutorials, there are mdadm commands which
will let you (in a telnet session) mark one of the raided partitions as failed and remove it from the array.
Then re-mount that partition to the /mnt filesystem and look at the files.  You can then un-mount and
rejoin that partition to the RAID array, wait for rsync.  Then do the same for the other partition.  You can't
un-mount the RAID array completely since your telnet session is running from that filesystem.  One way
around this limitation is to run your fun_plug scripts (and thus the telnet session) from a USB drive, this
will allow you to un-mount the RAID array and even fsck this array.

These are all good skill to learn; however, I think (?) you are probably more concerned that your data can be
recovered than wanting to learn the details of mdadm.  So, just simulate a disk failure.  First backup any data that
you feel is important, then shutdown the DNS-323 and pull one disk.  Restart the DNS-323 which will run in degraded
RAID1 mode.  Then wipe the pulled disk clean (remove any partitions) like it was a fresh replacement drive.  Shut down
the unit again and insert the clean disk.  Power up again and verify your DNS-323 return to a working RAID1 array.

Another thing you could try... before you insert the cleaned disk, power down the unit... remove the drive the was "simulated"
surviving disk and attach the disk to a XP system using ext2IFS (www.fs-driver.org) to backup your data.  This should give
you a procedure to backup the data before attempting the RAID rebuild.

As you think about different failure scenarios and recovery procedures, you might come to the realization that RAID1 is NOT
really a complete backup strategy.  It is designed for (and is very good at) keeping your data available in the event of a disk
failure.  However, it can not help you if you experience data corruption due to virus or accidental user deletion of files, becasue
the file corruption is instantly replicated over both drives, nor will it help you if you need to restore a previous version of a file.

RAID1 coupled with backup strategy, like copy (or rsync) to a tape drive (or other hard drive) can increase the probability you will
will be able to recover you data in a wide variety of failure event.  And knowing your data is stored somewhere else (besides the
RAID1) may help to ease your concerns that the RAID1 is truly mirroring your data.

Last edited by mig (2008-04-29 19:21:10)


DNS-323 • 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB • RAID1 • FW1.03 • ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#3 2008-04-30 12:46:18

hawse
Member
Registered: 2008-04-29
Posts: 5

Re: How can I check that Raid 1 is actually mirroring?

Wow what a nice big response, Mig! Much appreciated and I am now satisfied that my Raid 1 is successfully mirroring. I did as you suggested and simulated fails on both disks, mounted them with the Ext2IFS driver you suggested and was happy to see new files had been sync'ed to both drives.

Working in IT (applications developer), I'm a little embarassed to admit that I hadn't considered the possibility of mirrored virii etc, but I will also be making hard backups to CD and DVD where I need to. All of my really important stuff will probably squeeze onto one DVD, but I would be upset to lose the rest of the data that has taken me so long to acquire. Especially the mp3s that were hand ripped over over a 3 week period on a P150 machine with no access to CDDB! Though trictly speaking these files are also duplicated on my ipod, so restore would still be possible.

My main reason for posting this was because I had seen posts suggesting that LEDs on the DNS 323 showed amber (degraded) disks in Raid 1, so was concerned that it may not be as stable as it appears. Previously, I had a single Seagate 750gb drive mounted in JBOD. This was originally installed when the NAS was at firmware 1.03 and updated to 1.04 only recently. When I tried to mount this drive under XP using the Ext2IFS driver, I was disturbed to learn that my drives could not be recognised. I suspect that this may be due to the Ext3 support being removed in 1.04.

All is well now, though, and I am feeling much more comfortable with the situation. Many thanks for your help.

Cheers,
MIke

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB