Find the answer to your Linux question:
Results 1 to 9 of 9
I have a squashFS image of xubuntu. I would like to install it in virtualbox.. How can i accomplish this? Sent from my ST21i using Tapatalk...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2013
    Posts
    40

    SQUASHFS help


    I have a squashFS image of xubuntu. I would like to install it in virtualbox.. How can i accomplish this?

    Sent from my ST21i using Tapatalk

  2. #2
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    640
    This description does not say what your goal is correctly. Are you just attempting to get the squashfs file into your virtual machine to be used? Are you desire using the squashfs data to be install data on for the virtual machine? Are you attempting to the the squashfs file as the hard disk image on a virtual machine?

    Can you explain better?

  3. #3
    Just Joined!
    Join Date
    Dec 2013
    Posts
    40
    I will explain it as much as I can... I got a DVD from a magazine which has four flavours of UBUNTU 13.04 : Kubuntu, Ubuntu, Xubuntu, Ubuntu server. On booting from the disc, I can install Xubuntu using a customised menu in the DVD.. But, on exploring the DVD directory, I found a new file with a size that should be equal to the iso image.

    I wanted to learn about this file type.. The file was a squashFS file. On searching, I found that I have to use some command to mount it and I tried it.. But, I didn't have any success.

    What I actually want help with is : Help me boot up from this squashFS image. I would like to use the image directly. I don't want to use their customised menu.

    If that is not possible, how can I copy the contents of the file? I think it would work fine if I copied the squashFS file completely to a pen drive and boot from it...

    I think I have made my intentions clear. Thank you for your help..

    Sent from my ST21i using Tapatalk

  4. #4
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    640
    A squashfs file can be mounted when the kernel has support for that filesystem type (internally or as a loaded module) and loop-back devices have to also exist.

    The "loop-back" devices allow the mounting of a file that really contains a filesystem. The "squashfs file" is a file that contains a filesystem. To mount the filesystem that contains a squashfs filesystem the command would be:

    [code]
    mount -t squashfs -o loop,ro the_squashfs_file the_mount_that_you_selected

    for example:

    mount -t squashfs -o loop,ro some_path/myfile.squashfs /mnt/floppy
    [code]
    Once mounted, you can "cd" into the mount location and see the directories and file within the filesystem. As you thought you can copy the contents from the mounted location to some other location (the same as having mounted a drive partition at that location).

    On some distros that designed to have a smaller footprint, includes the '/' as a squashfs that gets mounted. Also in these cases they usually also use either "unionfs" or "aufs" to overlay a writable layer overlayed on the readonly layer.

    Your DVD from the magazine, probably contains an ISO image (files that end in '.iso") for the other three images. You would burn the ISO image to a DVD/CDROM (depending on the size) and install that distro using your newly created DVD/CDROM disc.

  5. #5
    Just Joined!
    Join Date
    Dec 2013
    Posts
    40
    Quote Originally Posted by alf55 View Post
    A squashfs file can be mounted when the kernel has support for that filesystem type (internally or as a loaded module) and loop-back devices have to also exist.

    The "loop-back" devices allow the mounting of a file that really contains a filesystem. The "squashfs file" is a file that contains a filesystem. To mount the filesystem that contains a squashfs filesystem the command would be:

    [code]
    mount -t squashfs -o loop,ro the_squashfs_file the_mount_that_you_selected

    for example:

    mount -t squashfs -o loop,ro some_path/myfile.squashfs /mnt/floppy
    [code]
    Once mounted, you can "cd" into the mount location and see the directories and file within the filesystem. As you thought you can copy the contents from the mounted location to some other location (the same as having mounted a drive partition at that location).

    On some distros that designed to have a smaller footprint, includes the '/' as a squashfs that gets mounted. Also in these cases they usually also use either "unionfs" or "aufs" to overlay a writable layer overlayed on the readonly layer.

    Your DVD from the magazine, probably contains an ISO image (files that end in '.iso") for the other three images. You would burn the ISO image to a DVD/CDROM (depending on the size) and install that distro using your newly created DVD/CDROM disc.
    I tried the commands that you have says and they with perfectly.. I can mount the file..

    Still, I cannot copy files from the mounted filesystem... There is an error starting that they are ready only... I followed both the terminal and graphical method... With sudo command...

    On searching the Internet, I found that I cannot use chmod to change permissions.. I tried mounting as rw, but it was not so..

    Sent from my ST21i using Tapatalk

  6. #6
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    640
    The squashfs mounted area is readonly because the squashfs is "readonly". This means that:
    • change permissions with in the mounted squashfs
    • move file from the mounted squashfs
    • rename files within the mounted squashfs
    • delete files within the mounted squashfs

    But you should be able to copy files (note can not copy the "dev" diretory tree. If you are copiing all files and it incudes the "dev" directory, you should look at the "cpio" command using a pipe and the "cpio" to restore the files.

  7. #7
    Just Joined!
    Join Date
    Dec 2013
    Posts
    40
    I got permission denied with cpio... Tried dd command.. The original squashFS is around 800MB. But, the dd continues copying till 3GB... I terminated the process after that.. Any idea?

    Sent from my ST21i using Tapatalk

  8. #8
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    640
    When a directory tree is turned into a squashfs file, the process does de-duplication and compression. It shows it to you when mounted as it was when the the original directory tree. The copy will not be compressed. That is a property of squashfs.

    Maybe you should read the man page for "mksquashfs" which is used to create a squashfs file from a directory tree.

  9. #9
    Just Joined!
    Join Date
    Dec 2013
    Posts
    40
    Will try this out and update what I see...

    Sent from my ST21i using Tapatalk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •