dracutdevs / dracut

dracut the event driven initramfs infrastructure
https://github.com/dracutdevs/dracut/wiki
GNU General Public License v2.0
602 stars 400 forks source link

when install dracut on ubuntu 16.04 LTS, Default kernel command line ip parameter value is wrong like ip=enp6s0f0:static and it can not be overwritten. #428

Closed gokhan27 closed 4 years ago

gokhan27 commented 6 years ago

I installed dracut with apt # apt install dracut dracut-network then ı created initramfs image with #dracut -fv --logfile dracut.log but I see that ip parameter gets wrong value like ip=enp6s0f0:static. when I look at dracut.cmdline man, it can not get static value. when I reboot my server, dracut refuse and system halted. How can I overwrite dracut kernel command line parameters ?

logs are below: I: Executing: /usr/bin/dracut -fv --logfile dracut.log I: dracut module 'bootchart' will not be installed, because command '/sbin/bootchartd' could not be found! I: dracut module 'plymouth' will not be installed, because command 'plymouth-set-default-theme' could not be found! I: dracut module 'dmraid' will not be installed, because command 'dmraid' could not be found! I: dracut module 'multipath' will not be installed, because command 'multipath' could not be found! I: dracut module 'cifs' will not be installed, because command 'mount.cifs' could not be found! I: dracut module 'biosdevname' will not be installed, because command 'biosdevname' could not be found! I: dracut module 'dmraid' will not be installed, because command 'dmraid' could not be found! I: dracut module 'multipath' will not be installed, because command 'multipath' could not be found! I: dracut module 'cifs' will not be installed, because command 'mount.cifs' could not be found! I: Including module: bash I: Including module: dash I: Including module: systemd I: Including module: systemd-initrd I: Including module: caps W: caps: does not work with systemd in the initramfs I: Including module: console-setup I: Including module: network I: Including module: ifcfg I: Including module: aufs I: Including module: kernel-modules I: Including module: kernel-network-modules I: Including module: iscsi I: Including module: resume I: Including module: rootfs-block I: Including module: terminfo I: Including module: udev-rules I: Skipping udev rule: 40-redhat.rules I: Skipping udev rule: 91-permissions.rules I: Skipping udev rule: 80-drivers-modprobe.rules I: Including module: dracut-systemd I: Including module: usrmount I: Including module: base I: Including module: fs-lib I: Including module: shutdown I: Including modules done I: Installing kernel module dependencies and firmware I: Installing kernel module dependencies and firmware done I: Resolving executable dependencies I: Resolving executable dependencies done I: Stripping files I: Stripping files done I: Store current command line parameters I: Stored kernel commandline: I: ip=enp6s0f0:static ifname=enp6s0f0:50:6b:4b:2f:2d:bc rd.iscsi.initiator=iqn.1993-08.org.debian:01:161 netroot=iscsi:10.1.20.11::::iqn.1992-08.com.netapp:sn.b3lab I: resume=UUID=e9c01031-f4b6-411a-944d-bc6dc214819b I: root=UUID=e096439f-c8a0-4aa9-ad47-7f2b32a1356f rootfstype=ext4 rootflags=rw,relatime,errors=remount-ro,stripe=16,data=ordered I: Creating image file '/boot/initramfs-4.13.0-45-generic.img' I: Creating initramfs image file '/boot/initramfs-4.13.0-45-generic.img' done

haraldh commented 6 years ago

Use

hostonly_cmdline="no"

in e.g. /etc/dracut.conf.d/my.conf and set your kernel command line parameter as you wish. For Fedora this is the default, btw. or call dracut with the --no-hostonly-cmdline option.

gokhan27 commented 6 years ago

hi thanks, it is working :) But I have a problem. I want to delete vlan interface after network manager is up. Can I also ask a question about creating bonded vlan interface? My network interfaces file is below : ###################################################################################

This file describes the network interfaces available on your system

and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

auto lo iface lo inet loopback

auto enp6s0f0 iface enp6s0f0 inet manual bond-master bond0 mtu 9000

auto enp7s0f0 iface enp7s0f0 inet manual bond-master bond0 mtu 9000

auto bond0 iface bond0 inet manual mtu 9000 bond-mode 2 bond-miimon 100 bond-slaves none bond-downdelay 200 bond-updelay 200

auto bond0.20 iface bond0.20 inet manual vlan-raw-device bond0

auto br-iscsi iface br-iscsi inet static bridge_stp off bridge_waitport 0 bridge_fd 0 mtu 9000 bridge_ports bond0.20 address 10.1.20.161 netmask 255.255.255.0 gateway 10.1.20.1 dns-nameservers 10.1.31.3 ###################################################################################

