How to compress a directory while running dolphin as administrator?

In dolphin normally if you right-click a directory you can see option “Compress” in context menu. I want to compress some folder, but unfortunately it has some files owned by root. So I am trying to run dolphin in administrator mode, but when I do it option “Compress” disappears from context menu. How do I compress as a root?

P. S: Of course I can compress my directory from the command line, but the problem is command tar -cvjSf mydirectory.tar.bz2 mydirectory produces different archive file than action “Compress → Compress To → bzip2”.

For experiment I tried to run tar -cvjSf directoryWithoutRootOwnedFiles.tar.bz2 directoryWithoutRootOwnedFiles, then compress directoryWithoutRootOwnedFiles with context menu action and archive hashes are different. How do I find out what command dolphin uses to compress folders?

Avoid that. It is meant to run as root.

You can probably use ark to create an archive and add this file to it.

Or you can use the command-line

This isn’t using command line: app/compressfileitemaction.cpp · master · Utilities / Ark · GitLab

This might a compression level difference. And bz2 isn’t provided by dolphin in this menu. It could a plugin you have installed.

The important part, is: Is the compressed content identical ?