LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-15-2019, 10:09 PM   #1
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,065

Rep: Reputation: 146Reputation: 146
Question RAID1 /home (Slackware64 14.2?)


I'm interested in trying RAID first time ever, on Slackware64 14.2 up-to-date stable. I've read a little and seems it'll be RAID1, i.e., I'll have two identical model mirror drives. It's on ASUS Sabertooth 990FX system-/logic-/main-/mother-board, which I don't know has RAID controller or even applicable (SATA, not SCSI.) Slackware .ISO/CD/DVD has a RAID .TXT but describes for root partition. I only want /home RAID1. I don't want to do anything complicated like leave 100MB at the end, because if it fails, I probably won't replace it, or may replace both with much larger drives, start over. What's the best RAID1 setup document/tutorial/HOWTO just helping to mirror /home?

Last edited by dchmelik; 07-15-2019 at 10:16 PM.
 
Old 07-15-2019, 10:51 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Just go with software RAID. I've been using that for years on various systems and haven't seen a major use of CPU power to run it.

Once you create a RAID device, it's just like any other block device.

For example, my /boot directory (I'm still booting with BIOS in 2019) is on a RAID1 device...

Code:
$ cat /proc/mdstat 
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] 
md2 : active raid1 sda3[2] sdb3[0]
      974999360 blocks super 1.2 [2/2] [UU]
      
md127 : active raid1 sde3[0] sdf3[1]
      975099584 blocks super 1.2 [2/2] [UU]
      bitmap: 0/8 pages [0KB], 65536KB chunk

md0 : active raid1 sde2[4](S) sdb2[2] sdf2[5](S) sda2[3]
      523968 blocks super 1.2 [2/2] [UU]
      
unused devices: <none>
From my /etc/fstab...

Code:
/dev/md0                /boot               ext2        defaults  0   0
FWIW, the other two RAID1 devices are used as physical volumes under LVM...

Code:
# pvs
  PV         VG      Fmt  Attr PSize   PFree  
  /dev/md127 mdgroup lvm2 a--  929.91g 918.94g
  /dev/md2   mdgroup lvm2 a--  929.81g      0
...which isn't anything that you've asked about.
 
Old 07-16-2019, 03:15 AM   #3
Labinnah
Member
 
Registered: May 2014
Location: Łódź, Poland
Distribution: Slackware-current
Posts: 185

Rep: Reputation: 112Reputation: 112
I support Richard advice. Use software raid not pseudo-hardware from your mainboard. With mainboard raid you can have problems with data access in case of its failure. And maintenance of this kind of raid is in system very limited.

With Linux software RAID you can do almost everything when system is up and running without any turn offs. About software raid you can in README_RAID.TXT in Slackware CD, or in "mdadm" manual. Additionally I recommend you to enable "bitmap" option as is speedup recovery significantly.

As fast hint, you can create RAID with following command:
Code:
mdadm --create /dev/md0 --bitmap=internal --level=1 --raid-devices=2 /dev/first_drive /dev/second_drive
If you not have additional drives, you can also create degraded RAID with only one driver by replacing second name by word "missing". You can copy then data from old drive to new one in RAID. Then remount /home to RAID and add then add old drive to array to make it real RAID1.


If you not feel comfortable with "mdadm", you can train earlier on some loop devices. See losetup for loop device management.

Last edited by Labinnah; 07-16-2019 at 03:24 AM.
 
2 members found this post helpful.
Old 07-16-2019, 05:42 PM   #4
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
If you're moving /home to the new RAID you will need to mount the new RAID somewhere else first (/mnt/tmp) and transfer existing files across. Then change /etc/fstab to reflect the new RAID array for /home.

Labinnah's command will show you how easy it is to create a software RAID-1 array. You can use 1.2 metadata for the array because the boot limitation requiring 0.90 does not apply to /home.

When I partition devices I usually choose partition type of Linux, instead of Autodetect RAID. Someone will probably come along to tell me this is wrong but it works for me.
 
1 members found this post helpful.
Old 07-16-2019, 06:41 PM   #5
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
For my RAID setups I usually use partition type da - "Non-FS data".

The idea is to avoid type fd, "Linux RAID auto", as some problems can arise in the right circumstances when arrays are assembled automatically and parts from older, no longer used arrays, are left around. I understand that this is not a common problem however.

