WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: 4.2 deletes persistent home folder on shutdown  (Read 3813 times)

Offline webb

  • Jr. Member
  • **
  • Posts: 52
4.2 deletes persistent home folder on shutdown
« on: April 11, 2012, 09:43:01 AM »
I stopped using the backup/restore feature in tinycore after I started up one day and found mydata,tgz (and thus my home dir) empty. I instead began using rsync to backup and restore (via bootsync.sh).

I grew tired of this, so I set up a persistent home directory. I rebooted to verify that files in /home/tc were saved. i added bootcode user=webb and moved /mnt/sda5/home/tc to /mnt/sda5/home/webb . Again, everything seemed fine on reboot, and I didn't notice any problem for some time.

However, I eventually powered down the machine, and after next boot, all files in /home/webb and of course /mnt/sda5/home/webb had been erased. I verified that none of the contents of my home directory were causing the problem by creating a test file in the now empty home directory. On reboot it was still there. On shutdown and boot it was gone. Also occurs with default bootsync.sh and bootlocal.sh.

-Only on shutdown and boot, not on reboot.
-Not dependent on contents of home directory.
-No evidence of hardware failure (fsck ok).
-Not caused by my bootlocal.sh or bootsync.sh.
-Problem occurs both for internal and pendrive installs of TC.
-Also occurs without user=webb bootcode; in this case, /home/webb is left alone and /home/tc is erased

bootcodes: swapfile norestore showapps noicons noutc tz=PST+8PDT,M3.2.0/2,M11.1.0/2 UUID="2e8522d3-66bc-460a-ba2b-b0b48f483d39" tce=UUID="2e8522d3-66bc-460a-ba2b-b0b48f483d39" opt=UUID="2e8522d3-66bc-460a-ba2b-b0b48f483d39" home=UUID="2e8522d3-66bc-460a-ba2b-b0b48f483d39" user=webb desktop=wmii

I could have done more testing but my primary concern was to bypass the problem and get back to work. Still love TC the best :)

Workaround:
  remove from extlinux.conf:
    home=...

  add to bootsync.sh
    rm -f /home/webb
    ln -s /mnt/sda5/opt/home/webb /home/webb

-Webb

PS: TC version is 4.2 I think, but maybe 4.3. Kernel is definitely 3.0.3-tinycore. Now using 4.4/3.0.21, been too busy to try to replicate the problem.
« Last Edit: April 11, 2012, 09:48:19 AM by webb »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: 4.2 deletes persistent home folder on shutdown
« Reply #1 on: April 11, 2012, 10:24:12 AM »
You need to follow the wiki instructions for persistent home.
http://wiki.tinycorelinux.net/wiki:persistent_home
Pay special attention to the backup section.

Offline webb

  • Jr. Member
  • **
  • Posts: 52
Re: 4.2 deletes persistent home folder on shutdown
« Reply #2 on: April 11, 2012, 07:06:46 PM »
Hello gerald_clark,

Thank you for your reply. Unfortunately, I am unable to determine in what way if any I violated the wiki guidelines:

wiki:backup says:
"If you do use backup, all references to the home and opt directories can be removed from /opt/.filetool.lst."

wiki:persistent_home says:
"If you use backup as well as persistent home and opt, edit /opt/.filetool.lst, delete all references to the home and opt directories (in the version I am using that is everything), then add a list of files and directories you want backed up to /opt/.filetool.lst."

I was not using a backup (i.e., I was using the norestore bootcode and had not used the TC backup tools for some time when the problem arose), so from these statements, I conclude that TC should not have erased my persistent home directory regardless of what's in .filetool.lst. Moreover, I doubt that erasing of persistent home directories based on whether the user chooses to reboot or power down (in both cases without making a TC backup) is an intentional feature of TC.

Do you hypothesize that erasing the contents of .filetool.lst on top of using norestore and home= bootcodes would have prevented the problem from occurring?

Best wishes,
Webb
« Last Edit: April 11, 2012, 07:18:43 PM by webb »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: 4.2 deletes persistent home folder on shutdown
« Reply #3 on: April 11, 2012, 07:52:00 PM »
What I am saying is that there is nothing in TC that will erase contents of your opt or home directories if they are on a drive and their entries have been removed from .filetool.lst and .xfiletool.lst.
If you have a backup that contains opt or home files, they will overwrite those on the hard drive.
If you are improperly backing up and restoring files in /opt and /home, then they will overwrite those on your hard drive.

Look at /opt/shutdown.sh.  Files listed in .xfiletool.lst are deleted during shutdown.

Offline webb

  • Jr. Member
  • **
  • Posts: 52
Re: 4.2 deletes persistent home folder on shutdown
« Reply #4 on: April 18, 2012, 03:44:49 PM »
Quote
If you have a backup that contains opt or home files, they will overwrite those on the hard drive.

Yes, I think this was what was happening.

More specifically, /mnt/sda5/home/webb was being overwritten by an empty mydata.tgz . Even though I was using the norestore bootcode. And only for powerdown-powerup, not for reboot. shutdown.sh could not have been the culprit, as: (a) my .xfiletool.lst was the default one, and (b) the problem also occurs with a "hard" shutdown (unplug) and startup, in which case shutdown.sh was never run.

Best,
Webb