LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-29-2010, 04:44 AM   #1
GasPipe
Member
 
Registered: Jul 2009
Location: Finland
Distribution: Slackware64-current
Posts: 55

Rep: Reputation: 20
Setting up NAS with Slackware


Hi,

I have been running FreeNAS on my server but lately it has proven to be too limited by it's features and upgrades are a bit too complex in my taste.
Well, I have 3x500GB and 1x2TB hdd and I need some advice how to RAID these devices.
I used ZFS before with the 3x500GB drives in "RAIDZ" mode and last week I added 2TB drive but I didn't have a clue how to add it to the pool. I know (now) that I can only add same size of disks to the raid setup and with ZFS I think I could setup 3x500GB drives as one virtual device and 2TB drive in stripe mode as another virtual device and create one pool from those virtual devices and they would appear as one big device.

Yeah, but that was before. Now I'm changing my system to Slackware because it offers the flexibility I'm looking for. And the question is, how should I setup my hard drives and which RAID modes so that I could have maximum capacity and one disk as a spare one, like in RAID5 mode. And which filesystem do you recommend?
I'm planning to use -current, because it has newer mdadm than current stable and 13.2 is just around the corner (planning to stick with it when released).

Let's say that I would like to add another 2TB drive in the future. How easy it is to set up for example to mirror (raid1) mode with the old 2TB drive?

I'd like to thank everyone who replies to my questions in advance because I'm really lost with this case!

Last edited by GasPipe; 12-30-2010 at 01:44 AM.
 
Old 12-30-2010, 12:53 AM   #2
yooy
Senior Member
 
Registered: Dec 2009
Posts: 1,387

Rep: Reputation: 174Reputation: 174
I chekced unetbooting and Slax is only thing available.

how to setup linux NAS
 
Old 12-30-2010, 01:43 AM   #3
GasPipe
Member
 
Registered: Jul 2009
Location: Finland
Distribution: Slackware64-current
Posts: 55

Original Poster
Rep: Reputation: 20
Okay, let's forget that. There are 80gb hdds for about 5-10 euros so I can buy one of those instead.

How about other questions?
 
Old 12-30-2010, 01:31 PM   #4
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 528

Rep: Reputation: 272Reputation: 272Reputation: 272
You can only make a RAID setup when all the components are of equal size, that is if you want to use all the disk space available of course...
The space of each component of the RAID will be limited to the size of the smallest component.

In other words, if you have 3 hard drives of different sizes (100GB, 120GB and 150GB) and decide to make a RAID0 out of them, you would end up with a logical drive of 300GB size, because only 100GB (the size of the smallest drive) would be used from the 120GB and 150GB drives.

As long as you use same size drives, you can always increase the size of the RAID by adding more drives and "growing" the filesystem.

In your case, you can make a RAID5 using the 3 drives of 500GB, which will give you 1TB (you loose a drive worth of space to parity data) or a RAID0 which will give you the full space of 1.5TB for data.
Keep in mind that RAID0 has no fault tolerance: if any one of the 500GB drive fails you loose all the RAID0 data (the 1.5TB).

I strongly suggest you read this first: http://en.wikipedia.org/wiki/RAID
 
Old 12-31-2010, 11:32 AM   #5
tux_dude
Member
 
Registered: Dec 2008
Distribution: Slackware64 Current
Posts: 277

Rep: Reputation: 41
Get two additional 2TB drives and replace the existing 3x500GB drives on a RAID5. You can also keep the existing 3x500GB and run an additional RAID array (great the play around with mdadm with a spare RAID).

If the additional 2TB drives are not currently in your budget, then create a RAID5 array with the 3x500GB drives as your primary storage. Use the 2TB drive to store non-critical data. You can setup the 2TB drive as a degraded RAID1. Once you get additional 2TB drive(s) you can added it to the degraded RAID1 and migrate your data. You can also migrate to additional RAID levels when you add additional drives.

As for file system, I personally am only familiar and comfortable to ext file systems. I am running ext4 on my RAID6 array with 9x1.5TB drives with a mixture of ext3/4 on the other independent drives. Ext4 is quite fast and stable. Plus the online expansion now works flawlessly.
 
Old 12-31-2010, 12:20 PM   #6
GasPipe
Member
 
Registered: Jul 2009
Location: Finland
Distribution: Slackware64-current
Posts: 55

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by tux_dude View Post
Get two additional 2TB drives and replace the existing 3x500GB drives on a RAID5. You can also keep the existing 3x500GB and run an additional RAID array (great the play around with mdadm with a spare RAID).
Yup, getting two additional 2TB drives aren't currently in my budget. I'm planning to buy more drives along the next year but not immediately.

Quote:
Originally Posted by tux_dude View Post
If the additional 2TB drives are not currently in your budget, then create a RAID5 array with the 3x500GB drives as your primary storage. Use the 2TB drive to store non-critical data. You can setup the 2TB drive as a degraded RAID1. Once you get additional 2TB drive(s) you can added it to the degraded RAID1 and migrate your data. You can also migrate to additional RAID levels when you add additional drives.
Oh, thanks buddy! That was just what I was looking for. I guess that's the way to go but is there a way to make a single drive, which contains two RAID arrays, one with the 3x500GB drives and one with the 2TB drive? And that drive could be mounted to some sensible place like /mnt/storage and it would appear as normal hdd.

Quote:
Originally Posted by tux_dude View Post
As for file system, I personally am only familiar and comfortable to ext file systems. I am running ext4 on my RAID6 array with 9x1.5TB drives with a mixture of ext3/4 on the other independent drives. Ext4 is quite fast and stable. Plus the online expansion now works flawlessly.
Yeah, I guess ext4 is a pretty safe option as file system.
Thanks tux_dude, your answer was just what I was looking for.

Any other thoughts?
 
Old 12-31-2010, 01:25 PM   #7
tux_dude
Member
 
Registered: Dec 2008
Distribution: Slackware64 Current
Posts: 277

Rep: Reputation: 41
Quote:
Originally Posted by GasPipe View Post
Oh, thanks buddy! That was just what I was looking for. I guess that's the way to go but is there a way to make a single drive, which contains two RAID arrays, one with the 3x500GB drives and one with the 2TB drive? And that drive could be mounted to some sensible place like /mnt/storage and it would appear as normal hdd.
You could, but you wouldn't gain anything from it. You will either loose a lot of space or loose the redundancy entirely. Keeping the 2TB drive on a separate array gives you the maximum usable space with the 3x500GB drive as your safe haven. This option also enable safer array expansion as you add more drives. To keep them in the same directory path, you can use /mnt/storage for the 3x500GB mount point and /mnt/storage/non-critical for the the 1x2TB drive.

If you must have a single mount point /mnt/storage then the safest option is to add the 2TB drive to the 3x500GB RAID5. This will only expand the array by 500GB, meaning you will loose a whole 1.5TB from the 2TB drive (quite a waste).

Here is how I would proceed for future expansion (especially if you have limit ports to connect the drives).
1. Create RAID5 with 3x500GB drives for 1GB usable space
2. Create degraded RAID1 with 1x2TB for 2TB usable space (non-redundant)
3. Mount RAID5 in 1 on /mnt/storage
4. Mount RAID1 in 2 on /mnt/storage/non-critical
5. Months later add another 2TB drive to RAID1 in 2. Usable space still at 2TB but now with redundancy
6. You can copy all the data from the 3x500GB RAID5 to the 2x2TB RAID1 which has double the storage. Assuming you have sufficient space for the critical and non-critical data 1TB.
7. At this point you can get rid of the RAID5 array (if you have limited drive ports) or re-purpose it for other storage.
8. Many more months later add another 2TB drive to the 2x2TB RAID1 and migrate to RAID5. This gives you 4TB of usable space.
9. Rinse and repeat as you purchase larger drives.
 
Old 12-31-2010, 01:48 PM   #8
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
You could always create an LVM on top of the 3x500GB Raid 5 array and 2x1TB Raid 1 array (initially degraded). Make each RAID array a PV (physical volume) and you can add both arrays to a VG (volume group) and create LVs (logical volumes) as you please. I have two RAID 1 arrays acting in an LVM on my server without trouble. I'm not sure if creating a degraded RAID 1 array would place extra burden on the disk, so that's something to look into, but that aside an LVM on top of two RAID arrays seems to be what you're looking for.
 
Old 12-31-2010, 03:04 PM   #9
GasPipe
Member
 
Registered: Jul 2009
Location: Finland
Distribution: Slackware64-current
Posts: 55

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by tux_dude View Post
You could, but you wouldn't gain anything from it. You will either loose a lot of space or loose the redundancy entirely. Keeping the 2TB drive on a separate array gives you the maximum usable space with the 3x500GB drive as your safe haven. This option also enable safer array expansion as you add more drives. To keep them in the same directory path, you can use /mnt/storage for the 3x500GB mount point and /mnt/storage/non-critical for the the 1x2TB drive.
Yes I know that. I was looking for LVM solution like T3slider suggested. Sorry for not being clear enough. I think I blame the Brooklyn local 2 bottle ;-)

Quote:
Originally Posted by T3slider
You could always create an LVM on top of the 3x500GB Raid 5 array and 2x1TB Raid 1 array (initially degraded). Make each RAID array a PV (physical volume) and you can add both arrays to a VG (volume group) and create LVs (logical volumes) as you please. I have two RAID 1 arrays acting in an LVM on my server without trouble. I'm not sure if creating a degraded RAID 1 array would place extra burden on the disk, so that's something to look into, but that aside an LVM on top of two RAID arrays seems to be what you're looking for.
I haven't ever worked with LVM before but I found README file for it. I somehow always forget that should be the first place to look for hints :-)

But to be clear I ask this question:
Let's say that I have one 80GB drive for root, home and swap paritions.
I have 3x500GB RAID5 array.
I have 2x2TB RAID1 array (which I would later extend with another 2TB drive and migrate it to RAID5.)

It's possible to create from those two RAID arrays one big LVM partition which would be 3TB of size?

Thanks for your answers and happy new year!
I'll look into this tomorrow.

Last edited by GasPipe; 12-31-2010 at 03:06 PM.
 
Old 12-31-2010, 03:21 PM   #10
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Quote:
Originally Posted by GasPipe View Post
But to be clear I ask this question:
Let's say that I have one 80GB drive for root, home and swap paritions.
I have 3x500GB RAID5 array.
I have 2x2TB RAID1 array (which I would later extend with another 2TB drive and migrate it to RAID5.)

It's possible to create from those two RAID arrays one big LVM partition which would be 3TB of size?
Yes, correct. You create the two RAID arrays and assign each RAID device (/dev/md* if you're using software RAID) to a physical volume. LVMs allow you to extend volume groups by adding physical volumes to it. Therefore, you would end up with one volume group containing two physical volumes (the two RAID arrays), for a total of 3TB of allocatable space. You then create one or more logical volumes within that volume group. In your case it looks like you just want one logical volume since you want to mount the whole 3TB under one directory (unless I misunderstood).
 
Old 01-01-2011, 01:23 PM   #11
GasPipe
Member
 
Registered: Jul 2009
Location: Finland
Distribution: Slackware64-current
Posts: 55

Original Poster
Rep: Reputation: 20
Ok, I have created two RAID arrays /dev/md0 (3x500GB RAID5) and /dev/md1 (1x2TB RAID1).
Quote:
mdadm --create /dev/md0 --level 5 --raid-devices 3 /dev/sdb1 /dev/sdc1 /dev/sdd1
Then I created two physical volumes /dev/md0 and /dev/md1.
Quote:
mdadm --create /dev/md1 --level 1 --force --raid-devices 1 /dev/sda1
And then I created volume group called "varasto" which contains both /dev/md0 and /dev/md1.
Quote:
vgcreate varasto /dev/md0 /dev/md1
Every command have succeeded properly.

After that I just checked vgdisplay and I got:
Quote:
--- Volume group ---
VG Name varasto
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 2.73 TiB
PE Size 4.00 MiB
Total PE 715398
Alloc PE / Size 0 / 0
Free PE / Size 715398 / 2.73 TiB
VG UUID Rx663t-tjZw-s0re-PWiq-kQyY-G735-Hi1HAT
And try to create one big logical volume:
Quote:
lvcreate -L 2.73TiB -n Varasto varasto
Rounding up size to full physical extent 2.73 TiB
Insufficient free extents (715398) in volume group varasto: 715654 required
I have tried to create volume group with just one raid array and /dev/md0 works properly but when I extend it with /dev/md1 I still got the same amount of space than before.

What now?
 
Old 01-01-2011, 06:01 PM   #12
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Quote:
Originally Posted by GasPipe View Post
And try to create one big logical volume:
Code:
lvcreate -L 2.73TiB -n Varasto varasto
Rounding up size to full physical extent 2.73 TiB
Insufficient free extents (715398) in volume group varasto: 715654 required
I think it's trying to round up to a barely higher value. It would be better to use
Code:
lvcreate -l 100%FREE -n Varasto varasto
which I believe would work.
Quote:
Originally Posted by GasPipe View Post
I have tried to create volume group with just one raid array and /dev/md0 works properly but when I extend it with /dev/md1 I still got the same amount of space than before.
If you decide to instead extend the VG and the LV, remember to extend the filesystem as well. The command you would use would depend on the filesystem you use.
 
Old 01-02-2011, 02:13 AM   #13
GasPipe
Member
 
Registered: Jul 2009
Location: Finland
Distribution: Slackware64-current
Posts: 55

Original Poster
Rep: Reputation: 20
Quote:
Code:
lvcreate -l 100%FREE -n Varasto varasto
which I believe would work.
Thanks, that worked perfectly!

Quote:
If you decide to instead extend the VG and the LV, remember to extend the filesystem as well. The command you would use would depend on the filesystem you use.
Yup, that must have been something I forgot to do.
 
  


Reply

Tags
lvm, nas, pv, raid, slackware, vg



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
Slackware (12.2/13) as a High Availability NAS Server zordrak Slackware 10 12-08-2009 03:26 AM
Proposed Hardware for HA-NAS Server on Slackware Linux zordrak Linux - Hardware 4 07-06-2009 10:49 AM
Buffalo NAS - how do we get files on NAS syncing with Windows Sync? bykerbob Linux - Newbie 0 10-21-2008 08:59 PM
Setting up X in Slackware 8.1 pow2k2 Linux - Software 8 02-10-2003 04:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:03 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