Page 1 of 1

[Solved] Porteus a system safe from unexpected shutdown?

Posted: 16 Dec 2014, 21:51
by rgroner
We are investigating using Porteus to replace our old DOS-based testing systems. One of the key advantages of DOS was that there was no system to shutdown....when you were done with testing, you could pull power and be confident it would boot up again the next time.

Is Porteus capable of that? I was wondering if the AlwaysFresh flag would mean that the system files were safe from an unexpected power shutdown.

What I need is to be able to configure the system the way I want (with the correct tests, Python, MC, etc) and then protect it from file system corruption somehow. Is that possible with Porteus? An additional bonus would be being able to save log files somewhere (so, writing to a file in some location) even if the system files were all non-writable.

I certainly hope so, as I am more and more a believer in Porteus....first time in a LONG time I've seen a sub-8 second boot to a GUI!

Re: Porteus a system safe from unexpected shutdown?

Posted: 16 Dec 2014, 22:28
by fanthom
yes - 'always fresh' is the way to go.
you could save log files or anything on a NFS share.

Re: Porteus a system safe from unexpected shutdown?

Posted: 17 Dec 2014, 13:30
by rgroner
Great! Then I just need to get the system configured the way I want before using "always fresh". I thought that Always Fresh would preserve the system as it was, but when I tried the cheatcode, it reverted back to a system prior to anything I had done. When I removed the cheatcode, then all my changes were back. So there is (hopefully) a way to make my changes part of the preserved system? I'l be looking into that today.

Re: Porteus a system safe from unexpected shutdown?

Posted: 17 Dec 2014, 13:44
by rgroner
ok, looks like I need to make my changes into a module somehow, and then include that in startup.

Re: Porteus a system safe from unexpected shutdown?

Posted: 17 Dec 2014, 15:01
by rgroner
So I went into the changes directory, turned all of that into an .xzm, and put that in the /porteus/base directory, named so that it goes last. I then started up with AlwaysFresh again, and now the changes I made before are there. I deleted a file, hit Reset on the system, it came up, and was unchanged. So I've succeeded, I think?

To have a place to write files, you said use an NFS share. There's no guarantee this system will be connected to a network, however. Is there some other way to have a place I can permanently write files somewhere on the system, while still using AlwaysFresh?

Re: Porteus a system safe from unexpected shutdown?

Posted: 17 Dec 2014, 15:15
by fanthom
sorry - 'Always Fresh' mode is not necessary. in your case it will be enough if you remove 'changes=' cheatcode from /boot/syslinux/porteus.cfg.

if you want to save some stuff locally then you can use /mnt/sdXY partitions but this wont prevent filesystem corruption if Porteus hangs or power gets cut.

to make the system fully unbreakable (like our kiosk) you should run with copy2ram + nohd cheatcodes and save changes only over network.

Re: Porteus a system safe from unexpected shutdown?

Posted: 17 Dec 2014, 16:03
by rgroner
Well, the most likely scenario of losing power is immediately after a test. Once the "success" message is shown, it's typically they pull power so they can configure it with different hardware. So, the test program can make sure that logs are written and closed before the success message, so that log files are less likely to be corrupted by sudden power loss.

I tried copy2ram and nohd, and it can't find porteus. I'm guessing it can't find the hd that porteus is installed to?

Re: Porteus a system safe from unexpected shutdown?

Posted: 17 Dec 2014, 17:42
by fanthom
'nohd' requires 'from=' cheatcode so init script knows exactly where to look for porteus installation. it cant search all the drives as they are disabled with 'nohd'

sorry - i should mention that earlier ....

Re: Porteus a system safe from unexpected shutdown?

Posted: 17 Dec 2014, 19:16
by rgroner
Ok, I've been told that I can reasonably expect that the test system WILL have access to network, so I'm going to work on setting up a NFS location for log files to be written to.

And I'm going to experiment with just setting changes to changes-ro so that it is easier if I have to reconfigure the system, instead of making it a module.

BTW, noticed this typo on the cheatcodes page:

"This way you won't loose your changes after reboot"

Thanks for all the help.

Re: [Solved] Porteus a system safe from unexpected shutdown?

Posted: 17 Dec 2014, 20:40
by fanthom
will fix the typo for next release.

thanks

Re: [Solved] Porteus a system safe from unexpected shutdown?

Posted: 17 Dec 2014, 22:29
by brokenman
Fixed on the website.

Re: [Solved] Porteus a system safe from unexpected shutdown?

Posted: 18 Dec 2014, 20:27
by rgroner
So with the changes-ro option, or with Always Fresh in use....if the network drive never materializes for whatever reason, is there *any* way to failover to a local location that I can write a log file to that won't disappear on reboot?

Re: [Solved] Porteus a system safe from unexpected shutdown?

Posted: 18 Dec 2014, 21:44
by fanthom
do a check for a network and if its not there then mount device to /mnt/something -> dump logs -> unmount it.

Re: [Solved] Porteus a system safe from unexpected shutdown?

Posted: 18 Dec 2014, 21:52
by rgroner
Ooo, that's clever. So as long as the drive is un-mounted before reboot, then the changes will be kept? That could work...I set aside a partition for this kind of stuff.

BTW....

"And follow the installation wizard's isntructions."

http://www.porteus.org/component/conten ... ition.html

(I'm REALLY not trying to find these, honest.)

Re: [Solved] Porteus a system safe from unexpected shutdown?

Posted: 19 Dec 2014, 13:53
by rgroner
I guess I confused myself. I had thought that with Always Fresh, I hadn't been able to write to a different partition and have it save. Doing testing now, I see that yes, I CAN write to the 2nd partition on the hard drive, and it will be there when I reboot, even with Always Fresh. That's exactly the back-up plan I need in case the network doesn't come up. I know that won't be safe from a sudden shutdown, but I still need the backup plan.

Thanks!