WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Mount + Scatter Hybrid ("Matter?")  (Read 366 times)

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Mount + Scatter Hybrid ("Matter?")
« on: September 10, 2024, 04:23:35 PM »
Hello everyone!

I haven't even started experimenting as I thought someone may have already done what has come across the table, so here's the dilemma:

We have a mount based install on a HDD.  We create opt=UUID=something as a boot code.

For the longest time, I've created /opt/.root to be a "persistent" scatter-ish directory where bootsync.sh does its own copy from /opt/.root/* to / which overwrites links from base and tcloop with our persisted files without issue.  (Other than there not being detection for modules, libraries, etc.)

I was just writing up a document taking notes on different pros and cons of cloud|mount|copy2fs|scatter methodology and this "hybrid" method is being considered as a fifth.

We already have the option to persist /tce /opt and /home (and there's some notation of local= in there somewhere but I haven't hunted that down yet) so what I was thinking is a "grouped" effort of /opt and /home along with a skeleton of / so that files which exist in BASE or in a TCZ that are altered (such as passwd or /usr/local/etc/init.d/dropbear just for examples) but at a certain level, copying files from storage into the ram based file system is going to cause unnecessary lag when there's a good number of files OR larger files (such as databases and the likes) SO I'm considering...  I dunno what to call it yet.

Scenario:
We're going to pretend storage is /dev/sda1, *active *ext4
We're going to use hybrid=UUID=123456:7890... as our boot code

We'll call this new location in storage (/dev/sda1)/hybrid for the time being and in theory, let's say it occupies 10+GB in persisted or altered content which would make copy2fs impossible for lower RAM machines - or be cause for a vacation!  Glass half-full!

/opt and /home are skipped since hybrid can act for both without the extra mounts and extra directories in storage and hybrid functionality would be updated to create copies of opt, home, local, and so forth as needed.  OR, we can keep using opt= and home= and bind-mount empty directories in /hybrid/opt and /hybrid/home, though that spends a little extra RAM in the process.

Originally I was thinking maybe chroot /mnt/hybrid would be the best way to go and bring everything over from base and tcloop as links.  No real fuss that I could imagine at the time; there probably is, though.  Any opinions?

Afterward, I thought maybe treating /hybrid like a squash file could be the answer (link all files into the root file system?)  Requires a way to hook monitor directory creation, though, so that /mnt/hybrid was updated when new directories (or links TO directories) were created elsewhere in the file system so that file managers could do their job when traversing the directory tree.

What I've been doing all this time is creating directories in /opt to serve as database storage (/opt/etc/mysql/data) and .root as a copy2fs-like storage (which could be done through filetool.sh, I know, but I'm senile when I'm in a rush and remembering to MAKE the backup before rebooting to test something...  sometimes doesn't end well! :)  Wait...  I'm senile all the time these days.)  The problem with .root is everything is manually done.  Update a password?  Copy /etc/passwd to /opt/.root/etc/.  Need to update the content of /usr/local/etc/dnsmasq/*?  CAT the contents of each file into /opt/.root/usr/local/etc/dnsmasq which doesn't exist yet.  It WORKS...  just not as well as it could.

Challenges:
  • Let's say you wanted to alter a file linked from BASE (cpio) such as /etc/shadow...  once done, you then need to update /opt/.filelist and run a backup.  That's IF you're using backups.  If you're not...  <dialtone>
  • Or from a TCZ (such as an init file, php.ini, things that often GET updated - which are otherwise read-only) you still need to manually create a copy to somewhere else, do your updates, copy it over the link, update /opt/.filelist and run backup to preserve the changes.  Not really end-user friendly and sometimes more effort than it should be.
  • In some cases, extensions are modified to utilize /home which in the end only works in a single-user environment with sudoer PASS:ALL:[EMPTY] and with home=somewhere boot code (that I can fathom, at least.)

Brain storming requested!  Any ideas, even "way out there" are welcome and entertained!!!  (Circus music playing... juggling SATA drives taped to the end of sticks...  lit on fire...  tape melts, drive crashes through window...!)

Thanks in Advance and Take care!


anyone who says "cloud" --- I say "rain" --- can't control either of them if they're not yours in the first place!
"electric cars" --- I say "still burning coal, plutonium, etc. to charge them and explosive batteries?  Run, Forest, Run!"

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Mount + Scatter Hybrid ("Matter?")
« Reply #1 on: September 11, 2024, 02:23:21 AM »
If you have some large data, say your 10gb database, wouldn't you just create a symlink "/db -> /mnt/sdb4/blah" and add /db to your backup?
The only barriers that can stop you are the ones you create yourself.

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Re: Mount + Scatter Hybrid ("Matter?")
« Reply #2 on: September 11, 2024, 04:46:47 AM »
If you have some large data, say your 10gb database, wouldn't you just create a symlink "/db -> /mnt/sdb4/blah" and add /db to your backup?
@curaga: Your response would make me assume filetool.sh/backup doesn't ever follow links.  If that's the case 100% of the time, yes, it works in that scenario.

Quote
...which could be done through filetool.sh, I know, but I'm senile when I'm in a rush and remembering to MAKE the backup before rebooting to test something...  sometimes doesn't end well!
I rarely use a desktop, so shutdown.sh rarely ever gets launched and there's no automated backup triggered otherwise that I'm aware of.
Yes, I could edit rc.shutdown to incorporate an automatic backup and fix permissions when su calls backup as root - then add THAT itself into the backup (LOL - and run the backup again for after reboot gets called the first time!)  Then, build a cpio and distribute the remastered core to dozens of other headless hardware devices...  there's got to be a cleaner and leaner method to manage and organize an already hybrid filesystem (ramfs, squash, copy2fs, etc.) but allow us to tweak it to make it better.

People with a ton of X extensions are a good example...  most of the content of these extensions never change in userland and should be able to be flagged as read-only BUT should be extracted somewhere to take a huge load off startup and RAM usage and then SKIPPED in onboot if the extension files already exist extracted.  (Just a thought)

Thanks for the feedback!



Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11617
Re: Mount + Scatter Hybrid ("Matter?")
« Reply #3 on: September 11, 2024, 08:32:57 AM »
Hi CentralWare
@curaga: Your response would make me assume filetool.sh/backup doesn't ever follow links. ...
Backup backs up the link itself but does not follow it.