[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
RAID1 question with solution
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 11
Thread images: 2
File: Raid1.jpg (547 KB, 3000x2786) Image search: [Google]
Raid1.jpg
547 KB, 3000x2786
So I made a thread a few days ago about a simple problem.

> Install Ubuntu 16.04, or any recent major distro
> Set up a RAID1 at install, or post-install
> Remove drive A (main), and try to boot

Of course no one came up with a solution, which was not really surprising. And we had a real retard in the thread as well with, "ure stupid XD" replies.
>>
So. Here is the solution, as promised.

We place the script here, so it will get "baked" into our initramfs.
nano -w /usr/share/initramfs-tools/scripts/local-premount/sleepAwhile


Script content:
#!/bin/sh
echo
echo "wait 5 sec"
sleep 5
mdadm —run /dev/md0
mdadm —run /dev/md1
mdadm —run /dev/md2
echo "done waiting"


CTRL+X , Y (Exit, Save)

We make the script executable.
chmod a+x /usr/share/initramfs-tools/scripts/local-premount/sleepAwhile


Not even sure if we have to update grub, but hey, why not:
update-grub


And finally, we refresh the initramfs:
update-initramfs -u -k all
>>
>>55452882
>>55452908
mdadm —run /dev/md0
mdadm —run /dev/md1
mdadm —run /dev/md2


This is the important bit.
Adjust this to your needs.

To check your md devices, use:
cat /proc/mdstat



Basically, that's it.
The sleep is only there in the script because on the Stack Exchange site, a guy said it happens because the HDD does not comes up. That's not true, but hey, it *could* be the case and 5 seconds, what's that.
>>
>>55452926
>>55452908
I wasn't in the last thread, but RAID 1 with 3 drives. wtf is wrong with you
>>
And so you guys don't leave empty handed...

When you partition in Debian or Ubuntu, you might press "Set up software raid" first. Then you just end up with one partition - where you can set up LVM. That's one way to go, but it's a bit messier.
LVM can also cause you headache because it's also bitching about degraded booting.

So.
Basically, set up the same partitions on both drives.
Like so:

/dev/sda1 /boot ext2 10GB
/dev/sda2 swap swap 10GB
/dev/sda3 / ext4 {max GB}


Do the same for /dev/sdb, /dev/sdc, as many mirrors you have.
Make sure they are all the same size, etc.

THEN, go into software raid.
Pick /dev/sda1, /dev/sdb1 for one.
OK, then /dev/sda2, /dev/sdb2.
So on.
You will have 3 MD devices, and the install can finish.

Practice in virtual machines.

>>55452937
And this is why you should been in good threads. But now you will already learn something, see this reply.

It's basically just 3 MD device, not 3 drives.
>>
>>55452937
>>55452956
And just to give you a reason why would you use 3 RAID1 devices...

> ghetto NAS. pendrives are cheap, but they can die. get at least three, same sized one, different brands, RAID them up. you have a super reliable root-boot drive.
> mission critical data - I don't really have to explain this one

>>55452956
Of course if you have 3 drives, set up /dev/sdc, and so on. If you fuck up, you can just fix raid after install of course, but then you have to set up the rest of the system too for RAID.
>>
File: Undercontrol.png (14 KB, 723x409) Image search: [Google]
Undercontrol.png
14 KB, 723x409
>>55452973
no, still think this is a bad idea. Tons of people have lost all sorts of shit by this hot-spare bullshit. As soon as you lose a drive it is going to stress the fuck out of the remaining one. Better to fail/alert and control recovery rather than this shit. Especially if you are using "ghetto" drives.
>>
>>55453035
What?
mdadm sends you an email if the array gets degraded....

> stress the fuck out
What?
It's RAID1, not RAID10, or RAID5...
All the pendrives - if we are talking about that setup - would get stressed the same amount, that's why I advised to get different brands, so they won't fail together at once.
>>
>>55453035
>>55453086
And trust me, it's not a bad solution.
How often do you do writes on your root drive?
Once when you install?
Sometimes when you upgrade?

That's so small, the pendrives will work for years to come. And most cheapo NAS/Atom boards have very limited SATA connectors.

For example FreeNAS can also be set up with several RAID1 boot-root drives, and that allows you to use the rest of the connectors without a mess.
>>
>>55453105
>And trust me, it's not a bad solution.
nah, 4chan. Seem anyone can post here.

Keep up the effort as this board stinks of video game monkeys and shitposters, but you aren't convincing me of fucking anything with your skill set. Have a good night
>>
>>55453263
This is why I hate Linux and the surrounding community.
Thread replies: 11
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.