LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   create software raid1 on one disk, later add second disk? (http://www.linuxquestions.org/questions/slackware-14/create-software-raid1-on-one-disk-later-add-second-disk-4175449017/)

WiseDraco 02-07-2013 08:47 AM

create software raid1 on one disk, later add second disk?
 
Hello!
I want to install my new home server on software raid 1, on two physically disks. problem is in money - i cannot purchase both hdd at a time, as so i plan in few days buy first hdd, and approx after month buy a second one ( st500dm005, sata2, 500 gb energy friendly).
can i install slackware 14 x32 as on raid1 with only one disk, with plans to add another disk to mirror later? there is be any problem that? can any do that previously?

also thinking about distro - x32 or better, x64? plan to run it in apache with joomla 2.5, samba server, sendmail with procmail, milter regex and spamassassin filters. also dns, ftp, but that on x64 works without problems, i think....who you says?
PS hw is asus p5b mobo ( i965 chipset), c2d 2 ghz cpu, 4 gb RAM, 3com905cx, rtl8139 and built in mobo realteg gigabit NIC...

TobiSGD 02-07-2013 09:13 AM

Yes, this is totally possible.
As for which Slackware version, at first, please don't mix up the terms. x32 (aka multiarch) is not the same as IA32 or x86 and there currently is no Slackware version that supports x32. As I see it, as long as your hardware supports it I would go for 64 bit. 32 bit may be worth consideration if you have to run 32 bit software and don't want to maintain a multilib system, but other than that there is no reason not to use the advanced features of your CPU.

WiseDraco 02-07-2013 09:20 AM

Quote:

Originally Posted by TobiSGD (Post 4886279)
Yes, this is totally possible.
As for which Slackware version, at first, please don't mix up the terms. x32 (aka multiarch) is not the same as IA32 or x86 and there currently is no Slackware version that supports x32. As I see it, as long as your hardware supports it I would go for 64 bit. 32 bit may be worth consideration if you have to run 32 bit software and don't want to maintain a multilib system, but other than that there is no reason not to use the advanced features of your CPU.

ok, thanks for clarification about x32
i do not have any problems with apache and joomla 2.5 ( and mysql) on 64bit slack? all it works on it ok?

TobiSGD 02-07-2013 09:46 AM

Quote:

Originally Posted by WiseDraco (Post 4886293)
ok, thanks for clarification about x32
i do not have any problems with apache and joomla 2.5 ( and mysql) on 64bit slack? all it works on it ok?

I don't use Joomla, but I don't think that there are any problems. Since Joomla is widely used and most larger servers run 64 bit OSes for years now I assume it would be known and pointed out on their website if there are problems with 64 bit.

tux_dude 02-08-2013 08:25 PM

To setup a RAID1 array with one device, need to create a degraded array. Look up the man pages for mdadm on how to create arrays with missing devices. Once you get the other disk, add it to the RAID array and mdadm will do the rebuild automatically. I like to call this the PMR (Poor Man's RAID).

Slackovado 02-17-2013 08:20 PM

Quote:

Originally Posted by WiseDraco (Post 4886261)
Hello!
I want to install my new home server on software raid 1, on two physically disks. problem is in money - i cannot purchase both hdd at a time, as so i plan in few days buy first hdd, and approx after month buy a second one ( st500dm005, sata2, 500 gb energy friendly).
can i install slackware 14 x32 as on raid1 with only one disk, with plans to add another disk to mirror later? there is be any problem that? can any do that previously?

also thinking about distro - x32 or better, x64? plan to run it in apache with joomla 2.5, samba server, sendmail with procmail, milter regex and spamassassin filters. also dns, ftp, but that on x64 works without problems, i think....who you says?
PS hw is asus p5b mobo ( i965 chipset), c2d 2 ghz cpu, 4 gb RAM, 3com905cx, rtl8139 and built in mobo realteg gigabit NIC...

I just did this on my own system.
I had raid 5 before and replaced it with raid 1 going from 3x320Gb drives to 2x2Tb drives.
My /home directory was on that raid5 and needed to be moved to the new drives.
It was easier to install that one new drive in the system, create a raid one on it, copy all my data from the old raid 5, and then remove the old drives and add the second new drive to the system and let the raid 1 sync both drives.
I got most of my raid info from the Slackware raid howto.
But the following commands are directly relevant to the task.
If anyone notices any errors or omissions, please correct them.

Creating raid 1 with only one drive (already had /dev/md0 in the system plus a boot SSD drive with Slackware on it, so devices /dev/sda to /dev/sdd were used)
Code:

mdadm --create /dev/md1 --level 1 --raid-devices 2 /dev/sde1 missing
Then I created file system on the new md1 raid (xfs system in my case, no partitions)
Code:

mkfs.xfs /dev/md1
Created a new directory for it in /mnt
Code:

mkdir /mnt/newhome
and mounted
Code:

mount /dev/md1 /mnt/newhome
Then copied everything from my /home to the /newhome
Code:

rsync -a --force /home /mnt/newhome
Then power off computer, disconnect old drives and add the second new drive.
The new drives are now /dev/sdb and /dev/sdc so the /dev/md1 is no longer valid after reboot.
Also the old /home which was on /dev/md0 is now gone.
So as root have to re assemble the new raid 1 but first stop the wrongly auto-detected raid by kernel
Code:

mdadm -S /dev/md127
(could be a different number on your system)

Code:

mdadm -A /dev/md0 /dev/sdb1
mdadm /dev/md0 --add /dev/sdc1

That's it
You can then mount /home again
and check that the two new drives are syncing
Code:

mdadm -D /dev/md0
It worked great for me.
And I'd like to add that I've been running Linux software raid now for about a decade or longer in my own systems and used it in various other places (office backup computers and servers) for quite a few years and it has never failed me.
Combined with the know-how of partitioning utilities, fstab,initrd, and lilo it's a steep learing curve for newbies but it's a worthwhile investment because it's such a great and reliable technology.
And my limited know-how (I'm still a newbie myself) has only scratched the surface yet I've been reaping wonderful benefits for many years.
Good luck.


All times are GMT -5. The time now is 12:02 AM.