Viewing contents of initrd
James Wilkinson
fedora at westexe.demon.co.uk
Thu Jan 12 18:57:07 UTC 2006
Brian D. McGrew wrote:
> Is there anyway to look at what's been conglomerated into initrd???
Ian Pilcher wrote:
> It's a gzipped filesystem image, so your first step is to use gunzip to
> uncompress it. gunzip may balk at processing it, because the file name
> doesn't end in .gz, but you can work around this by using cat and piping
> the output to gunzip.
>
> Once you've done this, just loopback mount it (mount -o loop,ro ...).
> You'll have to be root to do this, of course.
It's gzipped all right
$ file initrd-2.6.15-1.1823_FC4.img
initrd-2.6.15-1.1823_FC4.img: gzip compressed data, from Unix, max compression
but if you gunzip (a copy of) it:
$ gunzip -S .img initrd-2.6.15-1.1823_FC4.img
(another way to force it to uncompress) and use file:
$ file initrd-2.6.15-1.1823_FC4
initrd-2.6.15-1.1823_FC4: ASCII cpio archive (SVR4 with no CRC)
It's a CPIO archive. I understand that it used to be a compressed
filesystem, but it was switched around the time 2.6 was introduced.
$ cpio -imdF initrd-2.6.15-1.1823_FC4
cpio: dev/systty: Operation not permitted
cpio: dev/console: Operation not permitted
cpio: dev/tty1: Operation not permitted
cpio: dev/tty3: Operation not permitted
cpio: dev/null: Operation not permitted
cpio: dev/ram: Operation not permitted
cpio: dev/tty4: Operation not permitted
cpio: dev/tty2: Operation not permitted
6435 blocks
(My /tmp is mounted nodev, so of course cpio can't create device nodes).
For more information, see
https://www.redhat.com/archives/fedora-devel-list/2005-February/msg01195.html
or https://wiki.ubuntu.com/Initramfs
Hope this helps,
James.
--
E-mail address: james | "Drums must never stop. Very bad if drums stop."
@westexe.demon.co.uk | "Why? What will happen if the drums ever stop?"
| "Bass solo."
More information about the fedora-list
mailing list