Monday, July 15, 2013

Fedora dracut in chroot environment

The following is the procedure to create new initframfs when the root filesystem has structural changes such as between LVM, MD or plain. 
  • Chroot to the desired folder (.e.g. /mnt/temp)
    chroot /mnt/temp
  • mount the system partitions /proc, /run, /dev, /sys
    mount -t proc proc /proc
    mount -t tmpfs tmpfs /run
    mount -t devtmpfs devtmpfs /dev
    mount -t sysfs sysfs /sys
  • mount the /boot and / partition
    mount -t ext4 /dev/sdb1 /boot
    mount -t ext4 /dev/md0 /
  • Create the udev/data folder to emulate the udev database
    cd /run
    mkdir udev/data
  • To include mdadm in Fedora dracut: add module mdraid found in /usr/lib/dracut/modules.d/
    dracut -v -f -a mdraid --mdadmconf /boot/initramfs-$(uname -r).img $(uname -r)

2 comments:

nd said...

thanks it saved my life..
btw chroot must be run after mounting partitions

magyarbacher said...

Golden Nugget Casino (Las Vegas) - MapYRO
Golden Nugget Casino. Golden Nugget 하남 출장마사지 Casino Las 논산 출장마사지 Vegas. The Las Vegas' premier casino 대구광역 출장안마 offers progressive jackpots and No. of Rooms: 2000Total 안양 출장샵 Gaming Space: 24,000 sq ft (17,500 m2)Opening Hours: Mon-Sun; Fri-Sat; Mon-Sun 계룡 출장샵 Rating: 4.3 · ‎7,630 votes