|
|
|
| Kernel Options Needed to Build/Read initrd.gz files |
|
| RamDisk and Loop Howto Examples |
|
| RamDisk + initrd |
- Use a variable size /dev/loop device when /dev/ram is too small
- First create an empty 8MB ramdisk in memory
dd if=/dev/zero of=/dev/ram0 bs=1k count=8192
count=1024 --> 1MB device
count=4096 --> 4MB device
count=8192 --> 8MB device
count=16384 --> 16MB device
- Format it as usual ( ext2, ext3, reiserfs, vfat etc )
mke2fs -b 1024 -m 1 /dev/ram0
- Mount the ramdisk
insmod rd ( modprobe rd )
mount -t ext2 /dev/ram0 /mnt/ram
- Add/modify the contents as needed
rm -f /mnt/ram/lost+found
ls -la /mnt/ram
[ create/edit/delete the files ]
- umount the loopback device and create initrd.gz
umount /mnt/ram
gzip -c -9 /dev/ram0 > /boot/initrd.gz
- Free up the memory
|
|
|
|