Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Allow unsquashfs to unpack over pre-mounted directories #258

Open
klark973 opened this issue Jul 5, 2023 · 0 comments
Open

Comments

@klark973
Copy link

klark973 commented Jul 5, 2023

Hi!

My comments in addition to PR #257...

MS Windows WIM/ESD archive is very similar to squashfs and how can it be used? Like to squashfs, but you can also choose one profile of the MS Windows to install: Home, Professional, Ultimate, etc. It's possible because deduplication is used. However in MS Windows the source WIN/ESD archive unpacked to only the one system drive, and we have no problems with hard links.

How we can replicate this in Linux installer that unpacks a ready-to-use filesystem into several different pre-mounted directories, like /var, /usr, /home, etc...? Currently this is only possible when using unsquashfs with the --force option, and the source archive must be created by mksquashfs with the -no-hardlinks option, otherwise we might run into this problem:

FATAL ERROR: create_inode: failed to create hardlink, because Invalid cross-device link

This is because in some cases rootfs can use hard links, for example between files in the /etc and /var/lib directories. When we create an archive, we do not know anything about how and where it will be unpacked, we create a single archive of a complete rootfs. Mksqushfs with the -no-hardlinks option solves this problem, but packaging with this option loses all the benefits of deduplication. So on Windows we can save space, but on Linux we can't.

Let's say the installer pre-creates mount points with different devices:

  • /mnt/destination
  • /mnt/destination/var/www
  • /mnt/destination/var/log

With the proposed patch, unpacking is possible without additional options, and to return the default behavior, you should use the -one-file-system option, by analogy with other utilities. At the same time, the archive could contain different server deployment profiles: minimal, web server, etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant