How do I know if my drives are mirrored?

StorCenter ix2-200 Network Storage
Post Reply
Bob1969
Posts: 7
Joined: Thu Feb 21, 2013 4:33 pm

How do I know if my drives are mirrored?

Post by Bob1969 » Mon Dec 02, 2013 3:46 pm

Hello,

I recently had to replace both drives in my unit. When doing that, I had to rebuild by re-adding all of my movies, shows, pictures, etc. onto the new drive(s).

The new drives are Western Digital (7200 rpm - 1TB). The old drives are Barracuda (came with unit - 5400 rpm - 1TB).

I have set the Raid to 1 (mirror). However, when I log in and select the Dashboard tab, I see the used up space is where it should be, but the backup is still at 0.

Does this mean the drives are not mirrored yet? Is there something I need to do to activate?

My unit has the following firmware version: 2.1.42.18967.

Cheers,
Bob

Mijzelf
Posts: 6198
Joined: Mon Jun 16, 2008 10:45 am

Re: How do I know if my drives are mirrored?

Post by Mijzelf » Mon Dec 02, 2013 6:55 pm

Enable ssh, login over ssh, and execute

Code: Select all

cat /proc/mdstat
It will show the status of the raid array.

Bob1969
Posts: 7
Joined: Thu Feb 21, 2013 4:33 pm

Re: How do I know if my drives are mirrored?

Post by Bob1969 » Tue Dec 03, 2013 2:17 am

Thanks for the repy!

I have next to zero experience with Unix or SSH. I am more of a Windows guy myself - but not afraid to venture out of me comfort zone!

I downloaded SSHJuice onto my android phablet; had to make a minor adjustment to my router to open port 22; setup a connection using SSHJuice and typed in your suggestion. The following was the output off of the phone:

Personalities " [linear] [raid0] [raid1] [raid6] [raid5] [raid4]
md1 : active raid1 sda2[0] sdb2[1]
974722192 blocks super 1.0 [1/2] [UU]

md2 : active raid1 sdb1[0] sda1[1]
2040128 blocks [2/2] [UU]

unused devices: <none>

I have no idea what the above is telling me but I will sure google as much as I can.

As much as I will pretend to understand what I get from google, I would prefer to to hear your interpretation.

Cheers,
Bob

Bob1969
Posts: 7
Joined: Thu Feb 21, 2013 4:33 pm

Re: How do I know if my drives are mirrored?

Post by Bob1969 » Tue Dec 03, 2013 3:23 am

I started poking around and found another query to try with a bit more detail.

mdadm --query --detail /dev/md*

Here was my output:

/dev/md0:
Version : 00.90
Creation Time : Sun Sep 20 20:07:51 2009
Raid Level : raid1
Array Size : 2040128 (1992.65 MiB 2089.09 MB)
Used Dev Size : 2040128 (1992.65 MiB 2089.09 MB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Mon Dec 2 21:54:33 2013
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

UUID : 955e10ac:d506a81e:cf246582:0bd34ca3
Events : 0.8442

Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 1 1 active sync /dev/sda1
/dev/md1:
Version : 01.00
Creation Time : Thu Nov 28 19:08:29 2013
Raid Level : raid1
Array Size : 974722192 (929.57 GiB 998.12 GB)
Used Dev Size : 1949444384 (1859.14 GiB 1996.23 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 1
Persistence : Superblock is persistent

Update Time : Mon Dec 2 21:54:23 2013
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

UUID : c2857552:075684f7:326076ef:b5665388
Events : 4

Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
1 8 18 1 active sync /dev/sdb2
mdadm: /dev/md1_vg does not appear to be an md device

Cheers,
Bob

Mijzelf
Posts: 6198
Joined: Mon Jun 16, 2008 10:45 am

Re: How do I know if my drives are mirrored?

Post by Mijzelf » Tue Dec 03, 2013 8:24 am

Here is your answer:

Code: Select all

md1 : active raid1 sda2[0] sdb2[1]
974722192 blocks super 1.0 [1/2] [UU]
Array md1 consists of two partitions, sda2 and sdb2. The size is 974722192 kB ~ 1TB. The array is designed for 1 member, and currently 2 are in use [1/2]. Both members are up [UU].

More info here.

Bob1969
Posts: 7
Joined: Thu Feb 21, 2013 4:33 pm

Re: How do I know if my drives are mirrored?

Post by Bob1969 » Tue Dec 03, 2013 1:53 pm

Thanks for the reply and the added info!

Is it possible to query either drive to see the list of files - validate if they are in sync?

Cheers,
Bob

Mijzelf
Posts: 6198
Joined: Mon Jun 16, 2008 10:45 am

Re: How do I know if my drives are mirrored?

Post by Mijzelf » Tue Dec 03, 2013 3:35 pm

Well, yes. No. Depends on what you actually mean. It is possible to disassemble the array and mount both partitions, and compare them file by file. That is not useful (at least I cannot think of a reason) but you can.

The partitions are mirrored at block level. Which means that both partitions (sda2 and sdb2) together compose a new, partitionlike device (md1). If you write some data to offset X of md1, the data is written to offset X of both sda2 and sdb2. So when sda2 and sdb2 are in sync, they stay in sync, as all writes are low level duplicated.
You can get the disks out of sync by just pulling one. If the smallest write is done to the remaining disk, they are out of sync. The raid manager can know that by a 'last written' timestamp in the header.
If you plug the disk back it will be synced again, which basically means that the 'old' disk will be copied to the 'new' disk, the whole Terabyte, because the mechanism knows the 'old' disk is changed compared to the 'new' disk, but it doesn't know what. And comparing the disks costs about as much time as simply copying, so the disk is copied from start to end.
During the sync it is known which sectors are in sync, and which not, but there is no easy way to know which files are involved, as the filesystem is not directly related to the array.

Bob1969
Posts: 7
Joined: Thu Feb 21, 2013 4:33 pm

Re: How do I know if my drives are mirrored?

Post by Bob1969 » Tue Dec 03, 2013 4:40 pm

Hehe.

I believe I am all out of silly questions for the time being! :oops:

I am going to get some (online) books and read more about this stuff.

Again, thanks for you reply and assistance - it was greatly appreciated.

I got me some learnin to do.

Cheers,
Bob

Post Reply