Install unrar to FreeNAS

Status
Not open for further replies.

FlyingPersian

Patron
Joined
Jan 27, 2014
Messages
237
Hi
I'm trying to install unrar to FreeNAS. I followed this guide to install it. I then get the error I you can see here. I did what the guy said and installed it into a jail called unrar. It worked perfectly fine and I can also unrar things, but only WITHIN the jail. In the blog though it says that with the command "alias unrar ‘/usr/local/bin/unrar’" I should be able to use the command from anywhere. So I ran it, but I still can't use unrar outside the jail.
So then I read here (german site, there are some quotes in english, which are important) that I cannot install it to FreeNAS because it's partition is not writeable. I could make it writeable, but that might mess stuff up. So the guy ran "mount -uw /" and he then could install rar.[/URL]

Now I don't know what mount -uw does and if it is a good idea. So my questions are
1. Should I do the mount thing to install it?
2. If not, how can I install unrar/rar/zip whatever to my FreeNAS?

I need it to extract many files and it takes a really long time doing it from Windows on my NAS.
 

Durandal

Explorer
Joined
Nov 18, 2013
Messages
54
I'm not an FreeBSD expert, but why would you installar unrar to a jail? Why not just install it to the FreeBSD-system directly?
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
NOnononononononono.

If you've installed it in the jail, you *HAVE* installed it on the FreeNAS. Your jail directories ARE ACCESSIBLE from the FreeNAS side. Say, your jail root is /mnt/jails, and your jail is jail1. Then, you will find your unrar program, ***FROM THE FREENAS CLI***, here:

/mnt/jails/jail1/usr/local/bin/unrar

(or possibly sbin for bin).

Then, alias that long thing in the FreeNAS side, and you can access it and use it normally. No problem.

Now, you'll lose that "alias" as soon as you stop your session, so if you want to make the alias auto-loading, you'll have to make a persistent change to the FreeNAS partition (which involves mounting things for writing and stuff), but: you should be able to easily use your unrar software from the FreeNAS side, it's just a matter of doing the fully delimited jail directory prefix, as I've shown above (I've probably messed a bit of that up, but you should see exactly how that works).

You see, you can't access files not in the jail from the jail side (that's why it's called a "jail", actually), but you can easily access the files inside the jail from the non-jail side, as long as you descend into the proper directory.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
NNow, you'll lose that "alias" as soon as you stop your session, so if you want to make the alias auto-loading, you'll have to make a persistent change to the FreeNAS partition (which involves mounting things for writing and stuff)
This is only true when you want to make the alias persistent for root (as his home directory is on the read-only USB stick). You can easily make it persistent for any non root user.
 

Durandal

Explorer
Joined
Nov 18, 2013
Messages
54
You see, you can't access files not in the jail from the jail side (that's why it's called a "jail", actually), but you can easily access the files inside the jail from the non-jail side, as long as you descend into the proper directory.


Thank you for making it more clear to me! This will certainly be good information to have since i'm thinking of setting up Transmission with an auto-unrar script.

(Sorry for the OT!)
 

FlyingPersian

Patron
Joined
Jan 27, 2014
Messages
237
Okay so what I found out myself is that I can add the folders containing the rar to the unrar jail storage, then to into the jail with jexec # tcsh and unrar them there. They'll then also show up in the source directory. Of course it'd be much better if I could just skip the add storage stuff and unrar them directly.

@DrKK: I browsed into mnt/Data/jails/unrar/usr/local/bin and I can see the unrar file. But when I do the alias command this is what I get:

Code:
freenas# alias unrar ./mnt/Data/jails/unrar/usr/local/bin/unrar.
alias: unrar: not found
alias: ./mnt/Data/jails/unrar/usr/local/bin/unrar.: not found


What am I doing wrong?
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
That initial dot.

start with /mnt/Data/jails.......

also do not end with the dot.

no dots.
 

FlyingPersian

Patron
Joined
Jan 27, 2014
Messages
237
Code:
alias: unrar: not found
alias: /mnt/Data/jails/unrar/usr/local/bin/: not found
freenas#


:/


edit:

Code:
alias unrar="/mnt/Data/jails/unrar/usr/local/bin/unrar"


This is it :)
Now, how can I make this a permanent alias command? So that when I start a new session it stays?

edit2: I've found out here that for root I have to put the alias into the /root/.bashrc file. Unfortunately it is not writeable, thus upon saving I get the error "Unable to create file .bashrc". So how do I do this writeable thing? Does it possibly do any damage to my system?
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
you will find the answers to that elsewhere in the forum sir. Personally, if I were you, just typing in the alias command when you need it might be easiest.
 
Status
Not open for further replies.
Top