public inbox for initramfs@vger.kernel.org
 help / color / mirror / Atom feed
* swap device reference causes problem with initramfs for diskless clients
@ 2015-07-10 15:01 Frank Steiner
       [not found] ` <559FDE38.2080808-G0GEQqhI7DhYiKXMg8wJIg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Steiner @ 2015-07-10 15:01 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

Hi,

when trying to create a initramfs for a diskless client with dracut like

dracut -f initrd.diskless --kver=blabla--add nfs --add disklessmount 
  --kernel-cmdline "ip=eth0:dhcp root=nfs:<some ip>:/"

dracut will include a lot of references to the swap device of the host
where we execute this command. The /lib/dracut/hooks/initqueue/finished/devexists-<uuid>
will cause the diskless client to hang waiting for this device to show up.

The hard encoded swap device makes it impossible to create a initrd for
a host other than the one it is created on. The only workaround is to
comment out the line for the swap device in /etc/fstab, create the
initramfs and uncomment the line again. Not a good solution, though, as
we usually create the initrds automatically in %post sections of kernel rpms
and I don't want a script to mess around with the fstab.

As was proposed in http://thread.gmane.org/gmane.linux.kernel.initramfs/4111/focus=4112
there really should be a way to tweak the swap handling or at least to
disable it completely. I don't understand why I need a running swap
in the initramfs anyway, but if you see any interesting cases for this, 
please let me choose if I want it or not by default! For all our hosts
it would be ok if swap was only activated after chroot to /sysroot, and
all the "I cannot boot after I deleted/changed my swap space" posts you
find googling seem to indicate that many people could benefit from an 
easy way to disable swap in dracut.

cu,
Frank

-- 
Dipl.-Inform. Frank Steiner   Web:  http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik    Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17           Phone: +49 89 2180-4049
80333 Muenchen, Germany       Fax:   +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: swap device reference causes problem with initramfs for diskless clients
       [not found] ` <559FDE38.2080808-G0GEQqhI7DhYiKXMg8wJIg@public.gmane.org>
@ 2015-07-15  8:05   ` Frank Steiner
       [not found]     ` <55A6142D.9090508-G0GEQqhI7DhYiKXMg8wJIg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Steiner @ 2015-07-15  8:05 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

Frank Steiner wrote

> dracut will include a lot of references to the swap device of the host
> where we execute this command.

By the way, doesn't this contradict the idea of the host-only mode?

     Host-Only mode: Install only what is needed for booting the local host
     instead of a generic host and generate host-specific configuration.

Thus, including hard-coded, non-overridable UUID references to a local
hard disk doesn't really create a config for a "generic" host as should 
be done without the host-only option? Having a rd.swap parameter really
would help :-)

cu,
Frank

-- 
Dipl.-Inform. Frank Steiner   Web:  http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik    Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17           Phone: +49 89 2180-4049
80333 Muenchen, Germany       Fax:   +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: swap device reference causes problem with initramfs for diskless clients
       [not found]     ` <55A6142D.9090508-G0GEQqhI7DhYiKXMg8wJIg@public.gmane.org>
@ 2015-08-06 10:46       ` Frank Steiner
  0 siblings, 0 replies; 3+ messages in thread
From: Frank Steiner @ 2015-08-06 10:46 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

Frank Steiner wrote

> Frank Steiner wrote
> 
>> dracut will include a lot of references to the swap device of the host
>> where we execute this command.
> 
> By the way, doesn't this contradict the idea of the host-only mode?
> 
>      Host-Only mode: Install only what is needed for booting the local host
>      instead of a generic host and generate host-specific configuration.
> 
> Thus, including hard-coded, non-overridable UUID references to a local
> hard disk doesn't really create a config for a "generic" host as should 
> be done without the host-only option? Having a rd.swap parameter really
> would help :-)

The SuSE support pointed me to the -no-hostonly option that solved my
problem. I really wasn't aware that there are three modes in dracut:
a host-only, a non-host-only and a something-in-between mode. Seems
strange to me. Why does it make sense to create a initrd by default,
that is more generic than a host-only one but not generic enough to run 
on other hosts by missing e.g. modules like lvm or iscsi and by including 
host-only references to the swap device?

At least the man page should be changed because the explanation
of the host-only mode indicates that without this option a generic
initrd is created which is not true.

cu,
Frank


-- 
Dipl.-Inform. Frank Steiner   Web:  http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik    Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17           Phone: +49 89 2180-4049
80333 Muenchen, Germany       Fax:   +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-06 10:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-10 15:01 swap device reference causes problem with initramfs for diskless clients Frank Steiner
     [not found] ` <559FDE38.2080808-G0GEQqhI7DhYiKXMg8wJIg@public.gmane.org>
2015-07-15  8:05   ` Frank Steiner
     [not found]     ` <55A6142D.9090508-G0GEQqhI7DhYiKXMg8wJIg@public.gmane.org>
2015-08-06 10:46       ` Frank Steiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox