by Rich Simms on Wed Sep 24, 2008 8:36 am
Rabbit,
That is a really good point. You can use /dev/sdb1 just to get things up and working quickly on the Lab or Class systems. However "hardcoding" an absolute drive number and partition number on the pen drive will cause it to fail on other systems (like one with 2 SCSI hard drives). The LABEL= option makes it more robust (as long as you named and specify your file system volume name, i.e. label, correctly).
Fred,
After editing fstab to remove the swap entry and correcting all references to pen drive partitions you can make your initial ram disk (with mkinitrd) and go to next step.
All,
This is cool ... if you want to view at the contents of your ramdisk you should check out slide 87 of Lesson 3 or look at this example:
[code][root@duke mnt]# mkinitrd --fstab=/mnt/etc/fstab --with-usb /mnt/boot/initrd.img $(uname -r)
[root@duke mnt]# cd /tmp
[root@duke tmp]# mkdir initrd
[root@duke tmp]# cd initrd
[root@duke initrd]# cat /mnt/boot/initrd.img | gzip -d | cpio -i
14435 blocks
[root@duke initrd]#[root@duke initrd]# ls -R
.:
bin dev etc init initrd.img lib proc sbin sys sysroot usr
./bin:
insmod modprobe nash rmmod
./dev:
console ptmx ram1 tty tty10 tty2 tty5 tty8 ttyS1 zero
mapper ram rtc tty0 tty11 tty3 tty6 tty9 ttyS2
null ram0 systty tty1 tty12 tty4 tty7 ttyS0 ttyS3
./dev/mapper:
./etc:
ld.so.cache ld.so.conf ld.so.conf.d
./etc/ld.so.conf.d:
./lib:
ata_piix.ko libdl-2.7.so libz.so.1
ehci-hcd.ko libdl.so.2 libz.so.1.2.3
ext3.ko libgcc_s-4.1.2-20070925.so.1 mbcache.ko
firmware libgcc_s.so.1 mptbase.ko
i686 libglib-2.0.so.0 mptscsih.ko
jbd.ko libglib-2.0.so.0.1400.2 mptspi.ko
ld-2.7.so libm.so.6 ohci-hcd.ko
ld-linux.so.2 libpopt.so.0 scsi_mod.ko
libata.ko libpopt.so.0.0.0 scsi_transport_spi.ko
libblkid.so.1 libresolv-2.7.so scsi_wait_scan.ko
libblkid.so.1.0 libresolv.so.2 sd_mod.ko
libcrypto.so.0.9.8b libselinux.so.1 uhci-hcd.ko
libcrypto.so.6 libsepol.so.1 usb-storage.ko
libc.so.6 libuuid.so.1
libdevmapper.so.1.02 libuuid.so.1.2
./lib/firmware:
./lib/i686:
nosegneg
./lib/i686/nosegneg:
libc-2.7.so libm-2.7.so
./proc:
./sys:
./sysroot:
./usr:
lib
./usr/lib:
libbdevid.so.6.0.19 libdhcp.so.1 libnl.so.1.0-pre5
libdhcp4client-3.0.6.so.0 libnash.so.6.0.19 libparted-1.8.so.6
libdhcp6client-0.10.so.0 libnl.so.1 libparted-1.8.so.6.0.0
[root@duke initrd]#[/code]
As you can see, the ramdisk is providing the kernel with a small root file system to use during the startup process. All this is happening before the root file system we created on the pen drive is even mounted!
- Rich