WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Can you fsck p2 (TCE partition) REMOTELY?  (Read 1884 times)

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Can you fsck p2 (TCE partition) REMOTELY?
« on: May 31, 2020, 04:16:42 AM »
Greetings all,

Hope you are safe and well - I've been trying to find a way to remotely run fsck on p2, the TCE / TCZ directory.

I run a network of remote machines and it seems often I get a corrupt p2 partition - I know I can umount p3 easily and run fsck BUT how can this be done on p2 - If at all?

As I say, this needs to be remotely done without removing the SD card from the machine and mounting into another machine.

Any ideas :)

Many Thanks!

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14850
Re: Can you fsck p2 (TCE partition) REMOTELY?
« Reply #1 on: May 31, 2020, 04:30:05 AM »
If you set the copy2fs flag, you should be able to unmount mmcblk0p2 after reboot

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1268
Re: Can you fsck p2 (TCE partition) REMOTELY?
« Reply #2 on: May 31, 2020, 07:45:44 AM »
I’ve been toying with adding fsck to tc-config..... and allowing a boot code to force fsck.

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Re: Can you fsck p2 (TCE partition) REMOTELY?
« Reply #3 on: June 03, 2020, 06:15:18 AM »
Thank you Juanito,

Appreciate the quick answer - But I have been trying to set this boot option without luck :(

I actually don't even see the option "copy2fs" on the boot options? Maybe that's not the exact option I need to a add to cmdline3.txt?

I have tried to add the option, but still I can not umount p2 - Any idea how I can check this further?

I have another question I would like to ask as well, but will start a new thread as not exactly the same topic.

Many Thanks.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14850
Re: Can you fsck p2 (TCE partition) REMOTELY?
« Reply #4 on: June 03, 2020, 06:50:46 AM »
You need to either use the apps gui to set the copy2fs flag or:
Code: [Select]
$ touch /etc/sysconfig/tcedir/copy2fs.flg

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11699
Re: Can you fsck p2 (TCE partition) REMOTELY?
« Reply #5 on: June 03, 2020, 10:50:14 AM »
Hi onelife
Do you have persistent  /home  or  /opt  directories ? I don't know for sure, but if you do, you might need to unmount them before
trying to unmount  p2.

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Re: Can you fsck p2 (TCE partition) REMOTELY?
« Reply #6 on: June 03, 2020, 11:00:00 AM »
THANK YOU! Setting that flag file did the trick to allow me to fsck p2.

I assume I did this right in that you have to set this flag, store the flag file in /opt/.filetool.lst and then make a new backup and only after reboot does the boot process then copy fs as such and this allows you to umount it?

That is what I did and seemed to work even though from what I understand I have persistent /opt/ and /home/xxx.

My question now would be, what is the difference between keeping a system like this by default? Besides using more RAM I guess? What are the ups or downs of setting this flag? Sorry for my ignorance, but never used this flag before and maybe just maybe it will help with the case where my p2 gets corrupt?

Thank you so much.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14850
Re: Can you fsck p2 (TCE partition) REMOTELY?
« Reply #7 on: June 03, 2020, 11:09:23 AM »
The copy2fs flag is on permanent storage (/mnt/mmcblk0p2/tce/optional unless you changed it), so no need to add to your backup.

Reading the tinycore book will help with your other questions:

http://tinycorelinux.net/book.html