I'm trying to find an approach to dump a list of files
and directories accessed for the entire duration of a
particular UML image, so that I can trimmed out not
used files and directories. I don't care about files
created or modified or deleted. Just the "read"
access. How I approach this as best? Thanks.
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
From: Nicholas Mc Guire <der.herr@ho...> - 2006-12-26 09:33:19
-----BEGIN PGP SIGNED MESSAGE-----
> I'm trying to find an approach to dump a list of files
> and directories accessed for the entire duration of a
> particular UML image, so that I can trimmed out not
> used files and directories. I don't care about files
> created or modified or deleted. Just the "read"
> access. How I approach this as best? Thanks.
basically you could strace the UML process it self (strace , not strace
- -f) and then grep out the open and frinds.
rtl17: # strace ./linux 2> /tmp/uml.log
rtl17: # grep open /tmp/uml.log
This will only work if you are accessing files on the host filesystem or
you will only see open("root_fs", O_RDWR|O_SYNC|O_LARGEFILE) = 10 etc.
If the UML has exclusive access to the directory then you can simply run
UML and then do ls -lR --sort=time --time=access and all files with an
access time during the runtime of the UML process were accessed by UML
If you need it very precise you can use a preload library on the UML side
to log all access (including any temp files) - droped an example to:
if you run this on the init process then you get all files ever opened
during the life time of the UML (excluding the last steps of the shutdown
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
-----END PGP SIGNATURE-----