WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: compressing a file system with zstd and advdef  (Read 164 times)

Offline MrPorcine

  • Jr. Member
  • **
  • Posts: 69
compressing a file system with zstd and advdef
« on: December 04, 2026, 01:12:34 PM »
My old script for compressing a modified file system doesn't work with zstd as advdef doesn't seem to understand zstd. Is there a new how-to on how to do this? Here's the old script:
Code: [Select]
#!/bin/bash

cd coreRoot
find | cpio -o -H newc | gzip -2 > ../tinycore.gz
cd ..
advdef -z4 tinycore.gz
If I simple replace gzip with zstd, and change the extensions, advdef fails.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1654
Re: compressing a file system with zstd and advdef
« Reply #1 on: December 04, 2026, 03:15:10 PM »
advdef does not understand zstd.   Just leave it out of the script.  zstd does everything it needs to by itself.   

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 874
Re: compressing a file system with zstd and advdef
« Reply #2 on: December 04, 2026, 03:16:50 PM »
And with -9 it do it's best

Offline MrPorcine

  • Jr. Member
  • **
  • Posts: 69
Re: compressing a file system with zstd and advdef
« Reply #3 on: December 04, 2026, 03:47:44 PM »
Thanks for the suggestions. "zstd -9" does produce the compressed file. I'm somewhat surprised that the file size went from 3.3M to 4.0M. All I did was change  fstab.

I wonder if my decompress script is screwing up:
Code: [Select]
#!/bin/bash
if [ $2'a' = 'a'  ] ; then
echo "Unpack initrd file system"
echo "Usage: unpack.sh <file to decompress> <name of root directory>"
echo "root directory will be created if it does not exist"
exit -1
fi
sudo mkdir -p $2
cd $2
unzstd -c ../$1 | sudo cpio -i -H newc -d
« Last Edit: December 04, 2026, 04:02:15 PM by MrPorcine »

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1654
Re: compressing a file system with zstd and advdef
« Reply #4 on: Today at 12:42:55 PM »
zstd has many many options, as compression increases speed and memory use do to.  try "-19".  There are even higher levels.