WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: tc persistent .profile  (Read 10248 times)

Offline sblass92

  • Newbie
  • *
  • Posts: 15
Re: tc persistent .profile
« Reply #15 on: October 24, 2012, 03:41:15 PM »
Code: [Select]
tc@box:~$ ls -l /etc/sysconfig/tcedir
lrwxrwxrwx    1 root    root        13 Oct 25 02:38 /etc/sysconfig/tcedir -> /mnt/sda1/tce/

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: tc persistent .profile
« Reply #16 on: October 24, 2012, 04:17:04 PM »
What user are you running filetool.sh -b as?
Who owns /mnt/sda1/tce/mydata.tgz?
Is /mnt/sda1 mounted rw or ro?
What filesystem type is /mnt/sda1?

Offline sblass92

  • Newbie
  • *
  • Posts: 15
Re: tc persistent .profile
« Reply #17 on: October 24, 2012, 09:31:52 PM »
What user are you running filetool.sh -b as?
Who owns /mnt/sda1/tce/mydata.tgz?
Is /mnt/sda1 mounted rw or ro?
What filesystem type is /mnt/sda1?

I'm running filetool.sh -b as the default 'tc' user.
I would think the 'tc' user owns /mnt/sda1/tce/mydata.tgz since thats the only user on the system, but how do I confirm this?  Our project doesn't require multiple users. 
/mnt/sda1 is mounted as whatever the default settings are upon installation to a hard drive, how can I determine if its rw or ro?
/mnt/sda1 was configured as ext4 on install. 

Thanks

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: tc persistent .profile
« Reply #18 on: October 24, 2012, 09:58:46 PM »
Hi sblass92
Quote
I would think the 'tc' user owns /mnt/sda1/tce/mydata.tgz since thats the only user on the system, but how do I confirm this?
Code: [Select]
ls -l /mnt/sda1/tce/mydata.tgz
Quote
/mnt/sda1 is mounted as whatever the default settings are upon installation to a hard drive, how can I determine if its rw or ro?
Code: [Select]
mount | grep sda1
Please show the result of:
Code: [Select]
showbootcodes

Offline sblass92

  • Newbie
  • *
  • Posts: 15
Re: tc persistent .profile
« Reply #19 on: October 25, 2012, 09:14:08 AM »
Code: [Select]
tc@box:~$ ls -l /mnt/sda1/tce/mydata.tgz
-rw-rw-r--    1 tc    staff    544226817 Oct 25 03:07 /mnt/sda1/tce/mydata.tgz

Code: [Select]
tc@box:~$ mount | grep sda1
/dev/sda1 on /mnt/sda1 type ext4 (rw,relatime,barrier=1,data=ordered)
/dev/sda1 on /home type ext4 (rw,relatime,barrier=1,data=ordered)
/dev/sda1 on /opt type ext4 (rw,relatime,barrier=1,data=ordered)

Code: [Select]
tc@box:~$ showbootcodes
initrd=/tce/boot/core.gz quiet waitusb=5:UUID="8e4e7647-a9e2-4f94-82f9-6f5395ad02dd" tce=UUID="8e4e7647-a9e2-4f94-82f9-6f5395ad02dd" home=sda1 opt=sda1 BOOT-IMAGE=/tce/boot/vmlinuz

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: tc persistent .profile
« Reply #20 on: October 25, 2012, 09:30:12 AM »
Hi sblass92
What exactly are you backing up? Your  mydata.tgz  is 500Mb.

Offline sblass92

  • Newbie
  • *
  • Posts: 15
Re: tc persistent .profile
« Reply #21 on: October 25, 2012, 09:52:57 AM »
just home and opt.  Home is quite large.  Ideally, I want to have them persistent on sda1 so I don't have to back them up and can modify .profile and config files. 

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: tc persistent .profile
« Reply #22 on: October 25, 2012, 10:07:29 AM »
Hi sblass92
From what I can see, your  /home  and  /opt  are persistent, they are on sda1. It must take a long time to shutdown
and boot with 500Mb in your backup. Remove home from your .filetool.lst and run a backup. Restart your machine.
As far as I can tell, your  /home  should be intact when your machine comes up.

Offline sblass92

  • Newbie
  • *
  • Posts: 15
