LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-13-2010, 03:15 AM   #1
depam
Member
 
Registered: Sep 2005
Posts: 861

Rep: Reputation: 30
Synology NAS and RAID concepts


Hi,

I just bought a NAS drive which occupies 4 bay hard drive. Inside currently are two 1.5 TB hard drives and I have configured it as a RAID1. Please note that this is also using a Linux OS but I don't know what kind of distribution. I am really amazed on what this product can do and how it treats the RAID and can accept different sizes of disks as long as it is the capacity is higher than the smallest disk.

I have read all the RAID concepts but I have not truly played with it in real life. So I wanted to ask if anyone have experience on this.

Here are the test cases that I want to ask:

1.) If I break the mirror and allow the single disk to run and alter any data into it, can I recover everything from the hard disk that I have pulled?
2.) If I break the mirror and put it back right away, how long it is to re-sync?

I would like to know so I know how to use the capability. Thanks.
 
Old 04-13-2010, 10:19 AM   #2
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
Quote:
1.) If I break the mirror and allow the single disk to run and alter any data into it, can I recover everything from the hard disk that I have pulled?
Although it might not be straight forward it should be possible. You should let the config on the disk to be read and make sure you do not write a new config on the disk and if it is hardware raid also not on the raid controller(normally it asks what config you want to use: config on disk or config on controller).
I do wonder what the use would be for this use case.

Quote:
2.) If I break the mirror and put it back right away, how long it is to re-sync?
I don't think anyone would be able to give you a sensible answer to this. It depends on alot of things. You have to think that everything should be copied to the other disk again.
So you might have some degrade performance.
 
Old 04-13-2010, 10:41 AM   #3
depam
Member
 
Registered: Sep 2005
Posts: 861

Original Poster
Rep: Reputation: 30
Hi deadeyes,

Thanks for the reply.

1.) The reason for me to do this is that I want to have a cold copy while I do something on the data on the other disks. If I mess up something then I want to remirror back using the cold copy. I am not sure whether commercial NAS is software/hardware RAID. I do believe it is software raise cause I can see both disks when I view /proc/mdstat:

Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md2 : active raid1 sda3[0] sdb3[1]
1460417308 blocks super 1.1 [2/2] [UU]

md1 : active raid1 sda2[0] sdb2[1]
2097088 blocks [4/2] [UU__]

md0 : active raid1 sda1[0] sdb1[1]
2490176 blocks [4/2] [UU__]

unused devices: <none>
DS410-NAS1>

I just don't know how to do this remirroring back in real life using this NAS. That is why I am also hesitant to do. Have you done this before? In other servers I think it will be possible but not on this stand alone NAS.

2.) Yes you are correct. This NAS took almost half day to complete resync on 1.5 TB.
 
Old 04-14-2010, 04:40 AM   #4
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
I can only say that you should try it on your NAS and see what it gives.

Your output shows it is software raid.

Alot of people make the mistake thinking that RAID = backup.
RAID is NOT backup. It is just redundancy. So I would suggest you make good backups.

You made me curious about this
If I find the time I will test this. Probably it will be possible with mdadm -A /dev/md0 /dev/sdc1
This is a device file md0 assembled from /dev/sdc1 (which should be a partition of type: fd)
 
Old 04-14-2010, 06:59 AM   #5
depam
Member
 
Registered: Sep 2005
Posts: 861

Original Poster
Rep: Reputation: 30
Hi deadeyes,

Thanks a lot.

I didn't know software RAID can also handle more complex RAID configurations. Can you please let me know what mdadm -A /dev/md0 /dev/sdc1 will do? Yes I understand that RAID is not backup but redundancy. I just want to have the knowledge just in case I need it in the future. Because in our environment, we usually break the mirror of RAID 1 everytime we do patching. But I never had ask the engineers how to rebuild it back using the cold backup disks when something goes wrong. But I do think there is a way to do it. If you have tried this, please let me know. Cheers.
 
Old 04-14-2010, 09:26 AM   #6
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Hi depam,

I currently administer multiple commercial grade EMC NAS devices in my environment - my advice to you is that you should rather do a proper backup of your data; than relying on breaking a mirror and using this as a cold backup.

The point of having a RAID 1 mirror is that it will allow you two things:

1. Cater for failure of 2 disks
2. Allow double the read speed due to double the disks.

If you have the machines/disks available, an option is for you to add in another 2 disks to your NAS; and expose these to a separate machine. Therafter you could use something like rsync to do a synchronize between the two boxes at regular intervals (my EMC kit has some built in NAS Replication software that does this for me); which will allow for you to safely patch your machine.

Hope this helps
 
Old 04-14-2010, 09:52 AM   #7
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
I tried it

Created three partitions:
/dev/sda6 636 648 104391 fd Linux raid autodetect
/dev/sda7 649 661 104391 fd Linux raid autodetect
/dev/sda8 662 674 104391 fd Linux raid autodetect

2 of them I have put in a raid1:
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sda6 /dev/sda7

Created fs:
mkfs.ext3 /dev/md1

Mounted:
mount /dev/md1 /mnt

Created a file:
touch /mnt/file1

Removed one disk from raid array:
mdadm /dev/md1 -f /dev/sda7
mdadm /dev/md1 -r /dev/sda7

Created a new file:
touch /mnt/file2

Unmounting fs:
umount /mnt

Removing the second "disk" (which has actually 2 files on the filesystem):
mdadm /dev/md0 -f /dev/sda6
mdadm /dev/md0 -r /dev/sda6
If this does not work use:
mdadm --stop /dev/md0

Assembling the disk again with the /dev/sda7 (which had been removed first and has only 1 file):
mdadm --assemble /dev/md0 /dev/sda7
I got this message: mdadm: /dev/md0 assembled from 1 drive - need all 2 to start it (use --run to insist).
mdadm --run /dev/md0

Now I can mount /dev/md0 again and only one file is there: file1.
This shows what you where wondering about

Lets add the first again:
mdadm /dev/md0 -a /dev/sda6

When looking in the mounted fs on /mnt:
file1

This should save your config to a file:
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm.conf

Do note that you there might be some specifics to your NAS.

Hi five

Last edited by deadeyes; 04-14-2010 at 09:54 AM.
 
Old 04-14-2010, 09:57 AM   #8
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
Quote:
Originally Posted by alli_yas View Post
Hi depam,

I currently administer multiple commercial grade EMC NAS devices in my environment - my advice to you is that you should rather do a proper backup of your data; than relying on breaking a mirror and using this as a cold backup.

The point of having a RAID 1 mirror is that it will allow you two things:

1. Cater for failure of 2 disks
2. Allow double the read speed due to double the disks.

If you have the machines/disks available, an option is for you to add in another 2 disks to your NAS; and expose these to a separate machine. Therafter you could use something like rsync to do a synchronize between the two boxes at regular intervals (my EMC kit has some built in NAS Replication software that does this for me); which will allow for you to safely patch your machine.

Hope this helps
1. Errrr... RAID1 with 2 disks will not protect against 2 disk failures. Use raid6 then.
2. RAID1 is mirroring. I would expect a bigger performance using raid0. Unless there is some good programming logic that uses 2 disks seperately to read data(I don't know if that is the case.).
 
Old 04-14-2010, 10:47 AM   #9
depam
Member
 
Registered: Sep 2005
Posts: 861

Original Poster
Rep: Reputation: 30
Hi deadeyes,

Thanks a lot for doing this. You are so good to try it out for me. Now, I need to find if my NAS can do it. I have contacted the vendor and asked them what is the initial behavior when I do this cause there might be some configurations they have done that may differ from your test case. I really appreciate your effort. You are a big help to people like me wondering about the possibilities. Cheers
 
Old 04-15-2010, 02:56 AM   #10
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
This output shows it is linux software raid (md):
Code:
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md2 : active raid1 sda3[0] sdb3[1]
1460417308 blocks super 1.1 [2/2] [UU]

md1 : active raid1 sda2[0] sdb2[1]
2097088 blocks [4/2] [UU__]

md0 : active raid1 sda1[0] sdb1[1]
2490176 blocks [4/2] [UU__]

unused devices: <none>
DS410-NAS1>
mdadm --detail gives such output if I am correct.
So as long as you are restoring to the same device it should be ok.
But indeed it could be that they are doing something strange.
I strongly advice you to test this out on your machine. Don't count on it working unless you have tested it and it does work.
 
Old 04-18-2010, 05:54 AM   #11
depam
Member
 
Registered: Sep 2005
Posts: 861

Original Poster
Rep: Reputation: 30
Hi deadeyes,

Thanks for the info. I have created the backup of my data as usual and have tried it on the NAS. I didn't do this on the command line since the NAS have GUI to do this and also I want to test if it is the same result. Here is the result so far in RAID1:

1.) Shutdown NAS (NAS is not how-swap)
2.) Pull out the second drive HDD2. Removed one file from the HDD1. I was surprised because the vendor told me that if you remove one disk or it gets broken, the volume will be in read only. But I was still able to remove one file.
3.) Power up the NAS and I can see that the volume is degraded --> This is expected as I removed the secondary drive.
4.) I powered down the NAS and this time I remove HDD1 and put the HDD2 in the first slot. After powering on, volume is still degraded but I can still see my data including the file I removed from HDD1 so I think this is okay. It proved to me that I can just put back another hard drive or even the HDD1 to resync. So I have conclude my test case that it should behave the same as your test case.
5.) After putting back all the drive, now I have problem. I am getting error "System Partition Failed" on HDD2. I have tried to swap it on the slot and it still have the error. I cannot do resync or repair. I went to the vendor asked them to remove all partition and this solved the problem and successfully resync.

