LinuxMCE Forums

General => Users => Topic started by: cirion on February 22, 2008, 12:27:15 pm

Title: Is the RAID expandable?
Post by: cirion on February 22, 2008, 12:27:15 pm
I just changed my Motherboard in the core to one with more sata ports I had lying around...
I can confirm that the software raid still works after changing motherboard even with differen type of sata controller.

I reinstalled LinuxMCE and it found the RADI without my help :)

Now that I have more ports, I have added a fourth drive and was hoping to expand it from 3xRaid5 to 4xRaid5. Is it possible?

Anyone have any more info on how the raid in LinuxMCE works and what package is used?
Title: Re: Is the RAID expandable?
Post by: Venom986 on February 22, 2008, 02:33:55 pm
my understanding is that its not possible (or at least not painless) as in a 3-drive RAID5 you have data split 50/50 between two drives and parity on the 3rd.  Moving to a 4-drive RAID5 would require data split 33/33/33 and the 4th drive as parity.

I could be wrong.
Title: Re: Is the RAID expandable?
Post by: cirion on February 22, 2008, 04:29:39 pm
I hope you are wrong ;)

I have found this about software RAID in Ubuntu:
http://ubuntuforums.org/showthread.php?t=408461

And this about a utility to manage software RAID in linux:
http://www.linuxmanpages.com/man8/mdadm.8.php

I also have a Thecus n5200, that uses software RAID in linux, and it is able to expand all the way from a 2 disk RAID1-> 3-5 disk RAID5. That way I was able to expand the RAID with a disk when needed. I both suspect and hope that the software raid in my Thecus is the same as in LinuxMCE.
Title: Re: Is the RAID expandable?
Post by: colinjones on February 22, 2008, 08:45:48 pm
Actually, venom, its much more complicated than that! On a RAID5 array both data and parity are on all disks in the array (striped). There is no "parity" disk. If you want that you are looking for RAID 3 or 4. But they perform even worse than a RAID5 which is pretty bad in itself!
Title: Re: Is the RAID expandable?
Post by: Venom986 on February 23, 2008, 01:10:35 am
http://www.mythtv.org/wiki/index.php/LVM_on_RAID

Dependant on kernel support, but nice and promising ;)  Of course, all 6 of my SATA ports are used already...but its nice to know anyways.
Title: Re: Is the RAID expandable?
Post by: cirion on February 23, 2008, 10:45:45 am
I jumped...

I just added the drive as a spare in the Webadmin then ran the following command:

Code: [Select]
linuxmce@dcerouter:~$ sudo mdadm --grow /dev/md1 --raid-disks=4
mdadm: Need to backup 384K of critical section..
mdadm: ... critical section passed.
linuxmce@dcerouter:~$

Webadmin now tells me:
DAMAGED, REBUILDING (0/100)

Should take a day to rebuild... I will post more when I know what the end result is...
Title: Re: Is the RAID expandable?
Post by: cirion on February 23, 2008, 11:31:45 am
Still rebuilding... 0/100 still... After 1 hour.
The data on the RAID is still available :)

Better leave it alone to rebuild for now...
Title: Re: Is the RAID expandable?
Post by: jondecker76 on February 23, 2008, 11:34:28 am
Please keep us informed - this is information that I would really like to know for sure!
Title: Re: Is the RAID expandable?
Post by: cirion on February 23, 2008, 01:12:01 pm
I will keep you informed....

2.5 hours rebuilding now. Status is still damaged and the disks are still working hard.
What has changed, is the type of the disk in the Webadmin. It's no longer marked as a spare, but a active disk :)
The Capacity is marked differently than the others, that might change when its done...

ID   Drive              Capacity              Type           Status
35   /dev/sda   750.1 GB, 0x0000000 GB   active disk   OK   
36   /dev/sdb   750.1 GB, 0x0000000 GB   active disk   OK   
37   /dev/sdc   750.1 GB, 0x0000000 GB   active disk   OK   
39   /dev/sdd   750.1 GB              active disk   OK
Title: Re: Is the RAID expandable?
Post by: cirion on February 23, 2008, 01:58:02 pm
3.5 hours... Status is now:
DAMAGED, REBUILDING (20/100)
Title: Re: Is the RAID expandable?
Post by: cirion on February 23, 2008, 04:06:59 pm
5.5 hours... Status is now:
DAMAGED, REBUILDING (20/100)
Title: Re: Is the RAID expandable?
Post by: cirion on February 23, 2008, 08:09:57 pm
9.5 hours... Status is now:
DAMAGED, REBUILDING (60/100)
Title: Re: Is the RAID expandable?
Post by: jondecker76 on February 23, 2008, 08:40:04 pm
sure looks like its going to work!
Title: Re: Is the RAID expandable?
Post by: cirion on February 23, 2008, 09:52:05 pm
I shure hope so... But it could still end in tears... I don't have backup of all the files... But at least I have all important stuff.

11.5 hours... Status is now:
DAMAGED, REBUILDING (80/100)
Title: Re: Is the RAID expandable?
Post by: cirion on February 23, 2008, 11:34:05 pm
13 hours... It was 1395GiB Now it is:

34   CORE   Software Raid 5   Software Raid 5   /dev/md1   4   2093.08GiB   OK

Going to bed, I'll test the raid tomorrow.. Looks like all the data is there :)
Title: Re: Is the RAID expandable?
Post by: cirion on February 25, 2008, 01:37:34 pm
The LinuxMCE Webadmin is still showing:
34     CORE     Software Raid 5     Software Raid 5     /dev/md1     4     2093.08GiB     OK     

But I have used 1390GB and have only 5GB free... Before growing I had 1395GB total...
Do I need to run a diskcheck?

Anyone know the command to do a diskcheck in Kubuntu?
Is there a different command for RAID?
Title: Re: Is the RAID expandable?
Post by: hari on February 25, 2008, 05:28:20 pm
the file system check command depends on the file system used. You may have to extend that, too.

best regards,
Hari
Title: Re: Is the RAID expandable?
Post by: cirion on February 25, 2008, 08:01:50 pm
LOL, I forgot all about checking the partition...
But I thought the growing of the RAID did mean the partition too...

I installed gparted and had a look...
It shows a partition with a ext3 volume at 2.04TiB.
It also has a Waring on it:

Code: [Select]
e2label: No such file or directory while trying to open /dev/md1p1
Couldnt find valid superblock.

Unable to read the contents of this filesystem!
Because of this som operations may be unavailable.
Title: Re: Is the RAID expandable?
Post by: royw on February 25, 2008, 08:06:30 pm
I haven't used linux software RAID, but do have one LVM volume on a kubuntu system.  Here's what LVM says on extending logical volume (http://www.tldp.org/HOWTO/LVM-HOWTO/extendlv.html (http://www.tldp.org/HOWTO/LVM-HOWTO/extendlv.html)):
Code: [Select]
After you have extended the logical volume it is necessary to increase the file system size to match. how you do this depends on the file system you are using.

By default, most file system resizing tools will increase the size of the file system to be the size of the underlying logical volume so you don't need to worry about specifying the same size for each of the two commands.

   1.

      ext2/ext3

      Unless you have patched your kernel with the ext2online patch it is necessary to unmount the file system before resizing it. (It seems that the online resizing patch is rather dangerous, so use at your own risk)

         # umount /dev/myvg/homevol/dev/myvg/homevol
         # resize2fs /dev/myvg/homevol
         # mount /dev/myvg/homevol /home
                 

      If you don't have e2fsprogs 1.19 or later, you can download the ext2resize command from ext2resize.sourceforge.net and use that:

         # umount /dev/myvg/homevol/dev/myvg/homevol
         # ext2resize /dev/myvg/homevol
         # mount /dev/myvg/homevol /home
 

HTH,
Roy
Title: Re: Is the RAID expandable?
Post by: cirion on February 25, 2008, 10:37:58 pm
Thanks for the info :)

From what I can see, I have to run 2 commands...
This is running now:
Code: [Select]
sudo e2fschk -f /dev/md1
When that is done, I will try running:
Code: [Select]
sudo resize2fs /dev/md1
I am trying without unmounting for now. I'll post results...
Title: Re: Is the RAID expandable?
Post by: hari on February 25, 2008, 10:50:44 pm
Thanks for the info :)

From what I can see, I have to run 2 commands...
This is running now:
Code: [Select]
sudo e2fschk -f /dev/md1
When that is done, I will try running:
Code: [Select]
sudo resize2fs /dev/md1
I am trying without unmounting for now. I'll post results...
ouch
Title: Re: Is the RAID expandable?
Post by: cirion on February 26, 2008, 08:12:57 am
First one:
Code: [Select]
linuxmce@dcerouter:~$ sudo e2fsck -f /dev/md1
[sudo] password for linuxmce:
e2fsck 1.40.2 (12-Jul-2007)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/md1: 3832/182910976 files (9.9% non-contiguous), 346034004/365791968 blocks

Second one:
Code: [Select]
linuxmce@dcerouter:~$ sudo resize2fs /dev/md1
[sudo] password for linuxmce:
resize2fs 1.40.2 (12-Jul-2007)
Filesystem at /dev/md1 is mounted on /mnt/device/34; on-line resizing required
old desc_blocks = 88, new_desc_blocks = 131
Performing an on-line resize of /dev/md1 to 548687952 (4k) blocks.
The filesystem on /dev/md1 is now 548687952 blocks long

Free disk space: 657.5GB out of 2.0 TB (69% used)
Title: Re: Is the RAID expandable?
Post by: jondecker76 on February 26, 2008, 12:26:31 pm
you should put this in the wiki
Title: Re: Is the RAID expandable?
Post by: cirion on February 26, 2008, 01:45:27 pm
I will put it in the Wiki as soon as I am shure everything is working great.
I have to fill the RAID past the 1395GB to se that everything works.
Title: Re: Is the RAID expandable?
Post by: Zaerc on February 26, 2008, 06:35:55 pm
Since you used e2resizefs on a mounted filesystem you might also want to run e2fschk (probably with the -f flag) on it again to make sure it didn't got corrupted.
Title: Re: Is the RAID expandable?
Post by: cirion on February 28, 2008, 09:23:25 am
Check done.... No data corruption, and everything works :)
I have now also filled in 400GB of data on top of the 1395GB which was the limit.

So I can confirm that Growing+Expanding the RAID in LinuxMCE works!
I'll add this to the wiki.
Title: Re: Is the RAID expandable?
Post by: jondecker76 on September 08, 2008, 06:10:54 pm
I have recently expanded my RAID successfully as well and wrote a wiki article. I tried to take a "safe" approach and have the RAID unmounted in single-user mode to reduce the risk of something going wrong.

http://wiki.linuxmce.org/index.php/Grow_Raid (http://wiki.linuxmce.org/index.php/Grow_Raid)
Title: Re: Is the RAID expandable?
Post by: Zaerc on September 08, 2008, 06:31:17 pm
Thanks jondecker76, looks very thorough.