Mount the jffs2 root file system image on a Linux PC

Source: Internet
Author: User

When debugging a hardware board, we often need to make multiple jffs2 root file system images, and sometimes compare the available jffs2 root file system images from other channels.
However, jffs2's file system images can be mounted via loop devices unlike the image files on the CD. It is impossible to install them on the hardware board one by one.
Then I went to Google on the Internet and finally found a method after turning left and right. Because jffs2 is a file system built on MTD devices
It is mounted through the loop device, but can be mounted through the mtdram device. Mtdram is an MTD device implemented by Ram. You can use mtdblock
Devices. It is easy to use the mtdram device. You only need to load the mtdram and mtdblock kernel modules. These two kernel modules are generally Linux
All kernel distributions are compiled and loaded directly using The modprobe command.
The following describes how to mount the jffs2 root file system image with mtdram device in the Fedora Core 6 environment:
1. Load the mtdblock kernel module
[Root @ localhost ~] # Modprobe mtdblock
2. Load the mtdram kernel module, specify the device size as the size of the jffs2 root file system image, and specify the block erasure size (that is, the flash block size) as the jffs2 root file system.
The size specified by the "-e" parameter. The default value is 64 KB. The unit of the following two parameters is kb.
[Root @ localhost ~] # Modprobe mtdram total_size = 49152 erase_size = 128
3. The MTD device/dev/mtdblock0 is displayed. Run the DD command to copy the jffs2 root file system to the/dev/mtdblock0 device.
[Root @ localhost prebuilt_bin] # dd If = rootfs. jffs2_zylonite_qvga of =/dev/mtdblock0
98304 + 0 records in
98304 + 0 records out
50331648 bytes (50 MB) Copied, 1.98391 seconds, 25.4 MB/S
4. Mount the MTD device that saves the jffs2 root file system to the specified directory.
[Root @ localhost prebuilt_bin] # Mount-T jffs2/dev/mtdblock0/mnt/MTD

After that, you can view and modify the mounted jffs2 root file system in the/mnt/MTD directory. The modified jffs2 root file system can be copied as a jffs2 image file through the DD command.


This article is from the chinaunix blog, If you view the original text point: <a href = "url"> http://blog.chinaunix.net/u/4329/showart_1914238.html </a>



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.