ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: ALT Linux Sisyphus discussion list <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] LVM в initrd для ядра 2.6.14-std26-up-alt5
Date: Fri, 10 Mar 2006 12:58:58 +0300
Message-ID: <20060310095858.GR2873@master.mivlgu.local> (raw)
In-Reply-To: <4411435C.3070003@ats-manager.stc.donpac.ru>

[-- Attachment #1: Type: text/plain, Size: 2942 bytes --]

On Fri, Mar 10, 2006 at 12:14:04PM +0300, Eugene Prokopiev wrote:
> Половину своей задачи я решил: в initrd все инициализируется правильно, 
> но вот переключиться из initrd в настоящую систему я не могу.
> 
> Что я сейчас имею: ALM 2.4 + updates + некоторые backports + kernel 
> 2.6.14-std26-up-alt5 из Сизифа
...
> Содержимое initroot (взято из оригинального initrd, сгенерированного 
> посредством mkinitrd):
> 
> #!/bin/sh
> 
> EncodeDev()
> {
>          echo $(( ($2 & 0xff) | ($1 << 8) | (($2 & ~0xff) << 12) ))
> }
> 
> read cmdline </proc/cmdline
> cmdline=" $cmdline "
> if test -z "${cmdline##*[        ]root=*}" ; then
>          root="${cmdline##*[      ]root=}"
>          root="${root%%[  ]*}"
>          if test -z "${root##/dev/*}" ; then
>                  root="${root#/dev/}"
>                  (
>                  read ignored
>                  read ignored
>                  while read major minor size name ignored; do
>                          if test "$name" = "$root" ; then
>                                  EncodeDev $major $minor 
>  >/proc/sys/kernel/real-root-dev
>                                  break
>                          fi
>                  done
>                  ) </proc/partitions
> 
>          fi
> fi

Этот кусок - костыль для ядер 2.6.x, которые разучились находить
major/minor по имени устройства из root=... в случае, когда
соответствующий драйвер вынесен в модуль.

> В итоге я получаю:
> 
> VFS: Cannot open root devoce "3a00" or unknown-block(58,0)

Однако в данном случае даже этот костыль не сработал, что неудивительно.
Major 58 - это устройства LVM1, использовавшиеся в ядрах 2.4.x; скорее
всего, его подцепил lilo при установке под 2.4.x (lilo передаёт root=... в
виде числа, а код разбора root=... в ядре и в приведённом куске не нашёл
ничего лучше).

LVM2 работает через dm, у которого major/minor динамические, и их даже
нельзя найти в /proc/partitions (точнее, они там видны, но под совершенно
бесполезными именами).

> Please append a correct "root" boot option
> Kernel panic - not syncing : VFS : Unable to mount root fs on unknown 
> block(58,0)
> 
> Если вместо initroot в linuxrc вписать вызов /bin/bash, то дальше руками 
> я смогу смонтировать свои lvm-разделы. Точно также их монтирует штатное 
> ядро 2.4.26-std-up-alt13
> 
> Что делать дальше?

Если оставлять старый механизм работы с initrd, нужно определить
major/minor нужного устройства в /dev, созданного утилитами lvm, и
записать его в /proc/sys/kernel/real-root-dev.

Можно перейти на новый механизм обработки initrd (root=/dev/ram0, linuxrc
запускается как init (pid==1) и должен смонтировать реальный root, после
чего выполнить pivot_root туда и exec /sbin/init).

Либо перейти на initramfs (примерно то же самое, но вместо pivot_root
выполняется chroot, и хорошо бы зачистить за собой initramfs, чтобы не
занимать память).

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2006-03-10  9:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-09  6:03 Eugene Prokopiev
2006-03-10  9:14 ` Eugene Prokopiev
2006-03-10  9:50   ` Eugene Prokopiev
2006-03-10  9:58   ` Sergey Vlasov [this message]
2006-03-10 11:38     ` Eugene Prokopiev
2006-03-10 12:38       ` Sergey Vlasov
2006-03-10 19:50         ` Eugene Prokopiev
2006-03-13 12:55       ` Eugene Prokopiev
2006-03-13 13:06         ` Eugene Prokopiev
2006-03-13 13:45         ` Sergey Vlasov
2006-03-13 15:03           ` Eugene Prokopiev
2006-03-13 15:22             ` Sergey Vlasov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060310095858.GR2873@master.mivlgu.local \
    --to=vsu@altlinux.ru \
    --cc=sisyphus@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git