Both sides previous revisionPrevious revisionNext revision | Previous revision |
wiki:persistence_for_dummies [2012/03/09 12:25] – spelling BobBagwill | wiki:persistence_for_dummies [2013/09/28 03:48] (current) – georgp24 |
---|
When you boot Tinycorelinux (tcl) for the first time, such as from CD, the default mode of operation is "cloud mode", meaning all extensions are downloaded from the web for each session. (//Extensions can be apps such as a browser, or hardware drivers, modules, firmware or shared libraries. The extensions are compressed and packaged in files with .tcz extension.//) They are not permanently stored anywhere unless you specifically instruct tcl to do so. Same with settings changes you make - these are not permanently stored by default. | When you boot Tinycorelinux (tcl) for the first time, such as from CD, the default mode of operation is "cloud mode", meaning all extensions are downloaded from the web for each session. (//Extensions can be apps such as a browser, or hardware drivers, modules, firmware or shared libraries. The extensions are compressed and packaged in files with .tcz extension.//) They are not permanently stored anywhere unless you specifically instruct tcl to do so. Same with settings changes you make - these are not permanently stored by default. |
| |
One way of understanding tcl is it consists of just 2 files, one file containing all the Linux kernel stuff and the other the tcl-specific stuff. At each boot, these 2 files are unpacked and loaded into your PC's memory (RAM). So at each boot, it boils down to a fresh (lightning fast) install. Goodbye, system rot! | One way of understanding tcl is it consists of just 2 files, one file called vmlinuz containing all the Linux kernel stuff and the other the tcl-specific stuff, named core.gz. At each boot, these 2 files are unpacked and loaded into your PC's memory (RAM). So at each boot, it boils down to a fresh (lightning fast) install. Goodbye, system rot! |
| |
Likewise with extensions, these are each [[http://en.wikipedia.org/wiki/Loop_device|loop mounted]] into a temporary location (///tmp/tcloop//), and linked into the main Linux file system, at each boot. So //everything// is installed at every boot. No corruption, ever! Uninstalling apps is rendered completely obsolete - just delete the packed app file, (//xxx.tcz//), and goodbye! No more useless left-behind files cluttering up the OS, ever! Upgrading to newer versions becomes dead simple - replace the older tcz package with the newer one. This is truly a new, unique concept. | Likewise with extensions, these are each [[http://en.wikipedia.org/wiki/Loop_device|loop mounted]] into a temporary location (///tmp/tcloop//), and linked into the main Linux file system, at each boot. So //everything// is installed at every boot. No corruption, ever! Uninstalling apps is rendered completely obsolete - just delete the packed app file, (//xxx.tcz//), and goodbye! No more useless left-behind files cluttering up the OS, ever! Upgrading to newer versions becomes dead simple - replace the older tcz package with the newer one. This is truly a new, unique concept. |
=====Getting tinycore to save your documents and settings===== | =====Getting tinycore to save your documents and settings===== |
| |
Many settings, and all documents, are stored in your home directory called ''/home/tc'' (//also called ''~HOME''//), and ''/opt''. (//''~HOME'' is roughly equivalent to "''Documents and Settings\USER\My Documents''" in Windows.//) If you are not using persistence, by default, these directories are lost at shutdown, so you lose everything. Tiny Core is very flexible and there are several ways to save your documents and settings for a next session. | Many settings, and all documents, are stored in your home directory called ''/home/tc'' (//also called ''$HOME'' or "~" //), and ''/opt''. (//''$HOME'' is roughly equivalent to "''Documents and Settings\USER\My Documents''" in Windows.//) If you are not using persistence, by default, these directories are lost at shutdown, so you lose everything. Tiny Core is very flexible and there are several ways to save your documents and settings for a next session. |
| |
===By using the Backup Utility=== | ===By using the Backup Utility=== |
| |
The default mode of saving your docs and settings is via the backup utility, which comes up when you do a shutdown. This backup utility creates a file called by default ''mydata.tgz'' (//if it doesn't already exist//), which contains your entire ''~HOME'' directory contents, and the ''/opt'' directory, both compressed. The file ''mydata.tgz'' is stored in ''/tce''. So, once you start using the ''/tce'' directory, automatically all your stuff becomes persistent. | The default mode of saving your docs and settings is via the backup utility, which comes up when you do a shutdown. This backup utility creates a file called by default ''mydata.tgz'' (//if it doesn't already exist//), which contains your entire ''$HOME'' directory contents, and the ''/opt'' directory, both compressed. The file ''mydata.tgz'' is stored in ''/tce''. So, once you start using the ''/tce'' directory, automatically all your stuff becomes persistent. |
| |
When booting, tcl will first look for ''mydata.tgz'' in ''/tce'' and then scan partitions until found. If it is not found, an empty default will be created in ''/tce''. You can optionally specify a different location for the backup file with the boot code "''restore=xxx/any/storage/directory''", where xxx is a valid partition, and ''/any/storage/directory'' already exists. | When booting, tcl will first look for ''mydata.tgz'' in ''/tce'' and then scan partitions until found. If it is not found, an empty default will be created in ''/tce''. You can optionally specify a different location for the backup file with the boot code "''restore=xxx/any/storage/directory''", where xxx is a valid partition, and ''/any/storage/directory'' already exists. |
The list of stuff saved in ''mydata.tgz'' is found in a file called ''/opt/.filetool.lst'', while the exclusions are in ''/opt/.xfiletool.lst''. Excluded items take precedence over included ones, so you can include a whole directory and exclude some bulky items from it. | The list of stuff saved in ''mydata.tgz'' is found in a file called ''/opt/.filetool.lst'', while the exclusions are in ''/opt/.xfiletool.lst''. Excluded items take precedence over included ones, so you can include a whole directory and exclude some bulky items from it. |
| |
''~HOME'' can quickly become quite large, and the backup during shutdown and subsequent restore at the next boot can take some time. You can reduce backup times by carefully excluding stuff you don't require to be restored - look for large directories and files to put in the exclude list. There is a utility ''BigHomeFiles'' in the Control Panel to aid in this. There are already some default exclusions from the ''~HOME'' directory such as cache files, to prevent saving any unecessary stuff. | ''$HOME'' can quickly become quite large, and the backup during shutdown and subsequent restore at the next boot can take some time. You can reduce backup times by carefully excluding stuff you don't require to be restored - look for large directories and files to put in the exclude list. There is a utility ''BigHomeFiles'' in the Control Panel to aid in this. There are already some default exclusions from the ''$HOME'' directory such as cache files, to prevent saving any unecessary stuff. |
| |
There are further ways to optimize boot times; static files and directories in ''~HOME'' can be made into extensions - see the wiki for more information on [[wiki:extension_for_settings|creating extensions for settings]]. | There are further ways to optimize boot times; static files and directories in ''$HOME'' can be made into extensions - see the wiki for more information on [[wiki:extension_for_settings|creating extensions for settings]]. |
| |
===By specifying permanent directories for ~HOME and /opt=== | ===By specifying permanent directories for /home and /opt=== |
| |
Another way of saving your stuff, is to tell tcl to use permanent directories for ''/opt'' and ''~HOME'' located on a storage medium. This is also done via boot codes, viz "''opt=sda1''" and "''home=sda1''". These boot codes tell tcl not to create and restore ''~HOME'' and ''/opt'' at boot time from ''mydata.tgz'' as it would otherwise do, but rather to take these directories on the specified permanent storage medium and mount them into the linux file system instead. | Another way of saving your stuff, is to tell tcl to use permanent directories for ''/opt'' and ''/home'' located on a storage medium. This is also done via boot codes, with "''opt=sda1''" and "''home=sda1''". These boot codes tell tcl not to create and restore ''/home'' and ''/opt'' at boot time from ''mydata.tgz'' as it would otherwise do, but rather to take these directories on the specified permanent storage medium and mount them into the linux file system instead. |
| |
If they don't already exist in the specified locations, they will be freshly created there and populated with all the default files. The effect is that these two directories are now located on permanent storage, and anything you change and save there via the normal way is therefore saved immediately, permanently. Since they now exist on permanent storage, you no longer have to backup everything, so you can edit ''.filetool.lst'' and remove these entries from the list to prevent them from being backed up into mydata every time. | If they don't already exist in the specified locations, they will be freshly created there and populated with all the default files. The effect is that these two directories are now located on permanent storage, and anything you change and save there via the normal way is therefore saved immediately, permanently. Since they now exist on permanent storage, you no longer have to backup everything, so you can edit ''.filetool.lst'' and remove these entries from the list to prevent them from being backed up into mydata every time. |
| |
Since ''~HOME'' and ''/opt'' locations are specified individually, you can have them anywhere on your PC - another partition, another hard disk altogether, even a usb stick that you plug in for the session. So you can save all your personal stuff in one place, easily backed up, and when your boot disk crashes or something, you still have all your personal stuff safely somewhere else. You can safely reformat your boot partition should something terrible happen without losing your personal data. Compare this to having your Windows disk crash! | Since ''/home'' and ''/opt'' locations are specified individually, you can have them anywhere on your PC - another partition, another hard disk altogether, even a usb stick that you plug in for the session. So you can save all your personal stuff in one place, easily backed up, and when your boot disk crashes or something, you still have all your personal stuff safely somewhere else. You can safely reformat your boot partition should something terrible happen without losing your personal data. Compare this to having your Windows disk crash! |
| |
The limitation - if you can even call it that - is these directories cannot exist in partitions other than linux ones; Windows file systems do not support file permissions which are a crucial part of this to work. To operate tcl entirely from a FAT partition, for example, you are forced to use the backup system. The ''/tce'' and all its contents do not require file permission information, so can be stored on a FAT partition if required. | The limitation - if you can even call it that - is these directories cannot exist in partitions other than linux ones; Windows file systems do not support file permissions which are a crucial part of this to work. To operate tcl entirely from a FAT partition, for example, you are forced to use the backup system. The ''/tce'' and all its contents do not require file permission information, so can be stored on a FAT partition if required. |
* To make everything persistent, use the Set button in Appbrowser to set a location for /tce. If using the built-in installer, this is taken care of. | * To make everything persistent, use the Set button in Appbrowser to set a location for /tce. If using the built-in installer, this is taken care of. |
| |
* To create permanent ''~HOME'' and ''/opt'' directories and reduce backup and restore times, use the boot option "''home=xxx''" and optionally, "''opt=xxx''" where "xxx" are any valid linux partitions. Manually edit ''/opt/.filetool.lst'' to remove the home entry and most ''/opt'' entries. | * To create permanent ''/home'' and ''/opt'' directories and reduce backup and restore times, use the boot option "''home=xxx''" and optionally, "''opt=xxx''" where "xxx" are any valid linux partitions. Manually edit ''/opt/.filetool.lst'' to remove the home entry and most ''/opt'' entries. |
| |
======Advanced Topics====== | ======Advanced Topics====== |
For extensions which are very seldomly used, you can use the "''Download + load''" setting in AppBrowser which will download and load the app, but will not include it in either of the OnBoot or OnDemand lists. You can also load these ones later again by using the "''Local''" button in AppBrowser, which then looks in ''/tce'' for all your downloaded extensions. | For extensions which are very seldomly used, you can use the "''Download + load''" setting in AppBrowser which will download and load the app, but will not include it in either of the OnBoot or OnDemand lists. You can also load these ones later again by using the "''Local''" button in AppBrowser, which then looks in ''/tce'' for all your downloaded extensions. |
| |
You can play around with which extensions to load where in the AppsAudit utility. If you are unsure if a particular app is essential or not, just put it in ''OnBoot'' - you can change later. (//The ''OnBoot'' and ''OnDemand'' lists are also to be found in ''/tce''. They are maintained by AppsAudit.//) | You can play around with which extensions to load where in the AppsAudit utility. If you are unsure if a particular app is essential or not, just put it in ''OnBoot'' - you can change later. (//The ''OnBoot'' and ''OnDemand'' lists are also to be found in ''/tce''. They are maintained by AppsAudit.//) |
| |
| If you are running text mode only, and want to change an extension to ondemand, remove it from onboot.lst then run "ondemand appname". This will add a script to the ondemand directory (in your path) that will mount the tcz when you need them. To change it back to onboot, add it back to onboot.lst |