I believe the issue is the combination of LILO and a USB device. I think LILO expects the device identity to be constant. USB devices can wander all over the place, especially with different computers.
I recommend using GRUB instead, and making sure it uses the "search" command to locate the disks, by UUID (or label). Also, make sure every filesystem is unique (i.e. don't clone disks) so the UUIDs are distinct.
As for the initrd... It sounds like the system you copied from used some RAID devices. This would use "mdadm" (which I believe you miscopied as "madam"). In general, the initrd should be generated in the context of the system it will boot. Thus, you install everything on the USB, mount it, mount (or bind mount) /proc, /dev, /sys, etc in that mount, and chroot
to the mounted USB. Then and there, you should build the initrd. (Alternatively, if you can boot it, you can just do do and build a new initrd.)
If you really want the same initrd on both the USB and normal disk, you may need to have the same subset of packages installed that put things in /usr/share/initramfs-tools/
. (Filenames therein are typically package names, which helps identify them.) I wouldn't recommend bothering.
You may also need to check the boot command line, to ensure it doesn't reference the RAID devices.
If you can boot the USB, and just want to rebuild the initrd,
and assuming you are using initramfs-tools, this would be either:
# update-initramfs -u
or if that does nothing (because you don't already have an initrd):
# update-initramfs -c -k <your-installed-kernel-version>
To rebuild the USB initrd from the host,
assuming your USB device is /dev/sdc
, that its boot partition is /dev/sdc2
, and its root partition is /dev/sdc3
.
And assuming you have an empty directory /mnt/usb
.
And assuming that you are already running as root
.
# mount /dev/sdc3 /mnt/usb
# mount /dev/sdc2 /mnt/usb/root
# mount -tproc proc /mnt/usb/proc
# mount -tsysfs sysfs /mnt/usb/sys
# mount -obind /dev /mnt/usb/dev
# mount -ttmpfs tmp /mnt/usb/tmp
# mount -ttmpfs tmp /mnt/usb/run
# mount -ttmpfs tmp /mnt/usb/dev/shm
# chroot /mnt/usb
At this point, you are logically in the USB device (except that all the system services are running in the host, and some of the size restrictions are wrong.
Now to update the initrd, as described above.
Unless you want to run to stay in the USB filesystem, you should probably exit
or control-D to leave the chroot.
Then unmount everything with:
# umount /mnt/usb/dev/shm /mnt/usb/run /mnt/usb/tmp /mnt/usb/dev /mnt/usb/sys /mnt/usb/proc /mnt/usb/root /mnt/usb
Normally, you never need to run update-initramfs manually, as installation
scripts do it automatically. This might fail if you install a kernel
from source, or do things like building a new root, such as on a USB.