One of the problems I've encountered often with filetool.sh
is the need
to run a backup every time a file is modified. This is a pain for files such as /etc/shadow
, or log files in /var/log/
I've created an alternative called symlinktool.sh
which copies the files to a persistent disk, and then creates symlinks to those files in place of the originals. On boot, rather than overwriting the files in memory from mydata.tgz, it replaces them with symlinks to the original files on persistent disk.
ls -lah /etc/shadow
lrwxrwxrwx 1 root root 37 Nov 11 08:30 /etc/shadow -> /mnt/sda1/mydata/etc/shadow
You can find the script and more detailed explanation here: https://github.com/aw/tinycore-symlinktool
Of course, it requires your disk to always be mounted (bad for piCore), but this means you're now free to modify files and they will automatically be saved to persistent disk, meanwhile maintaining the awesomeness of TinyCore Linux's architecture.Just a note:
Yes I did consider doing this with symlinks stored in /home/tc/, and then adding /home/tc to filetool.lst.. the problem is I don't want system files and other "root only" sensitive files to be in /home/tc.
This solution stores the files in /mnt/sda1/mydata (assuming restore=sda1 mydata=mydata).
Let me know what you think.