Convert .img File to SquashFS (Win/Mac/Linux)

39,072

3

17

Introduction: Convert .img File to SquashFS (Win/Mac/Linux)

About: Addicted to Code.

This is a how to in converting a .img file to a squashfs .img file.

Note: This may not necessarily work with every image file. Many that I have tried have not worked. These steps are done on a Windows PC, and Mac & Linux instructions should be similar, but particular steps may vary. This has worked or me in all cases, but may not alway work for you.

Step 1: Download Your .img File

In this case, I am using a RasPlex image.

This should be a .img file, and not anything else.

Step 2: Open the File

Open the .img file using a program like WinZip or 7-Zip.

I use 7-Zip, but both should work fine.

However, the default windows program will NOT work for opening these.

Step 3: Navigate to the 0.fat File

Easy as double-clicking on a folder in Windows.

Step 4: Find the File & Extract It

Look for a file named "System". Extract this file from the directory. You are clear to delete the .img file now.

Step 5: Rename the File

To finish it off, find the file you just extracted. It should be named "System". You can rename this to #YourFileName.img. Now the file is squashfs compatible! If a pop-up shows saying changing the file extension might corrupt this file, click yes. (windows only)

Be the First to Share

    Recommendations

    • Lamps and Lighting Contest

      Lamps and Lighting Contest
    • Robots Contest

      Robots Contest
    • Micro:bit Contest

      Micro:bit Contest

    17 Comments

    0
    bensil
    bensil

    Question 6 months ago

    I tried two different .img files, but didn't find the system file. Anyway, is it possible to create a version of Fenix OS that can be loaded on Berryboot? Also, I have an older version of Kali and was wondering if there is a newer one that can be loaded in a multi-boot environment. I think that's it. Tomorrow would be nice. Thanks.

    0
    PERCEN
    PERCEN

    1 year ago

    Hi. I'd like to do the reverse, SFS -> img.

    0
    Redtoneh
    Redtoneh

    Question 3 years ago on Step 4

    i had the 0.fat but no system file in it can you help i want berryboot

    0
    Modelmat
    Modelmat

    Answer 3 years ago

    If you could send me a link to the file I could take a look. Some pictures would be helpful too.

    Not all images will be compatible with this method, but I'll have a look what I can do.

    0
    LeVolatile
    LeVolatile

    3 years ago

    This is a very good tutorial but there is just one drawback: All the code is represented by graphic image! I personally think it's not a good idea because we have to retype everything! It generate a lot of time lost for impaired vision person like me. I prefer by far, just copy & paste. It reduce risk of errors and it's much faster. Otherwise, it's a clear and easy to understand.

    0
    Modelmat
    Modelmat

    Reply 3 years ago

    There's no code in this tutorial, so I'm not sure what you are talking about?

    0
    Modelmat
    Modelmat

    Reply 3 years ago

    None of this was designed for use in a terminal. I might consider making (& linking) another instructable for use to be done in the Linux terminal, however there are better options for doing this in terminal on linux

    0
    MaRR10
    MaRR10

    3 years ago

    Hi, What if I can't see the file "system"? Thanks

    0
    Modelmat
    Modelmat

    Reply 3 years ago

    What can you see? (Screenshot please). If possible, what file are you trying to use.

    0
    MaRR10
    MaRR10

    Reply 3 years ago

    hi, Thanks for your reply. I'm trying to convert musicbox for my
    raspberry pi Zero W. I searched for a ready- to- download image of this
    file for berryboot but nothing so I'm trying to convert it. Following
    your instructions, I can see everything like your screenshots but
    the file "system". Thanks.

    screenshotmusicbox.png
    0
    Modelmat
    Modelmat

    Reply 3 years ago

    So, this is not compatible with my method. However, follow http://www.howtogeek.com/141325/how-to-multi-boot-your-raspberry-pi-with-berryboot/ under "Adding Distributions to the BerryBoot System Manually" to do it on the raspberry pi (using Debian Jessie). Make sure to do "sudo apt-get install kpartx" as well. This will be slower usually, however it will allow you to convert it.

    0
    MaRR10
    MaRR10

    Reply 3 years ago

    hi, Thanks for your reply. I'm trying to convert musicbox for my raspberry pi Zero W. I searched for a ready- to- download image of this file for berryboot but nothing so I'm trying to convert it. Following your instructions, I can see everything like the your screenshots but the file "system". Thanks.

    screenshotmusicbox.png
    0
    GhostGuy72
    GhostGuy72

    4 years ago

    I just opened a raspian-jess-Pixel .img file with 7zip in windows and it looks nothing like what you posted, there is no 0eth folder

    I'm trying to add an OS to a berryBoot SDcard

    any assistance appreciated!

    Thanks!

    0
    Modelmat
    Modelmat

    Reply 4 years ago

    I believe they already post such images, see https://sourceforge.net/projects/berryboot/files/os_images/

    0
    FloydY2
    FloydY2

    4 years ago

    Useless garbage.

    0
    Modelmat
    Modelmat

    Reply 4 years ago

    What seems to be happening?

    0
    DIY Hacks and How Tos

    Welcome to Instructables. Thanks for sharing the great tutorial.