You are not logged in.

#1 2013-05-10 22:24:47

EvanPurkhiser
Member
From: San Francisco
Registered: 2010-08-17
Posts: 225
Website

Is anyone using rewritefs successfully in their system?

Hey guys,

I've been trying to organize my configuration files in my $HOME (Trying to get them all into $XDG_CONFIG_HOME).

I've had a good bit of success using environment variables and aliases to change where some programs look for their configuration files and store cache files, however I'm down to a few programs that offer no way to change where they look for and store their configuration / data / cache.

I was curious if anyone had been successfully using the rewritefs utility for managing their configuration files?

It seems like it would be a nice way to have rules for keeping programs cache/log files in the .cache folder, keeping programs data files in .local/share and keeping their configuration files in .config. This also has the advantage over my previous method that I don't have to rely on aliases and environment variables being set.

But I also feel like adding an extra level of indirection could be confusing. Also, I'm not sure what kind of overhead there would be from doing pattern matching for ever file access.

Even if you're not using rewritefs I'm interested in hearing your opinion!

Offline

#2 2013-05-10 22:50:22

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,089
Website

Re: Is anyone using rewritefs successfully in their system?

I imagine what would be better suited for this task is something like libetc. It's out-dated, and no longer maintained (and sketchy, to be honest), but using a different filesystem for this seems overkill to me (might just be me).

All the best,

-HG

Offline

#3 2013-05-12 15:19:59

nil
Member
Registered: 2012-10-15
Posts: 33

Re: Is anyone using rewritefs successfully in their system?

I'm interesting in doing the same thing. libetc is written by the same person of rewritefs, and given the even more outdated nature of libetc, I'd rather place my trust on rewritefs. But from all results I can find related to this subject (most dating back to <2010), the solutions have seemed kind of...haphazard. I'm kind of surprised there's not many who would opt for such dotfile organization.

Offline

#4 2013-05-12 16:34:23

msthev
Member
Registered: 2012-04-05
Posts: 177

Re: Is anyone using rewritefs successfully in their system?

I am using it. I guess by the looks of it's popularity you can pretty safely say I have an extreme level of OCD wink
The solution is actually pretty elegant (libetc was haphazard on the other hand). I think it's the best thing one can do to clean up after programs with retar^Winelegant configuration management (see also: A lesson in shortcuts).

I store all my program configuration and data in ~/lib/ and all the cache/runtime files in ~/tmp/ (which is symlinked to $XDG_RUNTIME_DIR, so everything redirected there will be lost on logout, but also won't be saved to the disk at all).
My configs:

EvanPurkhiser wrote:

This also has the advantage over my previous method that I don't have to rely on aliases and environment variables being set.

Imo environmental variables are better for this task — they are meant for this, so using them is the proper thing in this situation.
Aliases are worse, since they work only when running from interactive shells.
Some programs have an option to specify config directory as an argument to the exec; that way one can write a script to call the program with modified config path (example). It's ugly, but it's better than nothing.
If you're running systemd --user, you can also use service files for this (example).

EvanPurkhiser wrote:

But I also feel like adding an extra level of indirection could be confusing. Also, I'm not sure what kind of overhead there would be from doing pattern matching for ever file access.

The overhead is there, it is inevitable. If you want to open a lot of files in a small period of time, you should try to go around rewritefs. I did it for Wine, i.e. my "drive D:" directory is /home/msthev/wine, but in winecfg I have set it to /mnt/home/msthev/wine (which is the original mount point).
Despite this, everything else is going through rewritefs and in my eye it's completely transparent in terms of performance. You may notice performance issues if you do compilations on your rewritten partition — I don't know it since I'm compiling everything in tmpfs.

Some facts/opinions:

  • I'm using it for almost a year now and I haven't had any crashes / lost files / etc.

  • You need to know Perl regexps well, otherwise your config file will look ugly (and the author says it can impact performance); but don't be discouraged, it took me a long time to learn all of this magic, but rewritefs was working well with just a little bit less elegant regexps

  • Lately I started to think about what can be removed from rewritefs (and e.g. put as a variable); imo it should be used only if there is no "normal" way of setting program's config directory

  • The end effect is beautiful as f^Hhell:
    $ ls -A
    bin  copy  files  go  lib  pkg  src  tmp  var  wine



Edit:
One more thing, this appears to be inaccurate:

nil wrote:

libetc is written by the same person of rewritefs

Quote from rewritefs' readme:

The short story: I needed a tool to manage my dotfiles. I forked Luc Dufrene's libetc [http://ordiluc.net/fs/libetc/] after it seemed unmaintained.

Last edited by msthev (2013-05-12 22:18:44)

Offline

#5 2018-08-16 00:07:00

Fincer
Member
Registered: 2014-05-18
Posts: 21

Re: Is anyone using rewritefs successfully in their system?

I apologize for raising up an old topic from the dust, but I encountered similar issue as the OP. Links in msthev's reply are dead (404), and only little information is available on how to set-up rewritefs from scratch. The procedure is quite simple, but you just need to know a few things.

I already posted my rewritefs instructions on Reddit. Feel free to use & correct.

Offline

Board footer

Powered by FluxBB