Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
1
answers
2441
views
unetbootin: cannot mount squashfs on loop device
Im having a bit of fun with unetbootin with linux mint 16 setup in it. However when I try run the default menu item I get an error that ends with this: can not mount /dev/loop0 (/cdrom/casper/filesystem.squashfs) on //filesystem.squashfs) any ideas?
Im having a bit of fun with unetbootin with linux mint 16 setup in it.
However when I try run the default menu item I get an error that ends with this:
can not mount /dev/loop0 (/cdrom/casper/filesystem.squashfs) on //filesystem.squashfs)
any ideas?
FutuToad
(873 rep)
Mar 13, 2014, 04:51 PM
• Last activity: Jul 23, 2025, 04:06 AM
2
votes
1
answers
3659
views
GRUB install on Debian 11 live image failed to get canonical path of 'overlay'
We're building a Debian based product. To simplify building these in the factory, I'm trying to build a live disk that will install the main OS. We have an older product that uses this processbut was based on Debian 7. I'm using Debian 11. I've based my Debian 11 recovery process and image on the De...
We're building a Debian based product. To simplify building these in the factory, I'm trying to build a live disk that will install the main OS. We have an older product that uses this processbut was based on Debian 7. I'm using Debian 11. I've based my Debian 11 recovery process and image on the Debian 7 one. Both use
live-build
. The Debian 11 system pulls the OS from mainline bullseye
repos plus my repo for the one package that carries our bits. It's a multistep process where we run live-build
to build the operational system's OS, squash it into a squashfs, then build a live OS around it with a script that does things like partition the driven, unsquash the squashfs file to the appropriate partition, and, most critically not working, apply GRUB.
Part of the build does:
install -d /boot/seed
grub-mkimage -Ox86_64-efi -o /boot/seed/BOOTX64.EFI -p '(hd0,1)/EFI/BOOT/grub' \
part_gpt part_msdos fat
grub-mkimage -Oi386-pc -o /boot/seed/mbr-core.img -p '(hd0,msdos1)/biosgrub' \
part_msdos fat biosdisk
grub-mkimage -Oi386-pc -o /boot/seed/gpt-core.img -p '(hd0,gpt1)/biosgrub' \
part_gpt fat biosdisk
cp -a /usr/lib/grub/i386-pc/boot.img /boot/seed/boot.img
cp -a /usr/lib/grub/i386-pc/modinfo.sh /boot/seed/modinfo.sh
grub-editenv /boot/seed/grubenv create
These files end up in the live OS and get copied to the ESP partition prior to attempting to install GRUB. Those files and all the various GRUB modules are copied midway through the install script.
Later on in the script, we call grub-install
.
grub-install \
--directory /mnt/biosgrub \
--boot-image boot.img \
--core-image core_img \
/dev/sda
The problem here is that the newer versions of grub-install
no longer support core-image
and boot-image
switches like the version from Debian 7 did so that fails immediately. I took out the boot-image
and core-image
switches and now it fails with:
grub-install: error: failed to get canonical path of `overlay'.
And yes, there really is an opening backtick with a closing single quote on overlay
.
I've tried removing the GRUB step, letting it unsquash everything, then booting to a graphical live disk running Manjaro (had it laying about) to try to get more info on the GRUB situation. Running grub-install
there fails in the same way.
From googling, I've learned that this is because grub-install
thinks the target device is using an overlayfs and can't figure out which actual device to use but I'm not really sure where to go from here nor am I certain what questions to ask. I'm happy to provide more details although somethings will have to be redacted for proprietary software reasons.
If it matters, manually mounting the created OS partition off-system shows everything to be in the right place, our code is in place and would probably run well if there were a bootloader.
ETA: I've made some progress here, mounting the unsquashed OS into a directory in the live disk, mounting /proc
, /sys
, and /dev
into that directory, mounting my EFI partition into it, and chroot
ing into it. Then running grub-install /dev/sda
but grub is still missing on startup.
jsimon
(121 rep)
Dec 21, 2021, 08:52 PM
• Last activity: Jul 9, 2025, 07:05 PM
1
votes
1
answers
36
views
SquashFS corruption mechanisms
My embedded Linux system, which uses a SquashFS as its root filesystem, has unexpectedly stopped booting. The system is designed with an OverlayFS mounted on a temporary RAM disk to provide read-write capabilities while maintaining a reliable, read-only SquashFS base. The core issue appears to be a...
My embedded Linux system, which uses a SquashFS as its root filesystem, has unexpectedly stopped booting. The system is designed with an OverlayFS mounted on a temporary RAM disk to provide read-write capabilities while maintaining a reliable, read-only SquashFS base.
The core issue appears to be a corrupted SquashFS root filesystem. My understanding was that even if the OverlayFS experienced an issue (e.g., memory corruption in the RAM disk), it should be impossible for the operating system to modify the underlying SquashFS, as SquashFS is inherently read-only.
Given this setup, what are the possible mechanisms that could lead to a corrupted SquashFS root filesystem?
System Details (to the best of my knowledge, more can be provided if necessary):
* Root Filesystem: SquashFS
* Read-Write Layer: OverlayFS on a RAM disk (tmpfs)
* Bootloader: GRUB
* Storage Medium for SquashFS: NAND
* Kernel Version: Linux 4.19.155
* Hardware Platform: Intel x64
What I've already considered (and why I think it's unlikely, but open to correction):
* OverlayFS issues: I believe problems with the OverlayFS (e.g., corruption of the upperdir or workdir) should only affect the writable layer and not propagate to the read-only lower SquashFS.
* Normal operation: The system's design is specifically to prevent writes to the SquashFS during normal runtime.
My main question revolves around how a fundamentally read-only filesystem, protected by an OverlayFS, could become corrupted.
Any insights into software failures, hardware failures, or misconfigurations that could lead to this situation would be greatly appreciated.
Lhh92
(61 rep)
Jun 29, 2025, 05:05 PM
• Last activity: Jun 30, 2025, 01:36 AM
1
votes
2
answers
1997
views
Unable to kickstart machine with spacewalk / 404 squashfs.img
I am using spacewalk 2.6 on a CentOS7 machine. I am trying to kickstart machine from the spacewalk server. For troubleshooting purposes, i have * disabled SElinux * no iptabled/firewalld I have tried creating an installable tree during the syncing of channel/repo of a CentOS7. After the distribution...
I am using spacewalk 2.6 on a CentOS7 machine.
I am trying to kickstart machine from the spacewalk server.
For troubleshooting purposes, i have
* disabled SElinux
* no iptabled/firewalld
I have tried creating an installable tree during the syncing of channel/repo of a CentOS7. After the distribution is added in spacewalk, is set the installer generation to Red Hat Linux 7. I have also mounted an iso of a netinstall iso of SL, and copied its content to the spcewalk server to create a distribution in Spacewalk
I create a kickstart in the GUI of spacewalk, all fine and well.
When i kickstart a machine, it fails because it cannot find
LiveOS/squashfs.img
. The file is there on the server, but the httpd gives an 404. I tried to widen the permission on the LiveOS folder in the kickstart tree but no dice.
10.10.70.8 - - [15/Jan/2017:12:39:00 +0100] "POST /cobbler_api HTTP/1.1" 200 143 "-" "Java/1.8.0_111"
10.10.70.8 - - [15/Jan/2017:12:39:00 +0100] "POST /cobbler_api HTTP/1.1" 200 129 "-" "Java/1.8.0_111"
10.10.10.6 - - [15/Jan/2017:12:39:00 +0100] "GET /var/satellite/rhn/kickstart/sl_netinst/.treeinfo HTTP/1.1" 404 4715 "-" "curl/7.29.0"
10.10.10.6 - - [15/Jan/2017:12:39:00 +0100] "GET /var/satellite/rhn/kickstart/sl_netinst/LiveOS/squashfs.img HTTP/1.1" 404 4715 "-" "curl/7.29.0"
-rw-r-xr-x. 1 777 root 282337280 Jan 13 23:48 /var/satellite/rhn/kickstart/sl_netinst/LiveOS/squashfs.img
Can someone help me troublshoot this?
Arch
(11 rep)
Jan 15, 2017, 11:44 AM
• Last activity: Apr 21, 2025, 10:00 PM
2
votes
0
answers
87
views
Add error correction to SquashFS images as part of a backup strategy
My backup strategy currently primarily consists of daily backups of all of my machines with Borg Backup, stored on different storage devices in different locations, following the 3-2-1 strategy. These file-level backups are the important ones that matter most to me. My question is *not* about these...
My backup strategy currently primarily consists of daily backups of all of my machines with Borg Backup, stored on different storage devices in different locations, following the 3-2-1 strategy. These file-level backups are the important ones that matter most to me. My question is *not* about these backups, I mention them for context.
Next to Borg Backup I also sporadically create full disk image backups with
dd
. After zero'ing the disk's free space (using zerofree
on ext4, dd if=/dev/zero
otherwise) I usually create a SquashFS image of the raw disk image (e.g. sda.img
becomes the only file in disks.sqfs
). This allows me to store the raw disk image in compressed form, while still allowing me to access the data without the need to decompress everything first.
These full disk image backups are stored on a single storage device (a NAS to be more precise), i.e. don't follow the 3-2-1 strategy. Creating a second copy of the data is out of scope, simply because they take too much space and because I consider investing into more storage a waste of money due to my Borg Backup backups. So, I'm fine with loosing these backups per-se, but I want to protect them a little better. Thus I'm thinking about adding some sort of error correction mechanism.
I read through a lot of resources and found that Reed–Solomon error correction seems to be the way to go. It adds some overhead to the data stored and provides safety in most, even though not all cases.
**My question is the following:** How do I do that in practice? What tools are available and how would I use them in my case? I found [this 10 years old Stack Exchange question](https://unix.stackexchange.com/questions/170652/is-it-possible-to-add-error-correction-codes-bch-rs-or-etc-to-a-single-file) listing a whole bunch of tools, but many of the projects are apparently dead. Plus, they don't seem to fit my needs:
Storing the data in compressed form and yet being able to access the data without the need to decompress it first is a must-have for me. So, unless there's another solution, I'm stuck with SquashFS. However, according to the resources I read, combining ECC with compression is hard: One apparently shouldn't calculate ECCs from compressed data, but from the original data, because ECC doesn't guarantee a 100% correction and even a single remaining corruption could yield all compressed data useless. However, calculating ECCs from original data and then compressing it wouldn't help either, because I might not be able to decompress the data due to the corruptions. So, apparently one needs software that does both at the same time: compression and ECC. Per ddrescue
I found that lzip
can actually do that by creating forward error correction (fec) files alongside compressing the data, but AFAIK I can't tell SquashFS to create these files.
So, I'm kinda stuck with this chicken-and-egg problem... How can I combine SquashFS with ECC, or is there an alternative to SquashFS that allows this?
Any suggestions?
PhrozenByte
(21 rep)
Apr 1, 2025, 07:26 PM
• Last activity: Apr 1, 2025, 07:30 PM
2
votes
1
answers
208
views
Calculate byte offset for unquashfs
I'm trying to calculate the `-o` value for extracting an `.AppImage` file using `unsquashfs` on foreign architectures/OSs , but using `objdump` instead of `readelf` to make the solution more compatible with OSs such as macOS. ``` unsquashfs Usage: -o BYTES, -offset BYTES skip BYTES at start of FILES...
I'm trying to calculate the
-o
value for extracting an .AppImage
file using unsquashfs
on foreign architectures/OSs , but using objdump
instead of readelf
to make the solution more compatible with OSs such as macOS.
unsquashfs
Usage:
-o BYTES, -offset BYTES
skip BYTES at start of FILESYSTEM. Optionally a suffix of K, M or G can be given to specify Kbytes, Mbytes or Gbytes respectively (default 0
bytes).
I'm following the guidance of [this solution](https://superuser.com/a/1690054?_gl=1*1ytjlvt*_ga*MTU2NzA5OTc3NS4xNzMzMzU0NzA4*_ga_S812YQPLT2*MTczNzA0OTY3Ny4xMS4xLjE3MzcwNTEwMzQuMC4wLjA.) , which uses readelf
to calculate the -o
offset value. This works great on Ubuntu, but does not work for macOS due to the generally unavailability of readelf
.
However, I'd like to use objdump
if possible. I've found a few questions that explain how to find the entry point/offset of a binary executable, but no matter what values I try, I can't find a way to get the correct value for unsquashfs
. I'm converting hex values to decimal, but nothing from objdump
matches up to the readelf
values below, even when using [Employed Russian's](https://stackoverflow.com/a/71367851) ehdr->e_entry - phdr->p_vaddr + phdr->p_offset.
equation.
* https://stackoverflow.com/a/71367851
* https://stackoverflow.com/a/57841768
* https://stackoverflow.com/a/16019798
For example, take Audacity's AppImage for example:
https://github.com/audacity/audacity/releases/download/Audacity-3.7.1/audacity-linux-3.7.1-x64-22.04.AppImage
* Calling readelf -h audacity-linux-3.7.1-x64-22.04.AppImage
gives me some helpful values, such as Start of section headers
, Size of section headers
, Number of section headers
.
* Next, using [Martin Vyskočil's](https://superuser.com/a/1690054?_gl=1*1sf6dim*_ga*MTU2NzA5OTc3NS4xNzMzMzU0NzA4*_ga_S812YQPLT2*MTczNzA0OTY3Ny4xMS4xLjE3MzcwNTExMDEuMC4wLjA.) $START_OF_SECTION + $SECTION_SIZE * $SECTION_NO
logic , I can get a correct value of 191680 + 64 * 32
, which is 193728
.
* The following command succeeds (on macOS and Ubuntu):
unsquashfs -o 193728 audacity-linux-3.7.1-x64-22.04.AppImage squashfs-root
... but how can I calculate this offset value with objdump
instead of readelf
?
tresf
(355 rep)
Jan 16, 2025, 06:10 PM
• Last activity: Mar 31, 2025, 10:19 PM
0
votes
0
answers
96
views
unsquashfs tool to extract files from an image file
Just to be clear: linux tool `unsquashfs(1)` takes as input the name of a `squashfs` filesystem **image** file. In other words the file we pass to it is a "bit by bit" image of a squashfs filesystem stored within blocks of an disk (or RAM disk). Basically it *extracts* files and directories within t...
Just to be clear: linux tool
unsquashfs(1)
takes as input the name of a squashfs
filesystem **image** file.
In other words the file we pass to it is a "bit by bit" image of a squashfs filesystem stored within blocks of an disk (or RAM disk). Basically it *extracts* files and directories within the squashfs filesystem into a directory on the "host system" passed to it by its name.
Is the above correct? Thanks.
CarloC
(385 rep)
Nov 3, 2024, 07:56 AM
• Last activity: Nov 3, 2024, 11:28 AM
68
votes
6
answers
223717
views
Mounting a squashfs filesystem in read-write
I have a Clonezilla installation on a USB stick and I'd like to make some modifications to the operating system. Specifically, I'd like to insert a runnable script into `/usr/sbin` to make it easy to run my own backup command to make backups less painful. The main filesystem lives under `/live/files...
I have a Clonezilla installation on a USB stick and I'd like to make some modifications to the operating system. Specifically, I'd like to insert a runnable script into
/usr/sbin
to make it easy to run my own backup command to make backups less painful.
The main filesystem lives under /live/filesystem.squashfs
on the USB FAT-32 partition.
How can I mount this read/write on my Linux machine in order to be able to add/remove/change files? I'm running an Ubuntu 12.04 derivative.
Naftuli Kay
(41346 rep)
Jun 21, 2013, 07:57 PM
• Last activity: Sep 14, 2024, 04:42 PM
11
votes
3
answers
22212
views
Modifying a squashfs,
Obviously, I don't want to actually modify a squashfs. What I would like to do though is take an existing squashfs, a set of files and create a new squashfs which is identical to the old one except that the files in the set either replace similar files in the squasfs or are just added if there is no...
Obviously, I don't want to actually modify a squashfs. What I would like to do though is take an existing squashfs, a set of files and create a new squashfs which is identical to the old one except that the files in the set either replace similar files in the squasfs or are just added if there is no similar files.
OK, that last part sounded weird. So let me give an example:
There is a squashfs called mfs.squash. Inside it there is a file
./a/foo
.
I want to create a new squashfs which is identical to the old squashfs – except
that there is a new file a/b
and I overwrite the ./a/foo
with one of my specification.
HandyGandy
(2239 rep)
Mar 9, 2011, 08:08 AM
• Last activity: Mar 10, 2024, 01:22 AM
5
votes
1
answers
4742
views
Mounting squashfs with correct permissions
I frequently use mksquashfs to make backups of folders on various systems. Sometimes this results in files which cannot be read by any users upon mounting. If I do a `sudo mount file.squashfs /to/mountpoint` and then try to ls the directory as root or with sudo I get a "permission denied" error. Vie...
I frequently use mksquashfs to make backups of folders on various systems. Sometimes this results in files which cannot be read by any users upon mounting. If I do a
sudo mount file.squashfs /to/mountpoint
and then try to ls the directory as root or with sudo I get a "permission denied" error. Viewing the properties of the mountpoint in Thunar results in it showing the owner as nobody
. Applying a chmod
also doesn't work as squashfs is a read-only filesystem.
How can I force mount to mount squashfs in a permissions-agnostic way or with the correct permissions? I don't actually need permissions for this use case, it may as well be world-readable.
Edit: I never found a full solution for opening "unreadable by root due to permissions" squashfs files, but I did find a way to prevent it from happening again. This works cross-system and cross-platform. Adding -all-root makes all files in the archive owned by root. Since permissions aren't important for these backups it is a clunky but effective fix. Still curious to see if somebody has a better one.
Mr. T
(109 rep)
Apr 27, 2019, 05:39 AM
• Last activity: Feb 8, 2024, 08:04 AM
0
votes
1
answers
790
views
how to boot QEMU from a cloned USB stick
Configuration: - MacOS arm64 M1 Apple Silicon as host - Live USB with Ubuntu 20.04 amd64 within a squashfs filesystem as guest - QEMU emulator on the host OS I want to strip the OS out the squashfs and boot it on a emulated amd64 virtual machine on my mac. I managed to extract the Ubuntu OS. I mount...
Configuration:
- MacOS arm64 M1 Apple Silicon as host
- Live USB with Ubuntu 20.04 amd64 within a squashfs filesystem as guest
- QEMU emulator on the host OS
I want to strip the OS out the squashfs and boot it on a emulated amd64 virtual machine on my mac.
I managed to extract the Ubuntu OS. I mounted the squashfs an copied the content into an img file I created using dd. I copied the image on the mac but when I try to boot the VM says "No bootable device".
Here are the commands I used, from a supporting Linux virtual machine
mount -t squashfs -o loop /path/to/filesystem.squashfs /sqshfs/mount/point
I created an empty image and made an ext4 fs
dd if=/dev/zeroes of=image.img bs=1M count=15000
mkfs.ext4 image.img
mounted it and copied the files
mount -t auto image.img /img/mount/point
cp -r /sqshfs/mount/point/* /img/mount/point
now on the image I have this folders
total 112
drwxr-xr-x 2 root root 4096 Jan 10 02:37 bin
drwxr-xr-x 3 root root 4096 Jan 10 02:37 boot
drwxr-xr-x 4 root root 4096 Jan 10 02:37 dev
drwxr-xr-x 147 root root 12288 Jan 10 02:37 etc
drwxr-xr-x 3 root root 4096 Jan 10 02:37 home
lrwxrwxrwx 1 root root 33 Jan 10 02:37 initrd.img -> boot/initrd.img-5.4.0-150-generic
lrwxrwxrwx 1 root root 33 Jan 10 02:37 initrd.img.old -> boot/initrd.img-5.4.0-148-generic
drwxr-xr-x 23 root root 4096 Jan 10 02:37 lib
drwxr-xr-x 2 root root 4096 Jan 10 02:37 lib64
drwx------ 2 root root 16384 Jan 10 02:36 lost+found
drwxr-xr-x 2 root root 4096 Jan 10 02:37 media
drwxr-xr-x 2 root root 4096 Jan 10 02:37 mnt
drwxr-xr-x 5 root root 4096 Jan 10 02:37 opt
drwxr-xr-x 2 root root 4096 Jan 10 02:37 proc
drwx------ 3 root root 4096 Jan 10 02:37 root
drwxr-xr-x 2 root root 4096 Jan 10 02:37 run
drwxr-xr-x 2 root root 12288 Jan 10 02:37 sbin
drwxr-xr-x 2 root root 4096 Jan 10 02:37 snap
drwxr-xr-x 2 root root 4096 Jan 10 02:37 srv
drwxr-xr-x 2 root root 4096 Jan 10 02:37 sys
drwxr-xr-t 2 root root 4096 Jan 10 02:37 tmp
drwxr-xr-x 11 root root 4096 Jan 10 02:38 usr
drwxr-xr-x 15 root root 4096 Jan 10 02:38 var
lrwxrwxrwx 1 root root 30 Jan 10 02:38 vmlinuz -> boot/vmlinuz-5.4.0-150-generic
lrwxrwxrwx 1 root root 30 Jan 10 02:38 vmlinuz.old -> boot/vmlinuz-5.4.0-148-generic
converted the img in qcow2
qemu-img convert -f raw -O qcow2 -c image.img image.qcow2
and configured QEMU as follows
qemu-system-x86_64 \
-name TEST \
-cpu qemu64-v1 \
-smp cpus=4,sockets=1,cores=4,threads=1 \
-machine pc-q35-7.2,vmport=off,i8042=off,hpet=off \
-accel tcg,thread=multi,tb-size=1024 \
-m 4096 \
-drive file=/Users/steve/VMs/image.qcow2 \
-boot menu=on
When I try to boot the VM says "No bootable device".
I'm very new abt QEMU and I know this configuration miss something but it should at least try to boot the kernel. GUID?
Steve-no-Jobs
(33 rep)
Jan 10, 2024, 03:23 AM
• Last activity: Jan 10, 2024, 06:48 AM
5
votes
2
answers
3593
views
How to convert from rar or tgz to squashfs without having to extract to temporary folder?
I enjoy using squashfs for compression because of the simplicity of mounting them as loop devices to access the files inside. I have a lot of rar, tgz and zip files that I would like to convert to squashfs. In [this answer][1], I saw that it is possible to use a pseudo file when compressing a disk i...
I enjoy using squashfs for compression because of the simplicity of mounting them as loop devices to access the files inside.
I have a lot of rar, tgz and zip files that I would like to convert to squashfs.
In this answer , I saw that it is possible to use a pseudo file when compressing a disk image to squashfs to avoid having to use a temporary file the size of the whole disk.
mkdir empty-dir
mksquashfs empty-dir squash.img -p 'sda_backup.img f 444 root root dd if=/dev/sda bs=4M'
I would like to use pseudo files to convert from rar, tgz or zip to squashfs in the same way (on the fly), so I don't have to first extract the whole archive to disk and then compress to squashfs in a separate operation.
Some of these archives contain thousands of individual files, some of which will have spaces or other special characters in their filenames.
I looked at the README , and I think I would need to use the
-pf
option, but I'm not sure how to create the pseudo file on the fly (and also not have problems with filenames with spaces). I think I would need to use process substitution to create the list of files from the source archive.
Ideally I would like to have a command that is able to convert any rar, tgz or zip without having to individually create the pseudo file for each archive, but if anyone can tell me how I can do it with one of those archive formats, then hopefully I can work it out for the others.
Thanks everyone.
localhost
(327 rep)
Jun 15, 2020, 12:56 AM
• Last activity: Dec 27, 2023, 06:22 PM
4
votes
2
answers
14916
views
How to use 'unsquashfs' with lzma?
I'm using Ubuntu 12.04. I want to unsquash an lzma image. I have done sudo apt-get squashfs-tools Now, when I do unsquashfs I get Filesystem uses lzma compression, this is unsupported by this version I know my squashed image is lzma. How do I install support for lzma? I have downloaded the squashfs-...
I'm using Ubuntu 12.04. I want to unsquash an lzma image. I have done
sudo apt-get squashfs-tools
Now, when I do
unsquashfs
I get
Filesystem uses lzma compression, this is unsupported by this version
I know my squashed image is lzma. How do I install support for lzma? I have downloaded the squashfs-tools from here: http://sourceforge.net/projects/squashfs/files/
It is my understanding that after extracting that tarball, I need to
cd
into squashfs4.2/squashfs-tools
and edit the Makefile
by uncommenting the line LZMA_XZ_SUPPORT = 1
. Then I just need to run make
.
That does not work for me. I get the error:
gzip_wrapper.c:23:18: fatal error: zlib.: No such file or directory
I think I need to install lzma-devel
and xz-devel
. I have tried this and been Googling for a couple hours and haven't gotten anywhere or found any solid instructions that show how this should work. Can anyone who has done this help me out? I am new to desktop Linux so if you could be fairly verbose in your instructions that would be appreciated.
boltup_im_coding
(213 rep)
Sep 12, 2013, 01:32 AM
• Last activity: Aug 28, 2023, 02:47 PM
1
votes
1
answers
641
views
squashfs reserve some free space
**Briefly: Is it possible to reserve some free space using mksquashfs?** I'm creating an image of simple livecd based on squashfs filesystem. Everything works fine except that I've got very little "free" space on a root partition. Can I assign more free space with mksquashfs? For now as I workaround...
**Briefly: Is it possible to reserve some free space using mksquashfs?**
I'm creating an image of simple livecd based on squashfs filesystem. Everything works fine except that I've got very little "free" space on a root partition.
Can I assign more free space with mksquashfs?
For now as I workaround I'm mounting ramfs after livecd boot. Another idea will be to create a large file on squashfs, pack it using mksquashfs and delete it after bootup.
Is there any "clean" solution?
Dejwi
(221 rep)
Jul 16, 2014, 02:33 PM
• Last activity: Jul 26, 2023, 04:50 PM
1
votes
0
answers
298
views
Do cryptsetup encryption from user space, possibly as ordinary user
I have the duty to create a package format which has its contents compressed and encrypted and which can be mounted. I have modelled it to be a squashfs embedded in a cryptsetup raw device. Alas, this prevents me from building such a package from a build server such as jenkins, as I would need root...
I have the duty to create a package format which has its contents compressed and encrypted and which can be mounted.
I have modelled it to be a squashfs embedded in a cryptsetup raw device.
Alas, this prevents me from building such a package from a build server such as jenkins, as I would need root access in order to set up a cryptsetup. And doing the same from within a docker container doesn't work either, as docker isn't transparent for the device mapper.
So I have the following options:
1. Only create the squashfs on the build server and complete the cryptsetup layer "manually"
2. Somehow do the cryptsetup encryption without kernel involvement.
As 1. would add another step to the process, I'd prefer to do something like 2.
In order to be a little more comprehensible:
Currently, I do something along the lines of
mksquashfs tempfile -noappend
cryptsetup open -q -d keyfile outfile
mksquashfs /dev/mapper/ -noappend
cryptsetup close
I would like to simplify this into
mksquashfs tempfile -noappend
user_space_crypt_create -q -d keyfile tempfile outfile
where user_space_crypt_create just transforms the unencrypted tempfile to a (raw) encrypted outfile which later can be mounted on the target system via cryptsetup.
Does something like this exist?
glglgl
(1210 rep)
Jul 5, 2023, 03:49 PM
1
votes
1
answers
174
views
How to loop-mount Ubuntu boot drive backup LVM with duplicate UUID
I created a backup of my LUKS-encrypted Ubuntu installation's entire boot drive as a `squashfs` file. The backup was performed by using Streaming Compression into a [pseudo file][1], resulting in a compressed file that contains an image of the entire drive. ```` mksquashfs empty-dir nvme_backup.img....
I created a backup of my LUKS-encrypted Ubuntu installation's entire boot drive as a
squashfs
file.
The backup was performed by using Streaming Compression into a pseudo file , resulting in a compressed file that contains an image of the entire drive.
`
mksquashfs empty-dir nvme_backup.img.squashfs -p 'nvme.img f 444 root root dd if=/dev/nvme0n1 bs=4M'
`
lsblk
`
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdj 8:144 0 119.2G 0 disk
+-sdj1 8:145 0 119.2G 0 part
nvme0n1 259:0 0 223.6G 0 disk
+-nvme0n1p1 259:1 0 487M 0 part /boot
+-nvme0n1p2 259:2 0 1K 0 part
+-nvme0n1p5 259:3 0 118.8G 0 part
+-sdb5_crypt 253:0 0 118.8G 0 crypt
+-ubuntu--nvme--vg-root 253:1 0 110.8G 0 lvm /
+-ubuntu--nvme--vg-swap_1 253:2 0 8G 0 lvm
+-cryptswap1 253:3 0 8G 0 crypt [SWAP]
`
`
sudo mount /dev/sdj1 /media/backup
sudo mount nvme_backup.img.squashfs /media/backup/mountpoint/ # mount the squashfs
cd mountpoint
sudo kpartx -va nvme.img # find the partitions and loop-mount them
`
`
add map loop1p1 (253:10): 0 997376 linear 7:1 2048
add map loop1p2 (253:11): 0 2 linear 7:1 1001470
add map loop1p5 (253:12): 0 249067520 linear 7:1 1001472
`
lsblk
`
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 111.4G 0 loop /media/backup/mountpoint
loop1 7:1 0 119.2G 1 loop
+-loop1p1 253:10 0 487M 1 part
+-loop1p2 253:11 0 1K 1 part
+-loop1p5 253:12 0 118.8G 1 part
sdj 8:144 0 119.2G 0 disk
+-sdj1 8:145 0 119.2G 0 part /media/backup
nvme0n1 259:0 0 223.6G 0 disk
+-nvme0n1p1 259:1 0 487M 0 part /boot
+-nvme0n1p2 259:2 0 1K 0 part
+-nvme0n1p5 259:3 0 118.8G 0 part
+-sdb5_crypt 253:0 0 118.8G 0 crypt
+-ubuntu--nvme--vg-root 253:1 0 110.8G 0 lvm /
+-ubuntu--nvme--vg-swap_1 253:2 0 8G 0 lvm
+-cryptswap1 253:3 0 8G 0 crypt [SWAP]
`
`
sudo cryptsetup luksOpen /dev/mapper/loop1p5 root
Enter passphrase for /dev/mapper/loop1p5:
`
sudo lvscan
`
WARNING: Not using device /dev/gpt-auto-root for PV xCIFJX-luFH-kOpr-9HvF-fz5E-PeTf-c8YZyo.
WARNING: PV xCIFJX-luFH-kOpr-9HvF-fz5E-PeTf-c8YZyo prefers device /dev/mapper/sdb5_crypt because device is used by LV.
ACTIVE '/dev/ubuntu-nvme-vg/root' [110.75 GiB] inherit
ACTIVE '/dev/ubuntu-nvme-vg/swap_1' [<7.99 GiB] inherit
`
lsblk -o name,mountpoint,size,type,ro,label,uuid | grep CIF
`
+-root 118.8G crypt 1 xCIFJX-luFH-kOpr-9HvF-fz5E-PeTf-c8YZyo
+-sdb5_crypt 118.8G crypt 0 xCIFJX-luFH-kOpr-9HvF-fz5E-PeTf-c8YZyo
`
So I can't mount the LVM because the UUID of the /dev/mapper/sdb5_crypt
and /dev/mapper/root
PVs are the same, which makes sense because it is a clone.
How can I mount the LVM to get files out of it, keeping in mind that it's all on a read-only loop mounted squashfs, so I can't just change the UUID or name?
localhost
(327 rep)
Jun 29, 2023, 09:31 AM
• Last activity: Jun 29, 2023, 11:14 AM
5
votes
1
answers
16005
views
How to mount squashfs (embedded-linux) on Ubuntu?
I have tried to mount a filesystem from a firmware (embedded-linux) but it failed on my Ubuntu 12.04 machine. Could you tell me how to mount that file system? (or possible reasons of the failure). Details are as follows. Details ------- Step1) Analyzing the firmware using binwalk shows starting addr...
I have tried to mount a filesystem from a firmware (embedded-linux) but it failed on my Ubuntu 12.04 machine. Could you tell me how to mount that file system? (or possible reasons of the failure). Details are as follows.
Details
-------
Step1)
Analyzing the firmware using binwalk shows starting address of squashfs filesystem. Thus I generated squashfs filesystem using "dd" linux utility.
Step2)
The analysis of generated filesystem using "binwalk ./fs.img" command shows:
Squashfs filesystem, big endian, lzma signatrue, version 3.0, size: XXXXXXX bytes, XXX inodes, blocksize: XXXXX bytes, created: xxxx
Step3) "mount -o loop ./fs.img ./fs" failed. "dmesg | tail" shows:
SQUASHFS error: Can't find a SQUASHFS superblock on loop1
How can I mount that file system? FYI,
I installed latest squashfs-tools with lzma support from "sourceforge.net/procjects/squashfs".
kolar
(335 rep)
Aug 22, 2014, 05:56 AM
• Last activity: Apr 3, 2023, 09:22 AM
2
votes
1
answers
740
views
Is it possible to append a signature to a squashfs file, without causing problems with tools/mount?
I would like to authenticate a squashfs image, using a public-key signature. For an elegant implementation, it would be ideal if such a signature could simply be appended to the end of the squashfs image file. Can squashfs tools, including kernel mount code, handle a squashfs image with some extra d...
I would like to authenticate a squashfs image, using a public-key signature. For an elegant implementation, it would be ideal if such a signature could simply be appended to the end of the squashfs image file.
Can squashfs tools, including kernel mount code, handle a squashfs image with some extra data appended to the end of the file, without any ill effect?
Craig McQueen
(891 rep)
Feb 3, 2023, 06:22 AM
• Last activity: Feb 3, 2023, 01:57 PM
9
votes
2
answers
37079
views
What is filesystem.squashfs and why does it take so long to load on to bootable media?
When I use Unetbootin to put a Linux ISO on a USB drive, it proceeds quite quickly until it gets to `filesystem.squashfs`, which takes longer to process than absolutely everything else combined. Is this writing a new filesystem to the USB, or is it copying some huge filesystem-dependent file? If so,...
When I use Unetbootin to put a Linux ISO on a USB drive, it proceeds quite quickly until it gets to
filesystem.squashfs
, which takes longer to process than absolutely everything else combined.
Is this writing a new filesystem to the USB, or is it copying some huge filesystem-dependent file? If so, is there a way to only do it once in the event that I will be trying many distros and want to speed this step up?
user1717828
(3592 rep)
Jun 3, 2016, 12:34 PM
• Last activity: Dec 6, 2022, 04:13 PM
1
votes
1
answers
1921
views
ParrotOS install giving bad unsquash config error
I installed Parrot (5.0.1 Home edition, amd64) onto a USB stick using Rufus to use as a live boot on an old laptop I had lying around. I then decided to install Parrot onto the laptop harddrivehard drive itself with the onboard installer. I left all the install settings as default and selected the "...
I installed Parrot (5.0.1 Home edition, amd64) onto a USB stick using Rufus to use as a live boot on an old laptop I had lying around. I then decided to install Parrot onto the laptop harddrivehard drive itself with the onboard installer. I left all the install settings as default and selected the "Erase data" option, created a username/password, and started the install process.
It started as normal, wiped the drive, and created its' partitions. Then it threw up an error message:
Installation Failed
Bad Unsquash Configuration
The source filesystem "/run/live/medium/live/filesystem.squashfs" does not exist
Now, I am by no means a developer. I had intended this to be my learning tool into Linux type systems instead of Windows, which I'm used to. I've never heard of this error, and looking around on the internet and stack exchange I couldn't find a solution to a problem like this one that I thought I had a chance of fixing myself.
*Sidebar: It didn't throw up the error until after the drive was wiped. Windows is gone, and the laptop now won't boot without the usb stick in it, because there's no host OS anymore.*
I've tried rerunning the installer with custom partitions following a few guides online but that didn't change anything.
Can I salvage this? I assume it has to be a bad live install of Parrot, but I don't want to try anything else on my own.
Asura
(11 rep)
Sep 11, 2022, 11:19 AM
• Last activity: Sep 13, 2022, 10:47 PM
Showing page 1 of 20 total questions