我已经将
Linux(Fedora)服务器系统从IDE驱动器克隆到SATA驱动器,但是它无法启动,在交换机根目录时失败.我在目标驱动器上做了一个干净的安装,并通过检查initrd文件了解到在SATA驱动器上安装fedora时它包含了ahci模块,当我在安装工作期间没有SATA驱动器时没有使用系统.
所以我想运行mkinitrd来构建新的initrd,和旧的一样,但添加ahci模块(可能作为预加载)
我做了太多的猜测,所以我想在这里提出这个问题:
什么是从现有的initrd构建新initrd的最简单方法,只需添加一个模块?
这是两个init文件的差异
diff /media/disk/SATA_initrd/initrd/init /media/disk/PATA_initrd/initrd/init 50a51,52 > echo "Loading crc-t10dif module" > modprobe -q crc-t10dif 57,60d58 < echo "Loading ahci module" < modprobe -q ahci < echo Waiting for driver initialization. < stabilized --hash --interval 250 /proc/scsi/scsi 66a65,68 > echo "Loading pata_amd module" > modprobe -q pata_amd > echo Waiting for driver initialization. > stabilized --hash --interval 250 /proc/scsi/scsi
#!/bin/nash mount -t proc /proc /proc setquiet echo Mounting proc filesystem echo Mounting sysfs filesystem mount -t sysfs /sys /sys echo Creating /dev mount -o mode=0755 -t tmpfs /dev /dev mkdir /dev/pts mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts mkdir /dev/shm mkdir /dev/mapper echo Creating initial device nodes mknod /dev/null c 1 3 mknod /dev/zero c 1 5 mknod /dev/systty c 4 0 mknod /dev/tty c 5 0 mknod /dev/console c 5 1 mknod /dev/ptmx c 5 2 mknod /dev/tty0 c 4 0 mknod /dev/tty1 c 4 1 mknod /dev/tty2 c 4 2 mknod /dev/tty3 c 4 3 mknod /dev/tty4 c 4 4 mknod /dev/tty5 c 4 5 mknod /dev/tty6 c 4 6 mknod /dev/tty7 c 4 7 mknod /dev/tty8 c 4 8 mknod /dev/tty9 c 4 9 mknod /dev/tty10 c 4 10 mknod /dev/tty11 c 4 11 mknod /dev/tty12 c 4 12 mknod /dev/ttyS0 c 4 64 mknod /dev/ttyS1 c 4 65 mknod /dev/ttyS2 c 4 66 mknod /dev/ttyS3 c 4 67 echo Setting up hotplug. hotplug echo Creating block device nodes. mkblkdevs echo "Loading ehci-hcd module" modprobe -q ehci-hcd echo "Loading ohci-hcd module" modprobe -q ohci-hcd echo "Loading uhci-hcd module" modprobe -q uhci-hcd mount -t usbfs /proc/bus/usb /proc/bus/usb echo "Loading ext3 module" modprobe -q ext3 echo "Loading crc-t10dif module" modprobe -q crc-t10dif echo "Loading scsi_mod module" modprobe -q scsi_mod echo "Loading sd_mod module" modprobe -q sd_mod echo "Loading libata module" modprobe -q libata echo "Loading ata_generic module" modprobe -q ata_generic echo "Loading pata_acpi module" modprobe -q pata_acpi echo Waiting for driver initialization. stabilized --hash --interval 250 /proc/scsi/scsi echo "Loading pata_amd module" modprobe -q pata_amd echo Waiting for driver initialization. stabilized --hash --interval 250 /proc/scsi/scsi echo "Loading dm-mod module" modprobe -q dm-mod echo "Loading dm-mirror module" modprobe -q dm-mirror echo "Loading dm-zero module" modprobe -q dm-zero echo "Loading dm-snapshot module" modprobe -q dm-snapshot echo Making device-mapper control node mkdmnod modprobe scsi_wait_scan rmmod scsi_wait_scan mkblkdevs echo Scanning logical volumes lvm vgscan --ignorelockingfailure echo Activating logical volumes lvm vgchange -ay --ignorelockingfailure VolGroup00 resume /dev/VolGroup00/LogVol01 echo Creating root device. mkrootdev -t ext3 -o defaults,ro /dev/VolGroup00/LogVol00 echo Mounting root filesystem. mount /sysroot echo Setting up other filesystems. setuproot loadpolicy echo Switching to new root and running init. switchroot echo Booting has Failed. sleep -1
解决方法
您无需担心所有已安装的模块.首先,启动进入救援盘.
chroot /mnt/sysimage # this is for Fedora specifically - YMMV cp /boot/initrd-2.26.27.24-78.2.53-fc9.x86_64.img \ /boot/initrd-2.26.27.24-78.2.53-fc9.x86_64.old mkinitrd --preload ahci -f /boot/initrd-2.26.27.24-78.2.53-fc9.x86_64.img \ 2.26.27.24-78.2.53-fc9.x86_64 exit and reboot the system.
华而不实的
在“驱动程序初始化”之前,您不必担心所有的modprobes
ignore --> use the --preload *MODNAME* in the arguments to mkinitrd ignore --> for all the rest use --with
只需添加–preload ahci
有用的网址:
> http://www.mail-archive.com/fedora-package-announce@redhat.com/msg21104.html
> http://www.justlinux.com/forum/showthread.php?p=886204