[Solved] Porteus a system safe from unexpected shutdown?

Post here if you are a new Porteus member and you're looking for some help.
rgroner
Black ninja
Black ninja
Posts: 58
Joined: 23 Oct 2014, 14:23
Distribution: Porteus 3.0.1
Location: U.S.

[Solved] Porteus a system safe from unexpected shutdown?

Post#1 by rgroner » 16 Dec 2014, 21:51

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!
Last edited by rgroner on 17 Dec 2014, 19:16, edited 1 time in total.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Porteus a system safe from unexpected shutdown?

Post#2 by fanthom » 16 Dec 2014, 22:28

yes - 'always fresh' is the way to go.
you could save log files or anything on a NFS share.
Please add [Solved] to your thread title if the solution was found.

rgroner
Black ninja
Black ninja
Posts: 58
Joined: 23 Oct 2014, 14:23
Distribution: Porteus 3.0.1
Location: U.S.

Re: Porteus a system safe from unexpected shutdown?

Post#3 by rgroner » 17 Dec 2014, 13:30

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.

rgroner
Black ninja
Black ninja
Posts: 58
Joined: 23 Oct 2014, 14:23
Distribution: Porteus 3.0.1
Location: U.S.

Re: Porteus a system safe from unexpected shutdown?

Post#4 by rgroner » 17 Dec 2014, 13:44

ok, looks like I need to make my changes into a module somehow, and then include that in startup.

rgroner
Black ninja
Black ninja
Posts: 58
Joined: 23 Oct 2014, 14:23
Distribution: Porteus 3.0.1
Location: U.S.

Re: Porteus a system safe from unexpected shutdown?

Post#5 by rgroner » 17 Dec 2014, 15:01

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?

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Porteus a system safe from unexpected shutdown?

Post#6 by fanthom » 17 Dec 2014, 15:15

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.
Please add [Solved] to your thread title if the solution was found.

rgroner
Black ninja
Black ninja
Posts: 58
Joined: 23 Oct 2014, 14:23
Distribution: Porteus 3.0.1
Location: U.S.

Re: Porteus a system safe from unexpected shutdown?

Post#7 by rgroner » 17 Dec 2014, 16:03

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?

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Porteus a system safe from unexpected shutdown?

Post#8 by fanthom » 17 Dec 2014, 17:42

'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 ....
Please add [Solved] to your thread title if the solution was found.

rgroner
Black ninja
Black ninja
Posts: 58
Joined: 23 Oct 2014, 14:23
Distribution: Porteus 3.0.1
Location: U.S.

Re: Porteus a system safe from unexpected shutdown?

Post#9 by rgroner » 17 Dec 2014, 19:16

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.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

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

Post#10 by fanthom » 17 Dec 2014, 20:40

will fix the typo for next release.

thanks
Please add [Solved] to your thread title if the solution was found.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

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

Post#11 by brokenman » 17 Dec 2014, 22:29

Fixed on the website.
How do i become super user?
Wear your underpants on the outside and put on a cape.

rgroner
Black ninja
Black ninja
Posts: 58
Joined: 23 Oct 2014, 14:23
Distribution: Porteus 3.0.1
Location: U.S.

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

Post#12 by rgroner » 18 Dec 2014, 20:27

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?

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

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

Post#13 by fanthom » 18 Dec 2014, 21:44

do a check for a network and if its not there then mount device to /mnt/something -> dump logs -> unmount it.
Please add [Solved] to your thread title if the solution was found.

rgroner
Black ninja
Black ninja
Posts: 58
Joined: 23 Oct 2014, 14:23
Distribution: Porteus 3.0.1
Location: U.S.

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

Post#14 by rgroner » 18 Dec 2014, 21:52

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.)

rgroner
Black ninja
Black ninja
Posts: 58
Joined: 23 Oct 2014, 14:23
Distribution: Porteus 3.0.1
Location: U.S.

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

Post#15 by rgroner » 19 Dec 2014, 13:53

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!

Post Reply