Re: tc persistent .profile
« Reply #23 on: October 25, 2012, 10:34:18 AM »
Hi sblass92
From what I can see, your  /home  and  /opt  are persistent, they are on sda1. It must take a long time to shutdown
and boot with 500Mb in your backup. Remove home from your .filetool.lst and run a backup. Restart your machine.
As far as I can tell, your  /home  should be intact when your machine comes up.

I hope you can appreciate my confusion :)
Here are the steps I took earlier, which resulted in .filetool.lst restoring itself to a version that listed home and opt:

1. modify /mnt/sda1/tce/boot/extlinux/extlinux.conf so the only code I've added is 'home=sda1' 'opt=sda1'
2. modify /opt/.filetool.lst to remove 'home' and 'opt' from the files to backup
3. perform a backup using the command: filetool.sh -b
4. sudo poweroff

Upon reboot, my changes to .filetool.lst have been reverted to include home and opt, changes to .profile have been overridden. 

I tried this this time, using the same bootcodes (home=sda1 and opt=sda1):
1. modify /opt/.filetool.lst to remove 'home', but leave 'opt'
2. perform a backup using the command: filetool.sh -b
3. sudo poweroff

When it boots up, .filetool.lst remains as I left it and .profile is persistent with my changes.
I suppose this solves my problem, but I still don't totally understand why this was happening.

.profile was getting restored from backup on boot, but all my directories and files were not.  Nothing in .xfiletool.lst explicitly ignores this file.
.filetool.lst was getting restored if left blank, but not if I specified opt to be restored. 

Thank you to everyone who assisted



Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: tc persistent .profile
« Reply #24 on: October 25, 2012, 10:51:53 AM »
Hi sblass92
Quote
I hope you can appreciate my confusion
Yes I can.
Quote
but I still don't totally understand why this was happening.
I don't either. Maybe it was due to .filetool.lst being empty. I run persistent  /home  and  /opt  on my machines, but
they all have some config files listed in .filetool.lst. If you wish to experiment, you can confirm this.
Replace opt  with  etc/passwd  in your .filetool.lst, do a backup and restart. Verify that  /opt  and  /home are intact.
Replace etc/passwd with a carriage return in your .filetool.lst, do a backup and restart. Verify that  /opt  and  /home are intact.
Delete the carriage return in your .filetool.lst, do a backup and restart. Verify that  /opt  and  /home are intact.

Offline sblass92

  • Newbie
  • *
  • Posts: 15
Re: tc persistent .profile
« Reply #25 on: October 25, 2012, 11:08:48 AM »
replacing opt with /etc/passwd keeps /opt and /home (specifically .profile and .filetool.lst)

I replaced /etc/passwd with a carriage return and /opt and /home were preserved

I deleted everything from .filetool.lst and /opt and /home were preserved

So it looks like maybe it requires a backup/reboot cycle with opt in .filetool.lst before it works like normal?  Odd.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: tc persistent .profile
« Reply #26 on: October 25, 2012, 11:23:25 AM »
Hi sblass92
That would be a rather odd quirk, but I doubt that's the case. Running a backup to purge mydata.tcz of the  /home
and  /opt  contents should have been sufficient. At any rate, thanks for trying that experiment.

Offline sblass92

  • Newbie
  • *
  • Posts: 15
Re: tc persistent .profile
« Reply #27 on: October 25, 2012, 11:35:16 AM »
I'm not certain that the system is creating a backup when I poweroff.  Can I confirm this somehow?

[edit]
I confirmed this in an atypical way.

I made changes to a file in /usr/local/etc/ssh and added usr/local/etc/ssh to /opt/.filetool.lst

Changes only persist when I execute filetool.sh -b before I shutdown.
Simply making a change and powering off will restore everything before the change.
« Last Edit: October 25, 2012, 11:41:09 AM by sblass92 »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: tc persistent .profile
« Reply #28 on: October 25, 2012, 12:00:31 PM »
Uhmm... as expected?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: tc persistent .profile
« Reply #29 on: October 25, 2012, 12:11:08 PM »
You should never just power off a linux computer.
Core keeps most of the filesystem in RAM, but unless you have the copy2fs.flg set, and no persistent opt or home, there will still be open files on your hard/flash drive.

The proper way to shutdown is either to use the exit button, or exitcheck.sh.