[Accepted] Add unrar / 7zip to Truenas Scale

I would be happy with 7zip as a default utility in Scale.

I know I can just drop it in a directory somewhere, add it to my PATH and use it. That’s what I did. It would be really nice if I didn’t have to do that.

My specific use case is qbittorrent allows you to run a command on every torrent once it’s finished. Because rars are so common, I set unrar to uncompress everything. 7zip would work perfectly fine for that too.

2 Likes

Just out of curiosity. What still ships in RAR these days? I haven’t needed to deal with that extension for years. It kinda’ ran out of favor once high speed broadband connections got ubiquitous. It was incredibly useful to distribute large files (like ISO’s) back in the days of 56k modems, but those days are long gone.

Not just RAR, but also 7z is still used. (Though RAR is not as ubiquitous as it once had been.)

But consider:

  • The 7z tool hands multiple formats, including 7z, Zip, and RAR.
  • The 7z tool can generate hashes.
  • It’s not just “new” or “downloaded” files. As archivists and NAS users, we have files from many moons ago in their original format (i.e, an untouched artifact.)
2 Likes

+1 from me. I regularly download large multi-part zip and rar files. I either have to extract them using a client PC via SMB (slow and inefficient) or keep a whole linux VM on the NAS just to run 7z/zip/unrar in, which again is super inefficient (although this is the solution I wound up using).

Just being able to ssh into the NAS and unarchive these files locally would be a much neater way of doing things.

1 Like

Big button top left to vote.

1 Like

Got it, but as lifetime votes are limited on this forum (something I’ve never understood, on any forum), I use them sparingly.

You can unvote too

And a Sandbox/Jail is super efficient for doing this

A jail with /mnt bound has full access to all your pools, and you can install any software you want in it. Even an ssh server.

Afterall, it’s really just fancy way of preventing installed software from conflicting with truenas, other than that, it’s almost as if it were installed into the base os.

3 Likes

Cheers, must admit I’ve not looked into jails (more used to VMs and docker). Is it a more advanced version of the old chroot jails we used to use before docker? I’ll read up on it.

Pretty much, in fact, that’s a good paraphrase of the first paragraph off the man page :wink:

systemd-nspawn may be used to run a command or OS in a light-weight namespace container. In many ways it is similar to chroot(1), but more powerful since it fully virtualizes the file system hierarchy, as well as the process tree, the various IPC subsystems and the host and domain name.

I have a video on the subject that’s worth watching :wink:

2 Likes

gift-card-giveaway


Can confirm. Just received my card today and used it to purchase a RAM upgrade.

2 Likes

Just wanted to follow up with a quick Thank You to @Stux for pointing me towards jails.

I’m not a big fan of video tutorials (nothing personal!) so I followed the howto on the github page, and it was surprisingly pain-free and quick. I’ve now got a multi-purpose debian jail with all the command line tools I need in it to manipulate large files directly on the NAS (mostly extracting archives and doing a little ffmpeg/mkvmerge work)

And it’s using less than a gig of disk space :smiley:

1 Like

Can jailmaker (or linux I guess) support “service jails”? Background: in FreeBSD you can create a single application jail. From a very quick read over that howto they look as though they are “thick jails” only, can ‘service’ types be created?

EDIT: This post was “flagged” and I do not know why.

ADDED:
If ‘service type jails’ are not supported, a feature request could be made to include “service type jails” to save more system resources.

I’m a fan of the first line of the Arch Wiki myself:
systemd-nspawn is like the chroot command, but it is a chroot on steroids.”

Absolutely agree that sandboxes are super useful for this sort of thing, unpackerr (or, more importantly, 7z so as to stay on topic) as an example can be installed super easily to interact with /mnt/tank/xyz bound.

1 Like

Explain to me how this question/post is off-topic. For example, my question has security implications so how can that be considered off topic?

Topic’s title is “Add unrar / 7zip to TrueNAS Scale”.

And what can come out of archives?! …Dasies?

If the sandboxes/‘chroot on steroids’ is a traditional “thick” jail (FreeBSD basis); I would probably go so far as to mount a temp fs but then I assume you’d have the problem of extracting the extracted data (sorry, I don’t know enough about Linux to offer up “useful” suggestions). Security in this case is/should be paramount (a firewall won’t do you any good).

None of the container / sandbox / jail stuff matters if SCALE includes the latest upstream 7zip utility by default.

This is a NAS system. 7zip is a Swiss army knife for archivists.

Yes, it’s a NAS. There is no reason why more archive tools besides the ones in base systems needs to be installed. A NAS should host and serve files not act as a desktop (a NAS sits there and does nothing). If you want extra functionality beyond sitting there, you need to jail it.

I’m no archivist but it seems to me a staging area or antechamber would be a better approach to data conservation.

Having a command-line tool, which handles the most common archive formats for storage and extraction, is not treating the NAS as a “desktop”.

Omitting 7zip is an odd battle for that extra couple MiB on the boot-pool.

We can already handle tarballs and compressed tarballs (e.g, ZSTD), but including the 7zip binary allows us to also handle additional formats, including 7z, RAR, and Zip, from a single command. (Not to mention its other uses.)