I am just curious whether during resync on RAID1, is it supposed to erase the drive from the second harddisk you inserted and overwrite by anything that is on the other drive? I am confused whether it can recognize the drive that was previously inserted and will continue the syncing as where it is left?

Now, I am converting the RAID1 to RAID5. I bought additional 2 drives 1.5TB and wants to include this in the array and convert it to RAID5. Luckily, it was able to detect the disks on all four but it is taking time to reshape and expand the array. Its already 1 days and 9 hours but is still waiting to finish. I assume that whenever power interruption occur, the array will sure have problem.

DS410-NAS1> cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md2 : active raid5 sdd3[4] sdc3[3] sda3[2] sdb3[0]
1460417280 blocks super 1.1 level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
[===========>.........] reshape = 58.4% (853324280/1460417280) finish=1514.9min speed=6677K/sec

md1 : active raid1 sdd2[3] sdc2[2] sda2[0] sdb2[1]
2097088 blocks [4/4] [UUUU]

md0 : active raid1 sdd1[3] sdc1[2] sda1[0] sdb1[1]
2490176 blocks [4/4] [UUUU]

unused devices: <none>
DS410-NAS1>


DS410-NAS1> mdadm --detail /dev/md2
/dev/md2:
Version : 1.01
Creation Time : Sat Apr 17 08:49:23 2010
Raid Level : raid5
Array Size : 1460417280 (1392.76 GiB 1495.47 GB)
Used Dev Size : 1460417280 (1392.76 GiB 1495.47 GB)
Raid Devices : 4
Total Devices : 4
Persistence : Superblock is persistent

Update Time : Sun Apr 18 18:53:10 2010
State : clean, recovering
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0

Layout : left-symmetric
Chunk Size : 64K

Reshape Status : 58% complete
Delta Devices : 2, (2->4)

Name : DS410-NAS1:2 (local to host DS410-NAS1)
UUID : e37974ee:08cde55e:3111afd1:09915412
Events : 20570

Number Major Minor RaidDevice State
0 8 19 0 active sync /dev/hdb3
2 8 3 1 active sync /dev/sda3
4 8 51 2 active sync /dev/hdd3
3 8 35 3 active sync /dev/hdc3
DS410-NAS1>

Thanks a lot for all your help.
 
Old 04-22-2010, 07:28 AM   #12
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Quote:
1. Errrr... RAID1 with 2 disks will not protect against 2 disk failures. Use raid6 then
100% Correct - was a typo on my part - meant to say RAID 1 will protect against disk failure for 2 disks.

Quote:
2. RAID1 is mirroring. I would expect a bigger performance using raid0. Unless there is some good programming logic that uses 2 disks seperately to read data(I don't know if that is the case.).
I do know what RAID 1 is - as I said I administrate storage. As I said, the performance gain will be double the speed for READ operations against a mirror. In an enterprise environment; your RAID controller or Storage Processor allows this doubling in speed. If you're using a low end RAID controller or software read your point around having application level programming logic to read from the disks concurrently does apply.

In the same vein, write operations will suffer increased latency.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slack 13 on NAS - LVM/RAID Questions thegoofeedude Slackware 1 01-07-2010 08:05 AM
Help with WD NAS Recovery (4 x 2.0 TB Raid 5) sunpyo Linux - Server 1 09-17-2009 09:57 AM
Chosing a RAID for NAS: HW Raid, FRAID, SW Raid StefanAO Linux - Server 2 08-29-2009 11:43 PM
RAID 5 VS RAID 10 for home NAS pwjohnston Linux - Server 2 08-07-2009 10:56 PM
Large RAID Partition for a NAS batfastad Linux - General 3 07-06-2008 09:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration