Unrar in TrueNAS Scale

vii

Dabbler
Joined
Aug 17, 2023
Messages
13
Hello
Is there any software or relevant method to unrar files in TrueNAS Scale?

Currently, my approach is to unrar the file using my PC over the network. However, this method causes WinRAR to crash due to the large file size, which can exceed 250 GB divided into parts ,Additionally, most of the bandwidth is wasted on read and write operations.

  • CPU: i7 4770
  • Motherboard: ASUS Z87-PLUS
  • Storage: 2 x 1TB HDD Raid 1 Mirror + 2 x 1TB SSD Raid 1 Mirror
  • SSD 128GB x 2 OS
  • PCIe 10Gb Network card
 

asap2go

Patron
Joined
Jun 11, 2023
Messages
228
Make a VM/ Container with access to the path and let WinRar run within that. If you want to unzip files of that size on TrueNAS locally.
 
  • Like
Reactions: vii
Joined
Oct 22, 2019
Messages
3,641
TrueNAS Core includes 7z, which can be run from the host itself. (No need for a VM or Jail.) I don't see why SCALE wouldn't ship with the same multipurpose archive tool.

When logged into an SSH session, run this command:
Code:
7z | head -n 3

Do you see any version info? If so, it means you can use 7z to extract RAR files.


To test the archive's integrity (can take longer for large archives):
Code:
7z t myfile.rar


To list the archive's contents:
Code:
7z l myfile.rar


To extract the archive (and its folder structure if applicable) in your current directory:
Code:
7z x myfile.rar
 
Last edited:

vii

Dabbler
Joined
Aug 17, 2023
Messages
13
Make a VM/ Container with access to the path and let WinRar run within that. If you want to unzip files of that size on TrueNAS locally.
I did some research and found that "Webtop Image Docker" is available in TrueCharts, which gives me the ability to run virtual machines inside a Docker container. I will try it, and I hope it will be faster.
TrueNAS Core includes 7z, which can be run from the host itself. (No need for a VM or Jail.) I don't see why SCALE wouldn't ship with the same multipurpose archive tool.

When logged into an SSH session, run this command:
Code:
7z | head -n 3

Do you see any version info? If so, it means you can use 7z to extract RAR files.


To test the archive's integrity (can take longer for large archives):
Code:
7z t myfile.rar


To list the archive's contents:
Code:
7z l myfile.rar


To extract the archive (and its folder structure if applicable) in your current directory:
Code:
7z x myfile.rar
Yes, I used TrueNAS Core before, but I had a hard time working inside Jails and FreeBSD overall. On the other hand, Scale provides the ability to run Docker and apps more easily than TrueNAS Core.

However, what I could not understand is why TrueNAS Scale lacks some basic features like RAR or 7z, for example. I found a way to run APT and install apps, but it's a bad idea as it will break the system.
 
Joined
Oct 22, 2019
Messages
3,641
However, what I could not understand is why TrueNAS Scale lacks some basic features like RAR or 7z, for example.
SCALE lacks 7z? That's really odd. Why would they not include it for SCALE, but it ships with Core? :oops:

It's a universal "Swiss army knife" tool that can handle many archive formats. Archive files (zip, 7z, rar, etc) are common filetypes you'll likely save on a NAS.
 
Joined
Oct 22, 2019
Messages
3,641
@vii

Can you confirm that SCALE does not ship with 7z? Did the above command produce a "command not found" error?

If so, I (or you) can submit a ticket to request 7z ship with SCALE.

Having to rely on a VM or containerized App just to read, test, and extract common archive formats seems like overkill.
 
  • Like
Reactions: vii

vii

Dabbler
Joined
Aug 17, 2023
Messages
13
@vii

Can you confirm that SCALE does not ship with 7z? Did the above command produce a "command not found" error?

If so, I (or you) can submit a ticket to request 7z ship with SCALE.

Having to rely on a VM or containerized App just to read, test, and extract common archive formats seems like overkill.
1698682466789.png

1698682890799.png


Yeah, dealing with VMs takes a lot of resources and may slow down the system. I hope the 7z feature will be added very soon
 
Joined
Oct 22, 2019
Messages
3,641
Just to rule something out, can you try again with another "user"? (You tested it with "root" according to your screenshots.)
 
  • Like
Reactions: vii
Joined
Oct 22, 2019
Messages
3,641
Actually, try with 7zz, 7zr, and 7za

Also check if they exist under /usr/bin/:
Code:
ls -l /usr/bin | grep 7z
 
  • Like
Reactions: vii

vii

Dabbler
Joined
Aug 17, 2023
Messages
13
Just to rule something out, can you try again wit another "user"? (You tested it with "root" according to your screenshots.)
Actually, try with 7zz, 7zr, and 7za

Also check if they exist under /usr/bin/:
Code:
ls -l /usr/bin | grep 7z
1698685540209.png

1698685896070.png


I checked the 'Create Home Directory' option, but I don't know why when I reopen the menu, the checkbox shows as unchecked,
I have never used SSH to log in as a different user, but it seems there is no designated user or home location, so I cannot navigate.



1698685717716.png
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
1698686210108.png

7z exists on Cobia - at least it does on mine.
Wait a minute - doesn't multi-report (aka @joeschmuck) install 7z as part of its installation program - I seem to recall it does. I do have multi-report installed on both my Live TN NAS's. My test box running RC1 does not have multi-report and does not have 7z
 
Last edited:
Joined
Oct 22, 2019
Messages
3,641
Wait a minute - doesn't multi-report (aka @joeschmuck) install 7z as part of its installation program - I seem to recall it does.


Well what do you know...

Code:
########## SEE IF 7ZIP IS LOADED AND IF NOT, INSTALL IT ##########
# NOTE: We check for 7zip installed and if not install it.
check_7zip () {

if type "7z" &> /dev/null; then return; fi

# No 7zip is installed, lets go get it.
echo "Installing 7-Zip..."
wget https://www.7-zip.org/a/7z2201-linux-x64.tar.xz > /dev/null 2>&1    # Get 7-zip
tar xf 7z*-linux-x64.tar.xz 7zzs > /dev/null 2>&1    # Extract the executable file only
cp 7zzs /usr/local/bin                        # Copy to /bin
ln -s /usr/local/bin/7zzs /usr/local/bin/7z        # Symlink it to "7z"
echo "7-Zip Installed"

# Cleanup
if test -e "7z2201-linux-x64.tar.xz"; then rm "7z2201-linux-x64.tar.xz"; fi
if test -e "7zzs"; then rm "7zzs"; fi
    }



EDIT: More and more I'm starting to hate American English (or even English in general). "What do you know" is a common phrase that means "Check this out!", but it sounds like criticism, as in "What do you know?"
 
Last edited:
  • Love
Reactions: vii
Joined
Oct 22, 2019
Messages
3,641
Even still, 7z should be included by default with SCALE. (It already is with Core.)

File contents:
Code:
truenas% pkg info -l 7-zip
7-zip-21.07_2:
        /usr/local/bin/7z
        /usr/local/bin/7zz
        /usr/local/share/man/man1/7zz.1.gz

Software and package info:
Code:
truenas% pkg info 7-zip
7-zip-21.07_2
Name           : 7-zip
Version        : 21.07_2
Installed on   : Fri Jul 21 20:15:01 2023 EDT
Origin         : archivers/7-zip
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : archivers
Licenses       : LGPL21+, BSD3CLAUSE, UNRAR
Maintainer     : makc@FreeBSD.org
WWW            : https://www.7-zip.org/
Comment        : Console version of the 7-Zip file archiver
Options        :
        DOCS           : off
Shared Libs required:
        libsysinfo.so.0
Annotations    :
        FreeBSD_version: 1301000
        cpe            : cpe:2.3:a:7-zip:7-zip:21.07:::::freebsd13:x64:2
        repo_type      : binary
        repository     : local
Flat size      : 2.36MiB
Description    :
7-Zip is a file archiver with a high compression ratio in 7z format with LZMA
and LZMA2 compression. Supported formats:

* Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
* Unpacking only: AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS,
  IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF,
  UEFI, VDI, VHD, VMDK, WIM, XAR and Z

WWW: https://www.7-zip.org/
 
  • Like
Reactions: vii
Joined
Oct 22, 2019
Messages
3,641
I checked the 'Create Home Directory' option, but I don't know why when I reopen the menu, the checkbox shows as unchecked,
Because it cannot be /nonexistent
 

vii

Dabbler
Joined
Aug 17, 2023
Messages
13
Well what do you know...

Code:
########## SEE IF 7ZIP IS LOADED AND IF NOT, INSTALL IT ##########
# NOTE: We check for 7zip installed and if not install it.
check_7zip () {

if type "7z" &> /dev/null; then return; fi

# No 7zip is installed, lets go get it.
echo "Installing 7-Zip..."
wget https://www.7-zip.org/a/7z2201-linux-x64.tar.xz > /dev/null 2>&1    # Get 7-zip
tar xf 7z*-linux-x64.tar.xz 7zzs > /dev/null 2>&1    # Extract the executable file only
cp 7zzs /usr/local/bin                        # Copy to /bin
ln -s /usr/local/bin/7zzs /usr/local/bin/7z        # Symlink it to "7z"
echo "7-Zip Installed"



EDIT: More and more I'm starting to hate American English (or even English in general). "What do you know" is a common phrase that means "Check this out!", but it sounds like criticism, as in "What do you know?"
It finally works! Yeah, it was supposed to be enabled by default. I had a hard time installing Webtop and dealing with permissions to make it work faster. The hours of waiting turned into a few minutes.

I tested it out on RAR files and ZIP files, and it works fine and super fast.

Thanks to all of you! <3

1698689464747.png
 
Joined
Oct 22, 2019
Messages
3,641
I would immediately scan your entire NAS for corruption!!! There should be no reason for blood red splotches to corrupt the text on you terminal window!!!11 :oops:

When did that start happening?
 
  • Haha
Reactions: vii
Joined
Oct 22, 2019
Messages
3,641
On a serious note, I'm still going to file a ticket to include 7z by default with SCALE. There's no reason why it's not...
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
I do not understand the need for it both in CORE and SCALE... Why unzip an archive in the system itself? Why is there even an archive in the system itself, isn't it better to let ZFS compress the files?

Also, isn't there tar already?
Please tell me.
 

Saoshen

Dabbler
Joined
Oct 13, 2023
Messages
47
a) most likely not in the system, but in the various pools/datasets.
b) I believe this is in reference to compressed archives stored on shared folders.
c) compressing/decompressing locally on the 'system' uses the 'systems' resources, instead of trying to use the client cpu and network io to do the work.

basically, doing the work locally is potentially magnitudes faster, as the io is direct to disk (instead of via network) and generally more cpu power.

if one has a multi-gig (or whatever large arbitrary size) archive, unzipping over the network is relatively slow.
unzipping the file locally on the server, then remotely accessing those files from directly on the server, is much faster.

conversely, compressing hundreds or thousands of files in a shared folder, from a remote client, is slooow.
compressing the same files locally in the server, is much faster, then the client only has to copy the archive file out or whatever.
 
Last edited:
Top