LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-12-2018, 08:18 PM   #1
road hazard
Member
 
Registered: Nov 2015
Posts: 103

Rep: Reputation: Disabled
mkinitcpio with the mdadm_udev hook vs update-initramfs -u


In the Debian world, I know how to create an mdadm array, format the file system and mount it. I was doing the same in Antergos while following the Arch wiki and things sort of went off the rails when I got towards the end.

In Debian, to save the array layout, you use: sudo update-initramfs -u

In Antergos/Arch, I guess that step is replaced with mkinitcpio and using the 'mdadm-udev' hook. When I got to that spot in the arch Wiki, the commands I was asked to type gave me bash errors so I manually edited the mdadm.conf file and added:

ARRAY /dev/md0 metadata=1.2 name=antergos:0 UUID=0078e14e:6ce6b00e:598d3151:beeb6694

then edited fstab.conf and added:
/dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 0

My array is mounted at every boot and appears to be running AOK but since I didnít do anything with mkinitcpio, did I miss some crucial step?

That wiki ( https://wiki.archlinux.org/index.php...iguration_file ) is easy enough to follow but after the steps about creating the array, it jumps to installing Arch ONTO the array. To a newbie, it seems to go sideways when telling you what to do after the array is created and what you need to do to save the layout.

Looking at the mkinitcpio wiki ( https://wiki.archlinux.org/index.php...o#Installation ) , do I just issue the following command: mkinitcpio -c /etc/mkinitcpio-custom.conf -g /boot/linux-custom.img Ö and add that mdadm_udev hook to the conf file?

Or, since I have the array mounting at boot, is everything ďOKĒ and even though I didnít use mkinitcpio, just leave it alone?

EDIT:

I went ahead and executed: sudo mkinitcpio -c /etc/mkinitcpio.conf -g /boot/linux-custom.img and added mdadm_udev to the hooks section and everything looks good?!

I noticed there were a few more images in the /boot folder. fallback, lts, etc. Do I need to update those images with mkinitcpio?

I believe all Iím doing is creating a boot image that has built in support for mounting my RAID at startup, correct? If so, this isnít a boot array or anything, just data for my Plex server so some worse case scenario my array doesnít get mounted at startup, it isnít the end of the world for me. Just means Iíll have to come back here and ask for help.

I guess I'm just looking for advice on mkinitcpio usage since I might be swtiching from Mint to Antergos on my Plex server.
 
Old 01-12-2018, 08:59 PM   #2
Soitgoes
Member
 
Registered: Oct 2016
Location: Beyond Thunderdome
Distribution: Gentoo
Posts: 67

Rep: Reputation: Disabled
Running both the update-initramfs -u and mkinitcpio seems redundant. Both, I would think perform the same function. So you boot your system to grub or lilo and then that bootstraps the kernel which in turn hands over control to the initramfs to initialize your file systems and then hands control to the init system. Both the above ‘hooks’ prepared your initramfs.. So if everything is working as it should, probably one of the above commands would suffice and I don’t think you are missing a step. Just my two cents.
 
Old 01-12-2018, 09:49 PM   #3
road hazard
Member
 
Registered: Nov 2015
Posts: 103

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Soitgoes View Post
Running both the update-initramfs -u and mkinitcpio seems redundant. Both, I would think perform the same function. So you boot your system to grub or lilo and then that bootstraps the kernel which in turn hands over control to the initramfs to initialize your file systems and then hands control to the init system. Both the above Ďhooksí prepared your initramfs.. So if everything is working as it should, probably one of the above commands would suffice and I donít think you are missing a step. Just my two cents.
It looks like that update-initramfs -u command only works in Debian land. In the Arch world, I think the equivalent command is replaced with mkinitcpio. I just don't fully understand that command and if it's fully necessary to run it to save your mdadm array into the kernel image.
 
Old 01-12-2018, 09:52 PM   #4
Soitgoes
Member
 
Registered: Oct 2016
Location: Beyond Thunderdome
Distribution: Gentoo
Posts: 67

Rep: Reputation: Disabled
Technically you don’t even need an initramfs unless you are running a more exotic filesystem or using something like LUKs for encryption. But yes, I believe one is the Debian solution for creating an initramfs and one is the Arch way.
https://unix.stackexchange.com/quest...without-initrd

Last edited by Soitgoes; 01-12-2018 at 09:56 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
update-initramfs takes too long esso82 Linux - Newbie 1 05-23-2014 11:32 AM
update-initramfs Locale Issue FizzerJE Linux - Software 0 07-28-2011 09:34 AM
How clean up after update-initramfs -u Muscovy Ubuntu 3 06-22-2010 02:30 PM
[SVN - post-commit hook] hook failed, did not exit cleanly G00fy Programming 0 01-21-2009 02:15 AM
update-initramfs -u Geminias Linux - Newbie 1 07-30-2007 04:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration