WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Concepts  (Read 2972 times)

Offline gregg_a_g

  • Newbie
  • *
  • Posts: 28
Concepts
« on: July 30, 2011, 12:52:20 PM »
TC looks great!  I have a tiny nettop that I built and want to use as a server for a small network.  I have been able to install TC 3.7 and get it working with NFS so far.  Very nice.  I will next get Sane and CUPS working to serve printer/scanner.  I have looked over some of the "architecture diagrams" for the boot process, etc. but am still a little confused.

If I use boot code " opt=hda1 home=hda1" this means that "mydata.tgz" save a compressed
copy of /opt and /home at shutdown.  At the next boot "mydata.tgz" gets uncompressed and populates /opt and /home. 

Why do /opt and /home get compressed to "mydata.tgz" and then uncompressed? 
Since they are on the hard drive couldn't they just remain as they are and save
the time of "compressing and uncompressing"?

Let's say I have 100 images from a digital camera and I "store" them in /home/mypictures.  Won't it take a long time to shutdown (while the system compresses the mydata.tgz file) and then a long time to boot (while the system uncompresses the mydata.tgz file)?  Am I missing something? 

Sorry for my ignorance, but thanks for the great distro! :)

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Concepts
« Reply #1 on: July 30, 2011, 01:39:52 PM »
The normal mode of operation does not include booting with boot code " opt=hda1 home=hda1" so, typically /home and /opt are in RAM and really do need to be backed up before any reboot.

You can exclude certain files and directories from the backup by listing them in /opt/.xfiletool.lst.

What are the specs of your nettop?  RAM?  Storage?  Speed?  How often do you shutdown or reboot?  How big is your backup - and does it have to be that big?  How long does backup and/or restore take and how long can you tolerate?   Should you really be using persistent /home and /opt?


Edit: added third paragraph.  2011/07/30 13:45
« Last Edit: July 30, 2011, 01:48:43 PM by Lee »
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11705
Re: Concepts
« Reply #2 on: July 30, 2011, 01:44:50 PM »
Hi gregg_a_g
You've got the basic idea. By using the boot codes   opt=hda1 home=hda1   those directories will
be persistent. The file   /opt/.filetool.lst   lists what should be backed up. Open the file and remove
all references to   home   and   opt   and they will not be backed up anymore.

Offline gregg_a_g

  • Newbie
  • *
  • Posts: 28
Re: Concepts
« Reply #3 on: July 30, 2011, 04:15:30 PM »
Ah, thanks for the clarification Rich.   So what gets "backed up" to "mydata.tgz" if I use the bootcodes "opt=hda home=hda"?  One post I read showed how to edit "bootlocal.sh" and point it to "eth1.sh" in which you then put in the proper "ifconfig" and "nameserver" stuff (in my case a static address and nameserver pointing to the right dns).   I would have thought I could simply edit "/etc.resolv.conf", but i guess the "/etc" directory is not persistent.  I'll keep reading the forums and the other TinyCore documents, but thanks very much for your help and quick reply!

Lee, thanks for your questions.  After reading through more of the available material I better understand the "concepts" for TinyCore.

The little box I put together is:
ECS PMI8M motherboard (Intel Celeron 600MHz)
512 MB DDR RAM
2GB Type II Compact Flash (on IDE)
Dual 10/100 onboard NIC
USB WifFi
Morex 3677 mini-ITX case with slim CD and built in DC-DC Power Supply.

I still don't quite understand everything about "backup/restore" but I think I will generally have most
"data files" in a location on a "persistent" /home or /opt such that there won't be much to "backup" except some "settings".

Thanks again for your help!
 :)

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Concepts
« Reply #4 on: July 30, 2011, 07:07:59 PM »
These bootcodes have nothing to do with backup. Persistent means these folders always stay at their own place in the specified partition. Backup on the other hand copies everything included in filetool.lst into mydata.tgz. You normally want to use only one of these two methods to keep /opt and /home.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Concepts
« Reply #5 on: July 30, 2011, 09:28:38 PM »
Hmmm, I've always seen the (default) backup mechanism and persistent '/home' and / or '/opt' as slightly competing concepts, but there are also situations where both concepts will be required together:

(1) The (default) backup concept operates via creating a gzip-ed tar-archive (i.e. 'mydata.tgz') at shutdown time whose content is controlled via a "white-list" (i.e. '/opt/.filetool.lst') and a "black-list" (i.e. '/opt/.xfiletool.lst'). This way most system-wide config files from '/opt' plus the '/home' directory minus some (e.g. typically browser-related "nuicance") files and directories are captured and can be restored at the next reboot. Additional files and directories can be added and removed by changing the two controlling files.

(2) If a lot of files (or some rather large ones) are to be backed up this process can be rather time consuming, hence the persistent '/home' (and / or '/opt') is offering an alternative concept. When using it is vital to ensure that the files and directories that are covered by this alternative persistence method are excluded from the backup (through an adjustment of the two '*.lst' files). As otherwise files of the persistent directory could be overwritten by copies extracted from the backup. A "global" method to avoid any restoration from backup would be to include the 'norestore' in the boot loader configuration.

(3) There are situations where both concepts will need to be used in conjuction with each other: Assuming that both persistent '/home' and '/opt' are in use and some files from '/etc' (e.g. '/etc/passwd' etc.) are required to be persistent. This can typically only be achieved via including them in the "while-list' (plus removing any '/home' and '/opt' entries from the same). There are alternatives to this method (e.g. well crafted commands in '/opt/boot*.sh' or creating a private extension that resultes in the desired amendments) but these alternatives are probably more suitable to those users who really have a complete grasp of all the finer details of how TC (and / or MC) operates.