compressing and decompressing dd image - zstd instead of gzip
Clash Royale CLAN TAG#URR8PPP
Earlier I was using fsarchiver to create compressed partition image. Due to some weird behavior I am choosing to replace it with dd
.
However, I like how fsarchiver compressed with zstd.
So, I studied,
How to make a disk image and restore from it later?- Using DD for disk cloning
- Making full disk image with DD
- compressing dd backup on the fly
- How do you monitor the progress of dd?
What these essentially say is, I have to use the following command to backup
dd if=/dev/sda2 status=progress | gzip -c > /media/mint/Data/_Fsarchiver/MintV1.img.gz
And the following command to restore
gunzip -c /media/mint/Data/_Fsarchiver/MintV1.img.gz | dd of=/dev/sda2 status=progress
Now I want to replace gzip -c
& gunzip -c
with zstd
& zstd -d
The commands I came up with are
To compress
sudo dd if=/dev/sda2 status=progress | zstd -16vT6 > /media/mint/Data/_Fsarchiver/MintV1.zst
To decompress
zstd -vdcfT6 /media/mint/Data/_Fsarchiver/MintV1.zst | dd of=/dev/sda2 status=progress
Is it safe to try these commands or am I doing something wrong?
command-line dd compression zstd
add a comment |
Earlier I was using fsarchiver to create compressed partition image. Due to some weird behavior I am choosing to replace it with dd
.
However, I like how fsarchiver compressed with zstd.
So, I studied,
How to make a disk image and restore from it later?- Using DD for disk cloning
- Making full disk image with DD
- compressing dd backup on the fly
- How do you monitor the progress of dd?
What these essentially say is, I have to use the following command to backup
dd if=/dev/sda2 status=progress | gzip -c > /media/mint/Data/_Fsarchiver/MintV1.img.gz
And the following command to restore
gunzip -c /media/mint/Data/_Fsarchiver/MintV1.img.gz | dd of=/dev/sda2 status=progress
Now I want to replace gzip -c
& gunzip -c
with zstd
& zstd -d
The commands I came up with are
To compress
sudo dd if=/dev/sda2 status=progress | zstd -16vT6 > /media/mint/Data/_Fsarchiver/MintV1.zst
To decompress
zstd -vdcfT6 /media/mint/Data/_Fsarchiver/MintV1.zst | dd of=/dev/sda2 status=progress
Is it safe to try these commands or am I doing something wrong?
command-line dd compression zstd
add a comment |
Earlier I was using fsarchiver to create compressed partition image. Due to some weird behavior I am choosing to replace it with dd
.
However, I like how fsarchiver compressed with zstd.
So, I studied,
How to make a disk image and restore from it later?- Using DD for disk cloning
- Making full disk image with DD
- compressing dd backup on the fly
- How do you monitor the progress of dd?
What these essentially say is, I have to use the following command to backup
dd if=/dev/sda2 status=progress | gzip -c > /media/mint/Data/_Fsarchiver/MintV1.img.gz
And the following command to restore
gunzip -c /media/mint/Data/_Fsarchiver/MintV1.img.gz | dd of=/dev/sda2 status=progress
Now I want to replace gzip -c
& gunzip -c
with zstd
& zstd -d
The commands I came up with are
To compress
sudo dd if=/dev/sda2 status=progress | zstd -16vT6 > /media/mint/Data/_Fsarchiver/MintV1.zst
To decompress
zstd -vdcfT6 /media/mint/Data/_Fsarchiver/MintV1.zst | dd of=/dev/sda2 status=progress
Is it safe to try these commands or am I doing something wrong?
command-line dd compression zstd
Earlier I was using fsarchiver to create compressed partition image. Due to some weird behavior I am choosing to replace it with dd
.
However, I like how fsarchiver compressed with zstd.
So, I studied,
How to make a disk image and restore from it later?- Using DD for disk cloning
- Making full disk image with DD
- compressing dd backup on the fly
- How do you monitor the progress of dd?
What these essentially say is, I have to use the following command to backup
dd if=/dev/sda2 status=progress | gzip -c > /media/mint/Data/_Fsarchiver/MintV1.img.gz
And the following command to restore
gunzip -c /media/mint/Data/_Fsarchiver/MintV1.img.gz | dd of=/dev/sda2 status=progress
Now I want to replace gzip -c
& gunzip -c
with zstd
& zstd -d
The commands I came up with are
To compress
sudo dd if=/dev/sda2 status=progress | zstd -16vT6 > /media/mint/Data/_Fsarchiver/MintV1.zst
To decompress
zstd -vdcfT6 /media/mint/Data/_Fsarchiver/MintV1.zst | dd of=/dev/sda2 status=progress
Is it safe to try these commands or am I doing something wrong?
command-line dd compression zstd
command-line dd compression zstd
asked Jan 6 at 8:55
bluerayblueray
1336
1336
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Using dd
like that (without any options) will make your life miserable. Just cut it out entirely. Or at the very least increase its block size and tell it not to object to short reads.
Without
dd
, first runsudo -s
to get a root shell:gzip </dev/sda2 >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gunzip </media/mint/Data/_Fsarchiver/MintV1.img.gz >/dev/sda2Your
zstd
commands look entirely plausible, but just omitdd
and read/write the device directly as root. (My version doesn't understand yourT6
so I've omitted that here.)zstd -16v </dev/sda2 >/media/mint/Data/_Fsarchiver/MintV1.zst
zstdcat -v /media/mint/Data/_Fsarchiver/MintV1.zst >/dev/sda2With
dd
, either prefix thedd
withsudo
or usesudo -s
to get a root shell:dd bs=1M iflag=fullblock if=/dev/sda2 status=progress | gzip >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gzcat /media/mint/Data/_Fsarchiver/MintV1.img.gz | dd bs=1M iflag=fullblock of=/dev/sda2 status=progress
dd bs=1M iflag=fullblock if=/dev/sda2 status=progress | zstd -16v >/media/mint/Data/_Fsarchiver/MintV1.img.zst
zstdcat /media/mint/Data/_Fsarchiver/MintV1.img.zst | dd bs=1M iflag=fullblock of=/dev/sda2 status=progressWith
pv
instead ofdd
. Either usesudo pv
orsudo -s
beforehand to get a root shell:pv </dev/sda2 | gzip >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gzcat /media/mint/Data/_Fsarchiver/MintV1.img.gz | pv >/dev/sda2
pv </dev/sda2 | zstd -16 >/media/mint/Data/_Fsarchiver/MintV1.img.zst
zstdzcat /media/mint/Data/_Fsarchiver/MintV1.img.zst | pv >/dev/sda2Also see Syntax When Combining dd and pv
add a comment |
zstd
supports same commands and pipe capabilities as gzip
,
so if the set of commands works with gzip
, it will work with zstd
too.
You have added a few additional command flags to the zstd
side, and they look fine too.
Just to be on the pedantic side, for decompression, zstd -dvc
is enough and will work the same, since -f
and -T6
are not useful for this scenario (but they also don't hurt).
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f492773%2fcompressing-and-decompressing-dd-image-zstd-instead-of-gzip%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Using dd
like that (without any options) will make your life miserable. Just cut it out entirely. Or at the very least increase its block size and tell it not to object to short reads.
Without
dd
, first runsudo -s
to get a root shell:gzip </dev/sda2 >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gunzip </media/mint/Data/_Fsarchiver/MintV1.img.gz >/dev/sda2Your
zstd
commands look entirely plausible, but just omitdd
and read/write the device directly as root. (My version doesn't understand yourT6
so I've omitted that here.)zstd -16v </dev/sda2 >/media/mint/Data/_Fsarchiver/MintV1.zst
zstdcat -v /media/mint/Data/_Fsarchiver/MintV1.zst >/dev/sda2With
dd
, either prefix thedd
withsudo
or usesudo -s
to get a root shell:dd bs=1M iflag=fullblock if=/dev/sda2 status=progress | gzip >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gzcat /media/mint/Data/_Fsarchiver/MintV1.img.gz | dd bs=1M iflag=fullblock of=/dev/sda2 status=progress
dd bs=1M iflag=fullblock if=/dev/sda2 status=progress | zstd -16v >/media/mint/Data/_Fsarchiver/MintV1.img.zst
zstdcat /media/mint/Data/_Fsarchiver/MintV1.img.zst | dd bs=1M iflag=fullblock of=/dev/sda2 status=progressWith
pv
instead ofdd
. Either usesudo pv
orsudo -s
beforehand to get a root shell:pv </dev/sda2 | gzip >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gzcat /media/mint/Data/_Fsarchiver/MintV1.img.gz | pv >/dev/sda2
pv </dev/sda2 | zstd -16 >/media/mint/Data/_Fsarchiver/MintV1.img.zst
zstdzcat /media/mint/Data/_Fsarchiver/MintV1.img.zst | pv >/dev/sda2Also see Syntax When Combining dd and pv
add a comment |
Using dd
like that (without any options) will make your life miserable. Just cut it out entirely. Or at the very least increase its block size and tell it not to object to short reads.
Without
dd
, first runsudo -s
to get a root shell:gzip </dev/sda2 >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gunzip </media/mint/Data/_Fsarchiver/MintV1.img.gz >/dev/sda2Your
zstd
commands look entirely plausible, but just omitdd
and read/write the device directly as root. (My version doesn't understand yourT6
so I've omitted that here.)zstd -16v </dev/sda2 >/media/mint/Data/_Fsarchiver/MintV1.zst
zstdcat -v /media/mint/Data/_Fsarchiver/MintV1.zst >/dev/sda2With
dd
, either prefix thedd
withsudo
or usesudo -s
to get a root shell:dd bs=1M iflag=fullblock if=/dev/sda2 status=progress | gzip >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gzcat /media/mint/Data/_Fsarchiver/MintV1.img.gz | dd bs=1M iflag=fullblock of=/dev/sda2 status=progress
dd bs=1M iflag=fullblock if=/dev/sda2 status=progress | zstd -16v >/media/mint/Data/_Fsarchiver/MintV1.img.zst
zstdcat /media/mint/Data/_Fsarchiver/MintV1.img.zst | dd bs=1M iflag=fullblock of=/dev/sda2 status=progressWith
pv
instead ofdd
. Either usesudo pv
orsudo -s
beforehand to get a root shell:pv </dev/sda2 | gzip >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gzcat /media/mint/Data/_Fsarchiver/MintV1.img.gz | pv >/dev/sda2
pv </dev/sda2 | zstd -16 >/media/mint/Data/_Fsarchiver/MintV1.img.zst
zstdzcat /media/mint/Data/_Fsarchiver/MintV1.img.zst | pv >/dev/sda2Also see Syntax When Combining dd and pv
add a comment |
Using dd
like that (without any options) will make your life miserable. Just cut it out entirely. Or at the very least increase its block size and tell it not to object to short reads.
Without
dd
, first runsudo -s
to get a root shell:gzip </dev/sda2 >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gunzip </media/mint/Data/_Fsarchiver/MintV1.img.gz >/dev/sda2Your
zstd
commands look entirely plausible, but just omitdd
and read/write the device directly as root. (My version doesn't understand yourT6
so I've omitted that here.)zstd -16v </dev/sda2 >/media/mint/Data/_Fsarchiver/MintV1.zst
zstdcat -v /media/mint/Data/_Fsarchiver/MintV1.zst >/dev/sda2With
dd
, either prefix thedd
withsudo
or usesudo -s
to get a root shell:dd bs=1M iflag=fullblock if=/dev/sda2 status=progress | gzip >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gzcat /media/mint/Data/_Fsarchiver/MintV1.img.gz | dd bs=1M iflag=fullblock of=/dev/sda2 status=progress
dd bs=1M iflag=fullblock if=/dev/sda2 status=progress | zstd -16v >/media/mint/Data/_Fsarchiver/MintV1.img.zst
zstdcat /media/mint/Data/_Fsarchiver/MintV1.img.zst | dd bs=1M iflag=fullblock of=/dev/sda2 status=progressWith
pv
instead ofdd
. Either usesudo pv
orsudo -s
beforehand to get a root shell:pv </dev/sda2 | gzip >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gzcat /media/mint/Data/_Fsarchiver/MintV1.img.gz | pv >/dev/sda2
pv </dev/sda2 | zstd -16 >/media/mint/Data/_Fsarchiver/MintV1.img.zst
zstdzcat /media/mint/Data/_Fsarchiver/MintV1.img.zst | pv >/dev/sda2Also see Syntax When Combining dd and pv
Using dd
like that (without any options) will make your life miserable. Just cut it out entirely. Or at the very least increase its block size and tell it not to object to short reads.
Without
dd
, first runsudo -s
to get a root shell:gzip </dev/sda2 >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gunzip </media/mint/Data/_Fsarchiver/MintV1.img.gz >/dev/sda2Your
zstd
commands look entirely plausible, but just omitdd
and read/write the device directly as root. (My version doesn't understand yourT6
so I've omitted that here.)zstd -16v </dev/sda2 >/media/mint/Data/_Fsarchiver/MintV1.zst
zstdcat -v /media/mint/Data/_Fsarchiver/MintV1.zst >/dev/sda2With
dd
, either prefix thedd
withsudo
or usesudo -s
to get a root shell:dd bs=1M iflag=fullblock if=/dev/sda2 status=progress | gzip >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gzcat /media/mint/Data/_Fsarchiver/MintV1.img.gz | dd bs=1M iflag=fullblock of=/dev/sda2 status=progress
dd bs=1M iflag=fullblock if=/dev/sda2 status=progress | zstd -16v >/media/mint/Data/_Fsarchiver/MintV1.img.zst
zstdcat /media/mint/Data/_Fsarchiver/MintV1.img.zst | dd bs=1M iflag=fullblock of=/dev/sda2 status=progressWith
pv
instead ofdd
. Either usesudo pv
orsudo -s
beforehand to get a root shell:pv </dev/sda2 | gzip >/media/mint/Data/_Fsarchiver/MintV1.img.gz
gzcat /media/mint/Data/_Fsarchiver/MintV1.img.gz | pv >/dev/sda2
pv </dev/sda2 | zstd -16 >/media/mint/Data/_Fsarchiver/MintV1.img.zst
zstdzcat /media/mint/Data/_Fsarchiver/MintV1.img.zst | pv >/dev/sda2Also see Syntax When Combining dd and pv
edited Jan 7 at 18:30
answered Jan 6 at 9:09
roaimaroaima
43.4k553116
43.4k553116
add a comment |
add a comment |
zstd
supports same commands and pipe capabilities as gzip
,
so if the set of commands works with gzip
, it will work with zstd
too.
You have added a few additional command flags to the zstd
side, and they look fine too.
Just to be on the pedantic side, for decompression, zstd -dvc
is enough and will work the same, since -f
and -T6
are not useful for this scenario (but they also don't hurt).
add a comment |
zstd
supports same commands and pipe capabilities as gzip
,
so if the set of commands works with gzip
, it will work with zstd
too.
You have added a few additional command flags to the zstd
side, and they look fine too.
Just to be on the pedantic side, for decompression, zstd -dvc
is enough and will work the same, since -f
and -T6
are not useful for this scenario (but they also don't hurt).
add a comment |
zstd
supports same commands and pipe capabilities as gzip
,
so if the set of commands works with gzip
, it will work with zstd
too.
You have added a few additional command flags to the zstd
side, and they look fine too.
Just to be on the pedantic side, for decompression, zstd -dvc
is enough and will work the same, since -f
and -T6
are not useful for this scenario (but they also don't hurt).
zstd
supports same commands and pipe capabilities as gzip
,
so if the set of commands works with gzip
, it will work with zstd
too.
You have added a few additional command flags to the zstd
side, and they look fine too.
Just to be on the pedantic side, for decompression, zstd -dvc
is enough and will work the same, since -f
and -T6
are not useful for this scenario (but they also don't hurt).
answered Jan 6 at 15:46
CyanCyan
1363
1363
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f492773%2fcompressing-and-decompressing-dd-image-zstd-instead-of-gzip%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown