View previous topic :: View next topic |
Author |
Message |
Truzzone Guru
Joined: 16 Oct 2003 Posts: 492 Location: Italy
|
Posted: Mon Oct 07, 2013 11:42 am Post subject: [Solved] initramfs at boot cannot start mdadm? |
|
|
Hi,
I have just update my gentoo from an old install, I have already do an emerge -e world and I fixed all.
One thing that I can't do it's to autostart at boot the assemble of my / in raid1 software.
I have update to the latest kernel configured by hand: this is the config, the raid section:
Code: | CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_AUTODETECT=y
CONFIG_MD_LINEAR=y
CONFIG_MD_RAID0=y
CONFIG_MD_RAID1=y
CONFIG_MD_RAID10=y
CONFIG_MD_RAID456=y
CONFIG_MD_MULTIPATH=y
CONFIG_MD_FAULTY=y
# CONFIG_BCACHE is not set
CONFIG_BLK_DEV_DM=y
# CONFIG_DM_DEBUG is not set
CONFIG_DM_CRYPT=y
CONFIG_DM_SNAPSHOT=m
# CONFIG_DM_THIN_PROVISIONING is not set
# CONFIG_DM_CACHE is not set
CONFIG_DM_MIRROR=m
CONFIG_DM_RAID=m
# CONFIG_DM_LOG_USERSPACE is not set
CONFIG_DM_ZERO=m
CONFIG_DM_MULTIPATH=m
# CONFIG_DM_MULTIPATH_QL is not set
# CONFIG_DM_MULTIPATH_ST is not set
# CONFIG_DM_DELAY is not set
CONFIG_DM_UEVENT=y |
after compiling kernel I create the initramfs with:
Code: | genkernel --install --no-ramdisk-modules --mdadm --mdadm-config=/etc/mdadm.conf initramfs |
/etc/mdadm.conf
Code: | ARRAY /dev/md/0 metadata=0.90 UUID=xx
ARRAY /dev/md/1 metadata=0.90 UUID=xx
ARRAY /dev/md/2 metadata=0.90 UUID=xx
|
where: md0 /boot
md1 swap
md2 /root
cat /proc/mdstat
Code: | Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md2 : active raid1 sda3[0] sdb3[1]
147822016 blocks [2/2] [UU]
md1 : active raid1 sda2[0] sdb2[1]
8393856 blocks [2/2] [UU]
md0 : active raid1 sda1[0] sdb1[1]
72192 blocks [2/2] [UU]
unused devices: <none> |
/boot/grub/grub.conf
Code: | default 0
timeout 15
spalshimage=(hd0,0)/boot/grub/splash.xpm.gz
title=Gentoo Server
root (hd0,0)
kernel /boot/kernel-udev2 real_root=/dev/md2 domdadm rootfstype=ext4
initrd /boot/initramfs2
|
The problem:
At boot initramfs:
Code: | Oct 5 17:27:14 Server kernel: [ 3.557686] sd 3:0:0:0: [sde] Mode Sense: 00 3a 00 00
Oct 5 17:27:14 Server kernel: [ 3.557707] sd 3:0:0:0: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Oct 5 17:27:14 Server kernel: [ 3.558212] sd 3:0:1:0: Attached scsi generic sg5 type 0
Oct 5 17:27:14 Server kernel: [ 3.558385] sd 3:0:1:0: [sdf] Write Protect is off
Oct 5 17:27:14 Server kernel: [ 3.558478] sd 3:0:1:0: [sdf] Mode Sense: 00 3a 00 00
Oct 5 17:27:14 Server kernel: [ 3.577088] sda: sda1 sda2 sda3
Oct 5 17:27:14 Server kernel: [ 3.577217] sd 0:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Oct 5 17:27:14 Server kernel: [ 3.577715] sd 0:0:0:0: [sda] Attached SCSI disk
Oct 5 17:27:14 Server kernel: [ 3.581207] sdd: sdd1
Oct 5 17:27:14 Server kernel: [ 3.585995] sdc: sdc1
Oct 5 17:27:14 Server kernel: [ 3.586010] sd 2:0:1:0: [sdd] Attached SCSI disk
Oct 5 17:27:14 Server kernel: [ 3.586239] sde: sde1
Oct 5 17:27:14 Server kernel: [ 3.586268] sd 3:0:1:0: [sdf] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Oct 5 17:27:14 Server kernel: [ 3.586288] sdb: sdb1 sdb2 sdb3
Oct 5 17:27:14 Server kernel: [ 3.586566] sd 2:0:0:0: [sdc] Attached SCSI disk
Oct 5 17:27:14 Server kernel: [ 3.586889] sd 0:0:1:0: [sdb] Attached SCSI disk
Oct 5 17:27:14 Server kernel: [ 3.614281] sdf: sdf1
Oct 5 17:27:14 Server kernel: [ 3.614493] sd 3:0:0:0: [sde] Attached SCSI disk
Oct 5 17:27:14 Server kernel: [ 3.614714] sd 3:0:1:0: [sdf] Attached SCSI disk
Oct 5 17:27:14 Server kernel: [ 3.615036] Freeing unused kernel memory: 840K (ffffffff818ee000 - ffffffff819c0000)
|
and a prompt ask a root partition.
I type shell and assemble the md[012] raid with mdadm -A, type CTRL+D, type /dev/md2 as root partition and the system boot fine.
How I can start/invoke mdadm in the initramfs boot sequence for automount / partition?
I already check/recompile twice all parameters, I already check all forums posts about software raid in root partition but nothing I the mdadm can't assemble at boot.
Any suggestions?
Best regards,
Truzzone
Last edited by Truzzone on Fri Oct 11, 2013 2:56 pm; edited 1 time in total |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54099 Location: 56N 3W
|
Posted: Mon Oct 07, 2013 5:53 pm Post subject: |
|
|
Truzzone,
One thing to check, it looks like you have done the hard bits.
The partition types for elements of a raid that will be auto detected must be 0xfd. Check/fix with fdisk. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Truzzone Guru
Joined: 16 Oct 2003 Posts: 492 Location: Italy
|
Posted: Mon Oct 07, 2013 6:35 pm Post subject: |
|
|
Thank for your reply NeddySeagoon, sorry I missed in the fist post:
fdisk -l /dev/sd[ab] :
Code: | Disk /dev/sda: 160.0 GB, 160041885696 bytes, 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0xee2bcaef
Dispositivo Boot Start End Blocks Id System
/dev/sda1 * 63 144584 72261 fd Autorilevamento raid di Linux
/dev/sda2 144585 16932509 8393962+ fd Autorilevamento raid di Linux
/dev/sda3 16932510 312576704 147822097+ fd Autorilevamento raid di Linux
Disk /dev/sdb: 160.0 GB, 160041885696 bytes, 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0x00000000
Dispositivo Boot Start End Blocks Id System
/dev/sdb1 * 63 144584 72261 fd Autorilevamento raid di Linux
/dev/sdb2 144585 16932509 8393962+ fd Autorilevamento raid di Linux
/dev/sdb3 16932510 312576704 147822097+ fd Autorilevamento raid di Linux
|
Until kernel linux-3.0.6-gentoo I use this system without initramfs and without any problems at boot.
It seems at boot after hard disk initialization don't autostart automatically mdadm...
I use:
Code: | grub --version
grub (GNU GRUB 0.97) |
Any suggestions?
Best regards,
Truzzone |
|
Back to top |
|
|
cal22cal n00b
Joined: 19 Jan 2006 Posts: 36
|
Posted: Thu Oct 10, 2013 3:49 am Post subject: |
|
|
Would it be possible the /etc/mdadm.conf does not match with the current UUID ? |
|
Back to top |
|
|
Truzzone Guru
Joined: 16 Oct 2003 Posts: 492 Location: Italy
|
Posted: Thu Oct 10, 2013 1:16 pm Post subject: |
|
|
cal22cal wrote: | Would it be possible the /etc/mdadm.conf does not match with the current UUID ? |
I already regenerate two times the /etc/mdadm.conf and than the initramfs but no work.
The strange thing it's there is no output in the log about the initializing of assemble, I assemble by hand in the shell and after boot correctly
There is a way to activate a more verbose log of initramfs?
Best regards,
Truzzone |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54099 Location: 56N 3W
|
Posted: Thu Oct 10, 2013 8:26 pm Post subject: |
|
|
Truzzone,
Can you take your initramfs apart and post the init script it contains please?
Its a cpio archive of cpio archives.
If your raid superblock versions are 0.90, the kernel can assemblt your raid sets. mdadm is not needed.
To check, run
Each partition that is a member of a raid set will show something like Code: | # mdadm -E /dev/sda1
/dev/sda1:
Magic : a92b4efc
Version : 0.90.00 | Where Version is the raid superblock (also called metadata) Version. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Truzzone Guru
Joined: 16 Oct 2003 Posts: 492 Location: Italy
|
Posted: Thu Oct 10, 2013 10:41 pm Post subject: |
|
|
Thank for your reply NeddySeagoon!
uhm I try to decompress initramfs:
Code: | gunzip initramfs2
gzip: initramfs2: unknown suffix -- ignored |
I'm in the wrong way?
Sorry this is new for me
Code: | mdadm -E /dev/sd[ab][123] | sed -e '/Magic/,/Version/!d'
Magic : a92b4efc
Version : 0.90.00
Magic : a92b4efc
Version : 0.90.00
Magic : a92b4efc
Version : 0.90.00
Magic : a92b4efc
Version : 0.90.00
Magic : a92b4efc
Version : 0.90.00
Magic : a92b4efc
Version : 0.90.00 |
Best regards,
Truzzone |
|
Back to top |
|
|
cal22cal n00b
Joined: 19 Jan 2006 Posts: 36
|
Posted: Fri Oct 11, 2013 8:32 am Post subject: |
|
|
To extract the file
Code: | cp initramfs2 to a empty directory
file initramfs2
should indicate as a xz file
xz -dc initramfs2 | cpio -ivd |
NeddySeagoon is correct, even I put a wrong mdadm.conf file in /etc/mdadm.conf, during genkernl,
my kernel still can construct the right /dev/md1 /dev/md3
I just playing around with bcache, and the doc mentioned about a
Code: | http://bcache.evilpiepirate.org/
rootdelay=3 | in the kernel command.
Would it be worth a trial? |
|
Back to top |
|
|
Truzzone Guru
Joined: 16 Oct 2003 Posts: 492 Location: Italy
|
Posted: Fri Oct 11, 2013 12:45 pm Post subject: |
|
|
Code: | cat etc/initrd.scripts | wgetpaste
Your paste can be seen here: http://bpaste.net/show/139599/ |
I try now:
Code: | rm -r /var/tmp/genkernel/
rm /etc/mdadm.conf
mdadm --detail --scan >> /etc/mdadm.conf
genkernel --install --no-ramdisk-modules --mdadm --mdadm-config=/etc/mdadm.conf initramfs
mv /boot/initramfs-genkernel-x86_64-3.11.2-gentoo-kvm /boot/initramfs2
*add in kernel line rootdelay=5
reboot |
At boot cannot load initramfs and show a kernel error but the screen go over and I can't see what do before trace
Best regards,
Truzzone |
|
Back to top |
|
|
Truzzone Guru
Joined: 16 Oct 2003 Posts: 492 Location: Italy
|
Posted: Fri Oct 11, 2013 2:55 pm Post subject: |
|
|
After I try to redirect console to serial port via grub, adding console=ttyS0,115200n8, without success, I have understand the kernel cannot read grub parameter.
After I parse al kernel parameter I found this one activated: Built-in command line overrides boot loader arguments [CONFIG_CMDLINE_OVERRIDE] take off flag, recompile kernel and I'm able to load system automatically without any parameters and without initramfs!
I don't know why-where-when this option was selected (I think in an old config that I have take... )
Thanks again to NeddySeagoon and cal22cal for support me!
Best regards,
Truzzone
PS: Can I redirect the console to ttyS0,115200n8 simultaneously to tty0 |
|
Back to top |
|
|
|