You are not logged in.

#1 2010-08-03 18:09:04

imatechguy
Arch Linux f@h Team Member
Registered: 2010-03-22
Posts: 66

[SOLVED] RAID1 for Storage Drives: Is it really this easy...

I currently have a simple file server set up that uses the nVidia controller (NVRAID) on the MoBo to control the RAID1 arrays for the storage drives.  Currently I'm using all four of the NVRAID controller sata ports yet I find myself needing to expand a bit and that has led me to search for a different solution.  I've been looking at documentation for mdadm and it seems so simple, since the OS is on it's own non-RAID drive, that I am concerned I'm missing something.  Assuming each disk will only have a single partition would it really be as easy as making my backups, disabling the NVRAID controller and following the simple commands below to have a functioning RAID1 setup ready to load with data?  Also will this work the same on a PCI or PCI-E SATA Port adapter card?

Set the partition type with

# fdisk /dev/sd?
# fdisk /dev/sd?

Just to be safe make sure there is no existing superblock

# mdadm --zero-superblock /dev/sd? /dev/sd?

Create a RAID1 array

# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sd?1 /dev/sd?1

Format /dev/md0 as ntfs:

# mkfs.ntfs /dev/md0 

Mount the Array

# mkdir /myfoldername
# mount /dev/md0 /myfoldername

Then I just make sure to update fstab and mdadm.conf files to make sure the arrays are auto-mounted.


Thanks

Last edited by imatechguy (2010-08-05 02:38:18)

Offline

#2 2010-08-03 22:57:23

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: [SOLVED] RAID1 for Storage Drives: Is it really this easy...

Yes, it is that easy smile

Although, why do you want to use NTFS? yikes

And don't forget that you are recreating the array, so you will loose all the data currently on the drives! (You seem to already know this since you're running mkfs but for the benefit of anyone who finds this in the future with the same question wink)

EDIT

Also will this work the same on a PCI or PCI-E SATA Port adapter card?

As long as the kernel has drivers for the card, then it doesn't matter to mdadm. The kernel should just present the drive as a block device in /dev/

AND, don't forget to 'modprobe raid1' before you start to load the kernel module for RAID.

Last edited by fukawi2 (2010-08-03 22:59:13)

Offline

#3 2010-08-04 02:34:02

imatechguy
Arch Linux f@h Team Member
Registered: 2010-03-22
Posts: 66

Re: [SOLVED] RAID1 for Storage Drives: Is it really this easy...

fukawi2 wrote:

Yes, it is that easy smile

Although, why do you want to use NTFS? yikes

Excellent thanks, it just seemed so easy I was sure I must be missing something.  Most of the information I found was about creating an array to install the OS files to so it was a bit confusing at first.  Aaaand, I don't want to use NTFS at all but I haven't convinced the wife to give up 'doze yet so I have to keep these files accessible for her PC.

fukawi2 wrote:

And don't forget that you are recreating the array, so you will loose all the data currently on the drives! (You seem to already know this since you're running mkfs but for the benefit of anyone who finds this in the future with the same question wink)

Yep, but I appreciate the reminder.  In addition to adding more HDD's I'm also migrating to larger drives so I can afford to start from scratch, and I intend to make backup images before doing anything anyway.  They've saved my bacon more than once so I always make sure they're up to date.


fukawi2 wrote:

EDIT

Also will this work the same on a PCI or PCI-E SATA Port adapter card?

As long as the kernel has drivers for the card, then it doesn't matter to mdadm. The kernel should just present the drive as a block device in /dev/

AND, don't forget to 'modprobe raid1' before you start to load the kernel module for RAID.

Good to know since this thing will eventually store data for personal use, my wife's photography business and the movie files for HTPC box (once I build it) it's going to have a lot of HDDs with everything being mirrored.

Okay that modprobe one made me look.  Basically that just loads the Raid modules for a kernel when the system is prexisting and already running to avert needing to reboot to load them... right?


Thanks for the help it really is greatly appreciated.

Offline

#4 2010-08-04 04:18:00

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: [SOLVED] RAID1 for Storage Drives: Is it really this easy...

imatechguy wrote:

Aaaand, I don't want to use NTFS at all but I haven't convinced the wife to give up 'doze yet so I have to keep these files accessible for her PC.

Is this a dual-boot machine? You won't be able to assemble the mdadm array in Windows, so it's likely to end up in tears if you try. If you're just sharing this drive across the network (ie, Samba) then you don't need to use NTFS on it for your wife. Using ext3/4 or another native Linux filesystem will likely be faster, and definitely safer, while still allowing her to access it via Samba.

imatechguy wrote:

Okay that modprobe one made me look.  Basically that just loads the Raid modules for a kernel when the system is prexisting and already running to avert needing to reboot to load them... right?

Well you'll need to load it every boot if the kernel doesn't include it; the standard Arch kernel doesn't so you'll need to add it to your MODULES=() in /etc/rc.conf
Since you're not booting from the RAID array, you won't need to do anything with mkinitcpio.

imatechguy wrote:

Thanks for the help it really is greatly appreciated.

You're welcome smile

Offline

#5 2010-08-04 13:20:47

imatechguy
Arch Linux f@h Team Member
Registered: 2010-03-22
Posts: 66

Re: [SOLVED] RAID1 for Storage Drives: Is it really this easy...

fukawi2 wrote:

Is this a dual-boot machine? You won't be able to assemble the mdadm array in Windows, so it's likely to end up in tears if you try. If you're just sharing this drive across the network (ie, Samba) then you don't need to use NTFS on it for your wife. Using ext3/4 or another native Linux filesystem will likely be faster, and definitely safer, while still allowing her to access it via Samba.

No this is effectively a straight up CLI only NAS box, built with spare parts.  It has no desktop environment installed, no keyboard or monitor and it's only purpose right now is as a storage space within my LAN.  I didn't know I could use ext3 and/or ext4 and still read/write to the drive with a 'doze box.  Is that enabled due to SAMBA or do I need a special program or driver?  I knew you could do something simlilar for ext2 but not obviously not for ext3/4.  I would very much prefer to set the box up with these drives as ext3 over ntfs so that would really be nice.

fukawi2 wrote:
imatechguy wrote:

Okay that modprobe one made me look.  Basically that just loads the Raid modules for a kernel when the system is prexisting and already running to avert needing to reboot to load them... right?

Well you'll need to load it every boot if the kernel doesn't include it; the standard Arch kernel doesn't so you'll need to add it to your MODULES=() in /etc/rc.conf
Since you're not booting from the RAID array, you won't need to do anything with mkinitcpio.

Ah I see.  I figured I might have to do that but just hadn't looked that far down the road.  I knew I had to check the kernel and have the commands to do that written down or linked to somewhere but I wanted to make sure I was on the right track first.

Again I appreciate all the help.

Offline

#6 2010-08-04 22:54:47

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: [SOLVED] RAID1 for Storage Drives: Is it really this easy...

imatechguy wrote:

No this is effectively a straight up CLI only NAS box, built with spare parts.  It has no desktop environment installed, no keyboard or monitor and it's only purpose right now is as a storage space within my LAN.  I didn't know I could use ext3 and/or ext4 and still read/write to the drive with a 'doze box.  Is that enabled due to SAMBA or do I need a special program or driver?  I knew you could do something simlilar for ext2 but not obviously not for ext3/4.  I would very much prefer to set the box up with these drives as ext3 over ntfs so that would really be nice.

Go with ext3/4 then. Samba acts as the interface and 'translator' between Windows and the Linux kernel, which in turn handles the read/write from disk. The underlying file system is of no consequence to Samba. smile

Offline

#7 2010-08-04 23:28:30

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED] RAID1 for Storage Drives: Is it really this easy...

You don't even need to set the partition type through fdisk, as far as I remember. Just make sure the partitions are there, tell mdadm to start an array using partition X, Y, Z, and off you go.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#8 2010-08-04 23:34:46

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: [SOLVED] RAID1 for Storage Drives: Is it really this easy...

imatechguy wrote:
fukawi2 wrote:

Yes, it is that easy smile

Although, why do you want to use NTFS? yikes

Excellent thanks, it just seemed so easy I was sure I must be missing something.

You think this is easy? You have to try ZFS. It is the bee's knees wink


neutral

Offline

#9 2010-08-05 02:10:20

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: [SOLVED] RAID1 for Storage Drives: Is it really this easy...

.:B:. wrote:

You don't even need to set the partition type through fdisk, as far as I remember. Just make sure the partitions are there, tell mdadm to start an array using partition X, Y, Z, and off you go.

That's correct, but it does help with assembly/recovery if you ever have to do it, especially with LiveCD's like TRK or Finnix smile

Offline

#10 2010-08-05 02:37:46

imatechguy
Arch Linux f@h Team Member
Registered: 2010-03-22
Posts: 66

Re: [SOLVED] RAID1 for Storage Drives: Is it really this easy...

fukawi2 wrote:

Go with ext3/4 then. Samba acts as the interface and 'translator' between Windows and the Linux kernel, which in turn handles the read/write from disk. The underlying file system is of no consequence to Samba. smile

Cool beans, ext3 it is then!  Thank you very much for all your input this has been extremely helpful.

Offline

Board footer

Powered by FluxBB