Perfect, I forgot about deborphan and some of those other commands I didn't know at all. I did see the other thread and read quite a bit as it's along the lines of what i'm trying to do, so after I posted yesterday I spent a couple of hours learning more about xz and mksquashfs, and I did come up with some answers and one partial solution that helped me cut size down about 3% or so, it's not much, dropped my iso size down from 410 to 398.5, but may help on the larger iso's you're working on, forgive me if you already know this stuff but here it is:
Xz does have variable compression levels, they are numbered 1-9 with 9 being the highest (most) compression level, and if you are using xz just standalone to compress something, you can add the option of choosing compression level, - <1-9>, the default setting is 6.
The problem is that when used inside mksquashfs, you can't use xz options (unless there is some way to "nest" options, but the mksquashfs man page says you can't), so you are stuck with the default setting of 6.
But there are a couple of options that mksquashfs has when using xz, the "Xdict-size -<dictionary-size> option, but this didn't do much as you can only set it to a maximum of 100% of block size, and I don't know if you can increase block size? In practice, setting it to 75% gave me the exact same size iso (410 mb) and setting it to 100% only made the size a fraction smaller, 408.9 mb.
The other option did some good though, it's : -Xbcj <filter> , "filter" referring to the achitecture you're compressing for, x86, arm, etc. It says in the man page that it then optimizes it basically and gives you "the best compression", that doesn't mean the most compression because I know it can go smaller, so I guess they use the term to express some arbitrary balance of factors.
So I edited Refractasnapshot.conf on the line you uncomment to enable xz, here is what mine reads now:
- Code: Select all
mksq_opt="-comp xz -Xbcj x86"
And this got me the reduction I mentioned above, about 3%, but that's roughly 30 mb or better uncompressed, on a full size iso that you're trying to keep under 700 mb that's 20 mb or better compressed and possibly 60mb or more uncompressed, might be enough to make a difference.
I tried using both options together, but got no further reduction doing so, so I dropped the Xdict-size option.
I don't see any other way of getting xz off of that level 6 default other than re-compiling from source and changing it, although that might not be a big deal for somebody who's familiar with the process, i'm not myself (yet) or I would do it, never did learn how to package either and I know that's even easier so I need to get to that soon too.
fsmithred wrote:The sizes sound about right. I'm not really sure, because I always keep the copy of the file system in the work dir and a couple of snaphots. So my total used space is misleading. I don't think you can compress it any more than it is.
The thing that would probably make the most difference in size would be to install and run localepurge to get rid of any locales you won't be using. See this discussion -
refracta-8-jessie-based-on-devuan-t529-40.html#p5595Also, too late if you didn't already do it, set apt so it does not install Recommends.
Create (/)etc/apt/apt.conf.d/00norecommends with the following content:
- Code: Select all
APT::Install-Recommends "no";
APT::Install-Suggests "no";
Other commands that might help you:
- Code: Select all
aptitude -s install <some packages>
apt-get autoremove
aptitude search ~c # shows you removed packages that left behind config files.
aptitude purge ~c # removes those leftover configs
deborphan
aptitude why <package>
aptitude show <package>
apt-cache depends <package>
apt-cache rdepends <package>