bootable LFS CD with the whole root on ramdisk

Leonard Soetedjo Leonard at axs.com.sg
Thu Nov 28 21:16:06 PST 2002


Hi list,

I've read the boot-cd_easy hints (and I believe it's an excellent doc).

However, after creating the cd, I found out that those files that are not in 
the ramdisk are slow to access.  I believe this is due to the cd being 
spinned down because of no usage after some time.

So, what I did is try to put the whole root filesystem on the ramdisk.  I 
changed the /linuxrc script to untar a file (which consist of the whole root 
filesystem) to the ramdisk.  Here's a snippet:

--------------------------------------------------------------------------------------------------------------
  echo "Booting from $LFS_CDROM_DEVICE ...                  "
  echo "Preparing ramdisk..."
  mke2fs -i 1024 -m 0 /dev/ram1
  mount -n /dev/ram1 /ram
  mount -n -o ro -t iso9660 $LFS_CDROM_DEVICE $TMP_MOUNT
  cd /ram
  tar zxvf LFS.tar.gz -C .
  umount $TMP_MOUNT
  pivot_root . /mnt
  umount -n /mnt/proc >/dev/null 2>&1
  exec chroot . sh -c 'umount -n /mnt >/dev/null 2>&1;\
  exec -a init.new /sbin/init 3'\
  <dev/console >dev/console 2>&1
--------------------------------------------------------------------------------------------------------------

The boot option I entered is:

--------------------------------------------------------------------------------------------------------------
/boot/isolinux/vmlinuz ramdisk_size=200000 root=/dev/ram1 initrd=initrd.gz 
init=/linuxrc
--------------------------------------------------------------------------------------------------------------

The error that I got is:

--------------------------------------------------------------------------------------------------------------
pivot_root: Device or resource busy
sh: /sbin/init: No such file or directory
sh: exec: /sbin/init: cannot execute: No such file or directory
Kernel panic: Attempted to kill init!
--------------------------------------------------------------------------------------------------------------
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-support' in the subject header of the message



More information about the blfs-support mailing list