Skip to Content
문서참조명령 참조initramfs (Dracut)

initramfs (Dracut) 명령 참조

Ubuntu 26.04부터 initramfs 빌드 도구가 initramfs-tools에서 Dracut로 변경되었습니다. 그에 따라 일상적인 명령이 변경됩니다. 이전 update-initramfs 및 lsinitramfs는 dracut 및 lsinitrd로 대체되고 구성 디렉터리는 /etc/dracut.conf.d/가 됩니다.

Note

26.04으로 업그레이드된 시스템은 여전히 ​​initramfs-tools을 유지할 수 있으며, 이 경우 이전 명령이 계속 작동합니다. 새로 설치하면 기본적으로 Dracut를 사용합니다. which dracut / dracut --version로 확인하세요.

명령 매핑

이전(initramfs-tools)신규(Dracut)설명
sudo update-initramfs -usudo dracut -f현재 커널에 대해 initramfs을 다시 빌드합니다(-f이 기존 파일을 덮어씁니다).
sudo update-initramfs -u -k allsudo dracut -f --regenerate-all설치된 모든 커널에 대해 다시 빌드
sudo update-initramfs -u -k $(uname -r)sudo dracut -f --kver $(uname -r)특정 커널 버전용으로 빌드
lsinitramfs /boot/initrd.img-$(uname -r)lsinitrdinitramfs에 포함된 파일 목록
lsinitramfs … | grep xxxlsinitrd | grep xxx모듈/파일이 패킹되어 있는지 확인
/etc/initramfs-tools//etc/dracut.conf.d/구성 디렉터리
/etc/initramfs-tools/modulesforce_drivers+=" MODULE "(conf.d에서)커널 모듈 강제 포함

일반적인 작업

# Rebuild the initramfs for the current kernel sudo dracut -f # Rebuild for all installed kernels (common after changing drivers, encryption, resume, etc.) sudo dracut -f --regenerate-all # Build for a specific kernel version to a specific path sudo dracut -f /boot/initrd.img-7.0.0-10-generic 7.0.0-10-generic

initramfs 검사

# View the contents of the current kernel's initramfs (defaults to the current kernel) lsinitrd # Inspect a specific file lsinitrd /boot/initrd.img-$(uname -r) # Confirm whether a kernel module is packed in (e.g. resume, encryption, NIC driver) lsinitrd | grep -i resume lsinitrd | grep -i nvme

Dracut 구성

Dracut 구성은 *.conf 아래의 /etc/dracut.conf.d/ 파일에 있습니다. 변경 사항은 initramfs을 다시 빌드한 후에만 적용됩니다.

# Example: force-pack certain drivers into the initramfs echo 'force_drivers+=" nvme nvme_core "' | sudo tee /etc/dracut.conf.d/90-nvme.conf sudo dracut -f --regenerate-all

일반적인 구성 옵션:

# /etc/dracut.conf.d/zz-local.conf # Pack only modules needed by this host (smaller, the default behavior) hostonly="yes" # Force-include specific kernel drivers force_drivers+=" MODULE " # Add specific dracut modules (such as crypt, lvm, network) add_dracutmodules+=" crypt lvm " # Include extra executables in the initramfs install_items+=" /usr/bin/vi "
Tip

재개(최대 절전 모드), 디스크 암호화 또는 루트 파일 시스템을 보유하는 컨트롤러의 드라이버를 변경한 후 sudo dracut -f --regenerate-all을 실행해야 합니다. 그렇지 않으면 시스템이 부팅되지 않을 수 있습니다.

관련 기사

Last updated on