Last edited by TracyTiger; 07-16-2019 at 06:45 PM.
 
3 members found this post helpful.
Old 07-16-2019, 09:59 PM   #6
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,065

Original Poster
Rep: Reputation: 146Reputation: 146
Thanks for all the replies. I still don't really think I'd understand how to do it (one person just suggested read a document for / instead of /home, which I already said was too complicated) but now I've decided not to do it, because I have too much data to back up. I'll mount the second drive as the largest directory in home, then just use both as they are. I don't want to 'stripe' across drives either, because then if one goes bad, I lose everything. If I just use them for different directories I'd only ever lose the stuff from those directories, not everything.

I'm marking this solved (since I changed my mind) but in the case of any other beginners at RAID reading it looking for a more simple complete tutorial or 'HOWTO', I don't think it's really solved.
 
Old 07-16-2019, 11:56 PM   #7
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by dchmelik View Post
Thanks for all the replies. I still don't really think I'd understand how to do it (one person just suggested read a document for / instead of /home, which I already said was too complicated) but now I've decided not to do it, because I have too much data to back up. I'll mount the second drive as the largest directory in home, then just use both as they are. I don't want to 'stripe' across drives either, because then if one goes bad, I lose everything. If I just use them for different directories I'd only ever lose the stuff from those directories, not everything.

I'm marking this solved (since I changed my mind) but in the case of any other beginners at RAID reading it looking for a more simple complete tutorial or 'HOWTO', I don't think it's really solved.
You've got to give a little more detail on what you've got NOW so that we can tell you how to get to THERE.

If you want detailed responses, you'll have to provide detailed current configuration and detailed future desired configuration.

Moving to software RAID isn't that difficult (not to be confused with Mark Twain's comments about quitting smoking), but we'd have to know what your drive setup is to provide any detailed information on how to move forward.
 
1 members found this post helpful.
Old 07-17-2019, 12:15 AM   #8
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,065

Original Poster
Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by Richard Cranium View Post
You've got to give a little more detail on what you've got NOW so that we can tell you how to get to THERE.

If you want detailed responses, you'll have to provide detailed current configuration and detailed future desired configuration.

Moving to software RAID isn't that difficult (not to be confused with Mark Twain's comments about quitting smoking), but we'd have to know what your drive setup is to provide any detailed information on how to move forward.
My first post had enough information but is irrelevant now.
 
Old 07-17-2019, 09:19 PM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by dchmelik View Post
My first post had enough information but is irrelevant now.
Actually, I don't believe it did.

Are you adding new drives? How big? How many? Do you have data in your /home directory already that you want to keep? Is your /home already mounted against a partition?

I realize that you're not interested in pursuing this matter further and that is absolutely OK. I'm only bringing this up for others who may read this thread in a quest for running RAID1 themselves and think that the amount of information you gave was sufficient for a detailed answer. I won't respond to this thread any more, so feel free to tell me that there is a reason I think that it is dark and foul smelling.
 
Old 07-17-2019, 10:21 PM   #10
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,065

Original Poster
Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by Richard Cranium View Post
Actually, I don't believe it did.
You can believe what you want, and I'll believe what I want.

Quote:
Are you adding new drives?
I stated I had planned to use two drives to try RAID1. To me in this case it doesn't matter if they were new or old, just as stated, they were identical model numbers (they were probably even from the same batch, since I bought them new from one seller at the same time, new, years ago.)

Quote:
How big?
Irrelevant. I didn't ask you to tell me how to use fdisk or a GPT fdisk program. I'd have tried them first without space at the end and if that didn't work, retry.

Quote:
How many?
Stated at the beginning but I guess you speed-read it (incompletely.)

Quote:
Do you have data in your /home directory already that you want to keep? Is your /home already mounted against a partition?
Irrelevant. Of course, I have backups. I was only interested in setting up RAID1 and copying data to it. After I read a bit I realized you have to setup RAID partitions. Obviously I didn't have those yet so obviously the data would have to have been copied in. I wasn't asking how to double-check my backup and unmount, though I would've needed to know anything special about mounting raid partitions.

Last edited by dchmelik; 07-17-2019 at 10:25 PM.
 
Old 07-18-2019, 12:03 AM   #11
Labinnah
Member
 
Registered: May 2014
Location: Łódź, Poland
Distribution: Slackware-current
Posts: 185

Rep: Reputation: 112Reputation: 112
As always, the truth lies, in between. @dchmelik - you provide not sufficient info to write DETAILED answer; @Richard - not necessary all point you write a in fact very important.

Is important how many NEW drives you add - new in meaning not used in system. If you add just one new drive procedures will be different from those when you add two new.
They will also differ when you have home on separated partition/drive and you want use it as part of RAID or no.

If you just want, as you write in last post, just setup RAID1, command I wrote in my previous post will be sufficient. It will create working, active RAID1. It will probably not assemble automatically after reboot without some other minor steps, but will for sure work for here and now.
 
4 members found this post helpful.
Old 05-10-2020, 08:53 PM   #12
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,065

Original Poster
Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by Labinnah View Post
As always, the truth lies, in between. @dchmelik - you provide not sufficient info to write DETAILED answer; @Richard - not necessary all point you write a in fact very important.
False: at the beginning I stated how many drives I'd use (two, and for what type of RAID: 1) and for what (only /home.) As explained, the size of my drives/filesystems (fs) was irrelevant (things should be explained whether you use DOS-type or GPT MBRs) but I knew almost nothing about RAID... whether it was its own fs type.

Quote:
Is important how many NEW drives you add - new in meaning not used in system. If you add just one new drive procedures will be different from those when you add two new.
They will also differ when you have home on separated partition/drive and you want use it as part of RAID or no.
That would've been interesting to know, but I said I was using two (so either have '/home' (which most people have, and from the time I've been here, it's clear I have...) and adding a mirror, or adding two that will mirror and making a new /home)... obviously if there was no reason to erase /home and copy from backup, I wouldn't.

Quote:
If you just want, as you write in last post, just setup RAID1, command I wrote in my previous post will be sufficient. It will create working, active RAID1. It will probably not assemble automatically after reboot without some other minor steps, but will for sure work for here and now.
Thank you. Thank you to Richard, also, thought the amount of extra stuff he said confused me for a while (such as example for / rather than /home, but I had no idea if when people boot from RAID it's setup different from if they have /home on RAID.) Going back, now I see (such as Labbinnah's command, and earlier, how things might be mounted) how I could set this up maybe for any directory... however, I still feel I only have a vague-type basic idea of it mixed up in which some aspects may or not be unstated, and extra aspects are stated. Maybe if I still try it from your command in the future, it'd work, or maybe I'd have to continue this thread.

Theoretically I'm still interested in hardware RAID; saw zero explanation why that's 'pseudo-raid,' or why it'd fail less than software, and if it fails, likely you will know, and likely other things failed earlier so you'd want to replace system-/logic-/main-/mother-board... that's also why people should do backups! One aspect is perhaps does software RAID use more system resources than hardware RAID...?

Last edited by dchmelik; 05-10-2020 at 09:03 PM.
 
Old 05-10-2020, 09:38 PM   #13
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Well, most RAID enabled cards that you'd probably buy in the consumer market are running the same algorithms as software RAID. There's potentially the added twist that they might structure the meta-data so that only their specific cards are able to understand that meta-data; ergo, if your current card fails, you'll have to buy another one from the same company in order to resurrect your RAID array(s).

I've migrated entire systems that used software RAID and I didn't give a rat's ass about the underlying SATA controller hardware, because I didn't have to.

As I believe that I mentioned earlier, I have not been able to detect a major drain upon my system resources while running software RAID. I've got many RAID-1 arrays running about, and one RAID-5 array.

But, if you want to experiment and have good backups, there's absolutely no reason for you to not to use hardware RAID. For that matter, as long as you have good backups, there's no reason to treat it as an experiment; just use hardware RAID.
 
2 members found this post helpful.
  


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
lvm volume group on raid1: physically move raid1 array from server 1 to server 2 Sum1 Linux - Software 4 07-20-2018 11:20 AM
[SOLVED] lvm and luks on raid1 in slackware64-14.1 slac-in-the-box Slackware 10 03-24-2014 10:38 PM
Slackware64 14.1 initrd for generic kernel can't find RAID1 root partition octetstream Slackware 2 12-21-2013 07:28 AM
Slackware64 14.0 Raid1+0 with LVM issues slacker1337 Slackware - Installation 2 08-02-2013 09:44 PM
Have software raid1, but like to change to raid1+0 or 0+1, how? spaceuser Debian 8 03-17-2008 02:07 PM

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

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