How can I make above configuration with dracut ?

haraldh commented 6 years ago

https://mirrors.edge.kernel.org/pub/linux/utils/boot/dracut/dracut.html#_network

so something like:

bond=bond0:enp7s0f0,enp6s0f0:mode=2,miimon=100,downdelay=200,updelay=200:9000 vlan=bond0.20:bond0 bridge=br-iscsi:bond0.20 ip=10.1.20.161::10.1.20.161:255.255.255.0::br-iscsi:none:9000 nameserver=10.1.31.3 rd.iscsi.initiator=iqn.1993-08.org.debian:01:161 netroot=iscsi:10.1.20.11::::iqn.1992-08.com.netapp:sn.b3lab resume=UUID=e9c01031-f4b6-411a-944d-bc6dc214819b root=UUID=e096439f-c8a0-4aa9-ad47-7f2b32a1356f rootfstype=ext4

Hope that works.

gokhan27 commented 6 years ago

I tried it and it didn't work. it entered dracut emergency mode and unfortunately I can not type anything with keyboard. do I need also add bootdev=br-iscsi ?

haraldh commented 6 years ago

no keyboard attached?

gokhan27 commented 6 years ago

no, keyboard is attached and I also tried with virtual keyboard , but it didn't type any characters. it is like frozen

haraldh commented 6 years ago

is that a real machine? or a VM?

gokhan27 commented 6 years ago

it is real machine Lenovo thinksystem SD530 server. I am connected to system on xclarity controller

haraldh commented 6 years ago

Hmm, without the rdsosreport.txt file and/or more debugging, I am helpless. Double check the settings. Maybe start with a more simple network setup, then advance to bridge and bonding.

gokhan27 commented 6 years ago

on ubuntu manpage[1] bonding option is like bond=[::[:]]. it does not consist of mtu option. I will try it without mtu. http://manpages.ubuntu.com/manpages/xenial/man7/dracut.cmdline.7.html

gokhan27 commented 6 years ago

@haraldh I tried with bond=bond0:enp6s0f0,enp7s0f0:mode=balance-xor vlan=bond0.30:bond0 bridge=bridge0:bond0.30 but it enters dracut shell. I see all interfaces are up except bridge interface. when I try manually add bridge on dracut shell, it says package not installed. do we need any drivers or modules for bridge-utils packet ?

haraldh commented 6 years ago

dracut uses ip instead of brctl.

-                brctl addbr $bridgename
-                brctl setfd $bridgename 0
+                ip link add name $bridgename type bridge
+                echo 0 > /sys/devices/virtual/net/$bridgename/bridge/forward_delay
[…]
-            brctl addif $bridgename $ethname
+            ip link set dev $ethname master $bridgename
haraldh commented 6 years ago

if you have console, may I ask you to boot with: rd.debug on the kernel command line and try to save and give me /run/initramfs/rdsosreport.txt

gokhan27 commented 6 years ago

@haraldh I solved this problem adding "add_drivers+=" 8021q bonding bridge" to /etc/dracut.conf.d/10-debian.conf. then I run 'dracut --kernel-cmdline "bond=bond0:enp6s0f0,enp7s0f0:mode=balance-xor vlan=bond0.20:bond0 bridge=bridge1:bond0.20 ip=10.1.20.161::10.1.20.1:255.255.255.0::bridge1:off:9000 nameserver=10.1.34.5 rd.debug rd.shell rd.iscsi.initiator=iqn.1993-08.org.debian:01:161 netroot=iscsi:10.1.20.11::::iqn.1992-08.com.netapp:sn.b3lab resume=UUID=e9c01031-f4b6-411a-944d-bc6dc214819b root=UUID=8fec65b4-79e2-41c6-8aa5-8f946c210a90 rootfstype=ext4 rootflags=rw,relatime,errors=remount-ro,stripe=16,data=ordered" -fv /boot/initrd.img-4.15.0-29-generic' it is worked but now I have an other problem. If I run "systemctl restart networking", I have lost my connection. do I need also add these network definitions in /etc/network/interfaces file ?

haraldh commented 6 years ago
If I run "systemctl restart networking", I have lost my connection. do I need also add these network definitions in /etc/network/interfaces file ?

yes, you do

haraldh commented 6 years ago

Hmm, " 8021q bonding bridge " should be in the 90kernel-network-modules dracut module

haraldh commented 6 years ago

ah, maybe you were in hostonly mode and these modules were not loaded?

gokhan27 commented 6 years ago

yes I see hostonly=yes in /etc/dracut.conf.d/10-debian.conf. But I didn't add it. this is default.

johannbg commented 4 years ago

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.