/usr/local/* Persistent? Physical location?


Recommended Posts

i noticed some plugins such as transmission use /usr/local/ directory. why not use /mnt/cache/? whats the benefits? is it persistent(survive/remains after boot)? where is the actual location?

 

thanks.

 

this is because not everyone have a cache drive set up. also the free license doesnt let you use a cache drive.

 

a lot of plugin developers want the "out of the box" working plug in. what i mean by that is developers want the user to be able to go up and running without doing much settings.

making /mnt/cache/ by default will cause some error if the user doesn't have a cache drive and that will require a user to do an extra step for the user to go through.

 

by putting it under /usr/local/, there is a disadvantage that it is not persistent (does not survive after reboot), but it's better than using /boot/ (actual flash drive) in a way that it doesn't reduce the life time of the flash boot drive. flash drives were never meant for a lot of read/writes, so if there are lots of read/write, it reduces the life time of the flash drive.

 

also,

Link to comment

As for the actual location, anything not in /mnt or /boot is in RAM. This is why /usr/local for example will not survive a reboot.

 

Everything not /mnt or /boot is unpacked from bzroot when unRAID boots. This includes all of the usual Linux OS folders. You can actually examine the archive in bzroot from Windows by using 7zip, for example.

 

Link to comment

In fact, I personally have all my programs installed to /usr/local, however, the data directories set to /mnt/user/{cacheOnlyShare}.

 

No idea why, I just prefer knowing that any updates on the webdownloads will be applied the second I restart and be forced to be applied.

Link to comment

In fact, I personally have all my programs installed to /usr/local, however, the data directories set to /mnt/user/{cacheOnlyShare}.

 

No idea why, I just prefer knowing that any updates on the webdownloads will be applied the second I restart and be forced to be applied.

 

so the best practice is to install to /usr/local and set data dir to /mnt/user/{cacheOnlyShare}. what exactly is {cacheOnlyShare} by the way? care to give example? thanks.

Link to comment

What I used to do was rsync specific directories on boot up to the ramfs

On shutdown (or just before) I would rsync these directories back to persistent storage.

I.E.

 

rsync -a /boot/custom/etc /etc  #startup

rsync -a (a specific list of files) /boot/custom/etc  # shutdown.

 

Not the best way, but it worked for me.

 

you can also do a mount -o bind to mount a ram mount point to a persistent storage directory.

 

Granted you would have to rsync /usr/local to the persistent storage first.

Then do a mount -o bind the other way.

 

example (not saying this will work with the exact syntax).

 

rsync -a /usr/local /mnt/disk1/local

mount -o bind /mnt/disk1/local /usr/local

 

This insures that anything on the ramdisk is first copied to persistent storage in case of updates.

 

I use to do this with my /home folder.

 

rsync -a /home /mnt/cache/.home

mount -o  bind /mnt/cache/.home /home

 

A few years ago I did experiments with UNIONFS and AUFS. It was pretty cool.

 

You could mount a loop back filesystem to a ramdisk mount point (tmpfs, not ramfs) and any writes would be persistant to the loop'ed back filesystem.

 

Similiar to how Knoppix worked.

 

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.