Linux uses cpio to decompress initrd. img

Source: Internet
Author: User

In kernel 2.6, initrd. IMG adopts cpio compression. It is no longer in the ext2 format used by kernel 2.4 and cannot be mounted using Mount-o loop. You need to use gunzip to decompress the package, and then use cpio to decompress the package.
CP/boot/initrd-***. IMG initrd.img.gz
Gunzip initrd.img.gz
Mkdir initrd
MV initrd. IMG initrd
CD initrd
Cpio-ivmd ../initrd. New. img
Gzip ../initrd. New. img
Copy the name to the/boot directory, and then restart it to observe the modified effect. Boot fails after restart. This is because the generated initrd. IMG is incorrect. The solution is as follows:
Generate initrd
Find. | cpio-o-h NEWC| Gzip>/mnt/sda1/boot/initrd. img-2.6.18-4-686
(Note:-h newc is required. Otherwise, the kernel will consider it as ramdisk rather than initramfs.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.