Environment
- Red Hat Enterprise Linux 6
Issue
- How to get list of all the files which are touched by Red Hat Enterprise Linux during boot process?
Resolution
- To get such a list,
stap script is required.
- There is an attachment with this Solution which is a zip file containing two programs,
bootinit.sh and bootprobe2.1.stp file in stapscripts.zip file. Extract them and use as following. Make sure one has installed kernel-devel and kernel-debuginfo package of the currently booted kernel, otherwise it won't work at all.
- Follow section 2.1. in the SystemTap Beginners Guide for the
systemtap and kernel-debug installation - Run the test at 2.1.3 to verify the install.
1. Create /tmp/stap and /tmp/stap/data
# mkdir -p /tmp/stap/data
2. Place bootprobe2.1.stp and bootinit.sh into /tmp/stap and make bootinit.sh executable.
# chmod +x /tmp/stap/boot*
3. Edit bootinit.sh and change exec /sbin/init 3 to exec /sbin/init 5 if 5 is the default runlevel.
4. Create the .ko module from bootprobe2.stp
# cd /tmp/stap
# stap bootprobe2.1.stp -m bootprobe2 -p4
5. Reboot.
6. Halt grub and press a on the default kernel. At the end of the kernel line enter the following and press enter:
init=/tmp/stap/bootinit.sh
7. Normal boot will resume. After logging in, kill the stapio process, copy bootprobe2.log out of the tmpfs /tmp/stap/data directory and unmount it.
# killall stapio
# cp /tmp/stap/data/bootprobe2.log /tmp/stap/
# umount /tmp/stap/data
8. Now check the file /tmp/stap/bootprobe2.log file for the list of all files which are read/wrote/touched during boot.
Comments
Post a Comment