Make Puppy recover automatically from improper shutdowns

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

You pm-ed me.....

#31 Post by SilverPuppy »

rameshiyer wrote:I am using 4.3.1 full installation with Ext4 ( dual boot). I am not able to boot after power loss or improper shutdown. Kindly provide solution or pet package to install so that I can reboot my puppy with reinstall the same. I have read your postings int his regard, however, I am not able to follow the postings. Kindly help me in this regard.
Well, if you can't boot, then your first course of action is to boot from a LiveCD and run fsck on the partition that Puppy lives on (probably sda2 in your case, but do verify this)

Once you get things running again, check out my original post for new files I just made yesterday for 4.3.1----they work the same as the ones for 4.1.2, (drop-in to /etc/rc.d, then change the line in rc.sysinit that says "fsck /dev/sda1" to reflect whatever the partition Puppy lives on is called, then reboot) with one additional caveat: the TIME ZONE MUST BE SET TO GREENWICH, or fsck reports that the superblock last write time is in the future, and won't run automatically (might only apply for the first few hours after installation, come to think of it.)

Anybody want to comment on the superblock/Greenwich issue? Thinking about it now, I guess it shouldn't matter in general, only for the first few hours after installation, as IIRC the superblock is not written to otherwise.....or am I mistaken?

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#32 Post by mikeb »

I have yet to achieve a clean shutdown with frugal and the clean up script is in initrd.gz anyway. Inability to unmount from the union is the cause although slax manages this :D .

As I mentioned before puppy 4 unreliability is mainly due to useng ext2 for the pup_save...I don't get problems like this with puppy 2 which uses ext3... a tweak of the init script needed for that change . Alternatively add pfix=fsck to the kernel boot line.
If unionfs is used whiteout files do accumulate and eventually cause problems...aufs does not seem to suffer this.

Full installs are not supported as its not considered the approved way of using puppy so its up to us to provide the fixes.

mike

User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

Unapproved and improving it

#33 Post by SilverPuppy »

Well, I aim to make that "unapproved" use much more usable! :D

As for unmounting from the union......the Southern States managed to SECEDE from the Union.....so how hard can a simple unmount be? :lol:

Why on earth does the Universal Installer make it so easy then, if it's not the "approved" way? Perhaps because Puppy is OSS, and doesn't need anybody's approval? :P

User avatar
enhu
Posts: 302
Joined: Wed 27 May 2009, 02:13
Contact:

#34 Post by enhu »

what shall i do with this rc.sysinit&shutdown-4.1.2-4.3.1.zip?
i download it, unzip it and saw some files.

havent understand puppy yet until now.

should i put it inside rc.d?

G0XAN
Posts: 31
Joined: Fri 08 May 2009, 18:52
Location: Brighton, UK

#35 Post by G0XAN »

enhu

First, go to /etc/rc.d and rename the existing rc.sysinit and rc.shutdown or move them into another directory so they are kept safe.

Next you have to choose which version of the files you need - 4.1.2 or 4.3.1
Extract the files you need and rename them to rc.sysinit and rc.shutdown (remove the version numbers)
Now copy (or move) the new rc.sysinit and rc.shutdown into /etc/rc.d
Finally, change the permissions on the files so they can execute

Code: Select all

chmod 755 rc.sysinit
chmod 755 rc.shutdown
And that's it, you should be good to go.

Silverpuppy, can I suggest you add the instruction on where to put the files into the first post with the files, or maybe a brief readme in the zip file.
Excellent work BTW, just what I was looking for. :) Thanks!

(Edit: Added in the chmod instruction, as I fell foul of it myself!)
Gary

User avatar
enhu
Posts: 302
Joined: Wed 27 May 2009, 02:13
Contact:

Re: You pm-ed me.....

#36 Post by enhu »

SilverPuppy wrote:
rameshiyer wrote:I am using 4.3.1 full installation with Ext4 ( dual boot). I am not able to boot after power loss or improper shutdown. Kindly provide solution or pet package to install so that I can reboot my puppy with reinstall the same. I have read your postings int his regard, however, I am not able to follow the postings. Kindly help me in this regard.
Well, if you can't boot, then your first course of action is to boot from a LiveCD and run fsck on the partition that Puppy lives on (probably sda2 in your case, but do verify this)

Once you get things running again, check out my original post for new files I just made yesterday for 4.3.1----they work the same as the ones for 4.1.2, (drop-in to /etc/rc.d, then change the line in rc.sysinit that says "fsck /dev/sda1" to reflect whatever the partition Puppy lives on is called, then reboot) with one additional caveat: the TIME ZONE MUST BE SET TO GREENWICH, or fsck reports that the superblock last write time is in the future, and won't run automatically (might only apply for the first few hours after installation, come to think of it.)

Anybody want to comment on the superblock/Greenwich issue? Thinking about it now, I guess it shouldn't matter in general, only for the first few hours after installation, as IIRC the superblock is not written to otherwise.....or am I mistaken?

it didn't work. even after installing it back and setting it to greenwich.

sarum
Posts: 59
Joined: Sun 08 Jul 2007, 02:05
Location: The Thames, New Zealand

#37 Post by sarum »

Goxan wrote: chmod 755 re.sysinit
chmod 755 rc.shutdown
I get the answer 'no such file or directory' in rxvt.

I've done all the other stuff. Renaming -sysinit & -shutdown. Extracted both new downloads; in my case 4.3.1 and renamed them(ie. without the 4.3.1 number). Can anyone see where I've gone wrong - please.
The new files are in /etc/rc.d.
Thanks for any help...........sarum

sarum
Posts: 59
Joined: Sun 08 Jul 2007, 02:05
Location: The Thames, New Zealand

#38 Post by sarum »

I forgot to:- cd /etc/rc.d. then I did a 'chmod 755' and it worked, or at least it seems to have done. I'd like to try it out now but I'm worried about the GMT thing. I see that SilverPuppy says it'll be OK after a few hours. So I'll give it a go this evening.
Thanks to all who do these very useful things........sarum.

sarum
Posts: 59
Joined: Sun 08 Jul 2007, 02:05
Location: The Thames, New Zealand

#39 Post by sarum »

.......................and it worked. Thanks again.
A big part of a good distro: is it's forum.

User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

And then again....

#40 Post by SilverPuppy »

A few thoughts....have been busy.....

1. As far as I know, the only way I know of FOR SURE to make the fsck work properly is to set the timezone to GMT. I theorized that it might work hours later in GMT-x timezones, but that was only a theory, and upon further digging into superblock theory, I am in greater doubt than before as to whether there is any other way to do it other than to set the clock to GMT. Running in GMT causes no problems that I can see, and in fact, causes no changes that I can perceive. The clock is still accurate in the tray.

2. All functionality except fsck will work fine no matter when it is used or what timezone is set. You won't mess up your system by not setting to GMT or forgetting to wait or whatever. The worst thing you can get is a fsck "I can't run automatically" message and no fsck on reboot. You won't get a non-booting system or anything like that.

gcmartin

Make Puppy recover automatically from improper shutdowns

#41 Post by gcmartin »

@SilverPuppy

This Looks a very useful and thought thru effort.

My question is what are the implication of my using Puppy on a system that has multiple partitions on it....particularly since much of the data that use is on Linux and Microsoft partitions?

Is your process ONLY applicable to the "Puppy" partition or is it applicable to all mounted partitions that were in the running when power was lost?

Thanks in advance

User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

Re: You pm-ed me.....

#42 Post by SilverPuppy »

enhu wrote:
SilverPuppy wrote:
rameshiyer wrote:I am using 4.3.1 full installation with Ext4 ( dual boot). I am not able to boot after power loss or improper shutdown. Kindly provide solution or pet package to install so that I can reboot my puppy with reinstall the same. I have read your postings int his regard, however, I am not able to follow the postings. Kindly help me in this regard.
Well, if you can't boot, then your first course of action is to boot from a LiveCD and run fsck on the partition that Puppy lives on (probably sda2 in your case, but do verify this)

Once you get things running again, check out my original post for new files I just made yesterday for 4.3.1----they work the same as the ones for 4.1.2, (drop-in to /etc/rc.d, then change the line in rc.sysinit that says "fsck /dev/sda1" to reflect whatever the partition Puppy lives on is called, then reboot) with one additional caveat: the TIME ZONE MUST BE SET TO GREENWICH, or fsck reports that the superblock last write time is in the future, and won't run automatically (might only apply for the first few hours after installation, come to think of it.)

Anybody want to comment on the superblock/Greenwich issue? Thinking about it now, I guess it shouldn't matter in general, only for the first few hours after installation, as IIRC the superblock is not written to otherwise.....or am I mistaken?

it didn't work. even after installing it back and setting it to greenwich.
2 things.

1. I was mistaken on the way the superblock works, and the time will have to be set to GMT until one of us figures out a workaround.

2. You have to change the e2fsck line in the rc.sysinit file to have the correct name of the Puppy partition. Otherwise it won't work. Also, if you are not using EXT2 or EXT3, substitute the appropriate command for e2fsck. A lot of people have forgotten this, it seems.

User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

Re: Make Puppy recover automatically from improper shutdowns

#43 Post by SilverPuppy »

gcmartin wrote:@SilverPuppy

This Looks a very useful and thought thru effort.

My question is what are the implication of my using Puppy on a system that has multiple partitions on it....particularly since much of the data that use is on Linux and Microsoft partitions?

Is your process ONLY applicable to the "Puppy" partition or is it applicable to all mounted partitions that were in the running when power was lost?

Thanks in advance
By default, the only partition that would be checked is the Puppy partition, but the answer to that question depends a bit on what software is included on your system.

I am pretty certain that by default, Puppy does not have a utility installed capable of checking/repairing NTFS filesystems, and I'm not totally sure that such a utility exists, as NTFS is proprietary.

That said, it is possible to add lines to the rc.sysinit file to check other partitions at the same point in the process. Just add them immediately under the e2fsck line that checks the Puppy partition.

I am pretty sure that you can check FAT32 partitions from within Puppy, and it would just be a matter of inserting the correct command line after the e2fsck line. I don't recall offhand what that is.

If you can find a command-line Linux utility to check NTFS partitions, it should be possible to achieve the functionality you seek.

Hope that helps you.

sindi
Posts: 1087
Joined: Sun 16 Aug 2009, 13:30
Location: Ann Arbor MI USA

Puppy 4.3.1 frugal ext2 ROX-filer error on improper shutdown

#44 Post by sindi »

HP Pavilion 84802, circa 1999, 450MHz, 256MB RAM. HSF1 modem
(combo with riptide sound). Onboard video okay with Xorg
(and I think Xvesa - unload ctmouse first).

puppy 4.3.1 oldest retro kernel, files in /dev/hda2
ext2. Puppy is loaded using loadlin from /dev/hda1 (FAT32,
used for 100 old DOS games, boot to DOS then choose games
or Puppy Linux).

loadlin vmlinuz initrd=initrd.gz ro nosmp

On first use, the 11-year-old user turned it off without
shutting down.
They returned it (via bus - huge computer).
During boot, pages of udevd-event error messages.
After booting, dialog box with error (may not be exact).

Error :
root/Choices/ROX-filer?
Pinboard PuppyPin:
Input/Output error

None of this showed up in a forum search.
Home icon. No trash or lock or other icons. Menu is
there. The owner wants the icons back.

fd0 hda1 hda2 piled on top of each other in lower left,
refuse to be separated.

e2fsck did not help (from Basiclinux 3.5 floppy disk).

Works if booted pfix=ram (ignore save file).
Since this computer is only for internet access and school
work, one possible fix is a small DOS batch file called
'fixit' which would recopy both the .sfs and the save
file from a backup location, on top of originals in FAT2
partition. Since e2fsck did not fix the
problem, would ext3 help anyinstead of the above fix?

Is there some way to fix the ROXfiler problem rather than
delete the save file? They can wait a few days for a
better solution.

sindi
Posts: 1087
Joined: Sun 16 Aug 2009, 13:30
Location: Ann Arbor MI USA

Puppy 4.3.1 frugal lost icons on improper shutdown

#45 Post by sindi »

I was able to mount -o loop pupsave.2fs. It is ext2.
e2fsck -y /initrd/mnt/dev_save/puppy431/pupsave.2fs fixed the problem.

Should I also e2fsck /dev/hda2 at startup? That was apparently required for the full install. In my case Puppy boots to X (Xvesa) but most of the icons are missing (see previous message).

How do I run it at startup? I put it in rc.sysinit before the first occurrence of pinboard (since I got a pinboard error otherwise). How do I know
if it is actually running? It was not in dmesg, and there is still the complaint about needing to run e2fsck.

User avatar
SilverPuppy
Posts: 143
Joined: Fri 29 May 2009, 02:21

Why not full installation, people?

#46 Post by SilverPuppy »

I do understand the portable environment benefits of Puppy, but that said, why wouldn't you just do a full install on a small partition in this situation? Then you can use my files and have recovery fully automated, and everything wonderful!

Not only can it automatically fix the problems idiots introduce by dumping computers in a heap instead of turning them off nicely, but you also experience the following benefits running full vs. frugal:

1. The SFS system uses RAM, as everything else does. Running off a LiveCD I've observed as much as 17MB of additional RAM usage compared to a full install.

2. The SFS decompression takes up a significant amount of CPU time on low-powered computers. Running full installations removes this load as well.

I would recommend using EXT3 when you do, as the journaling makes it easier for fsck to fix things, but that's just a fringe benefit. :D

sindi
Posts: 1087
Joined: Sun 16 Aug 2009, 13:30
Location: Ann Arbor MI USA

Fixed inode count problem Puppy 4.31 frugal

#47 Post by sindi »

I kept running e2fsck on pupsave.2fs and new errors kept developing. Copied the files from one 2 GB hard disk without UDMA support to a slightly newer one with UDMA support which runs twice as fast. No more errors. Normally frugal install can recover from improper shutdown. I had too many unfixable crashes with full install that e2fsck could not fix.

Only the pupsave.2fs file ever got the bad inodes so I ignored it and started fresh. DOS works okay on that drive. Puppy works on a 400MB drive without UDMA.

With 256MB RAM, I don't worry about losing 17MB of it. Puppy does run faster from memory than from hard disk on older computers (at 300MHz it was up to 5 sec between click and program appearing on screen). The full install appears not to load into RAM.

DarinB
Posts: 24
Joined: Wed 30 Dec 2009, 19:44

#48 Post by DarinB »

I am using a full install. of 431 please explain how to use your files. i had a couple of bad shut downs but after typing reboot it came back, i am a newbie to this and don't know if i am using ext 2 or ext 3 and if that matters. Since this is an old p3 256mb ram lap top with a dead motherboard bat and pc bat i use the power cord that sometime falls off. BUT with pup this thing is really fast and i love it.

nassausky
Posts: 26
Joined: Sun 08 Jun 2008, 03:59

#49 Post by nassausky »

This thread has been very interesting. Thanks for the interesting scripts you pieced together. I actually had a problem this sunday. I was running terminal in a secure session and decided to reboot puppy 4.31 by using the 'reboot' command. Waited a while and never regained ssh control of the puppy linux box remotely. Showed up at the client and it was stuck at the root prompt #. The USB Keyboard wasn't working. Wound up reinstalling Puppy 4.31. It happened again this afternoon. I thought it was a rare situation until I typed 'reboot' again and it seems that it doesn't cleanly reboot the computer. Anyhow my question is if I plug in a PS/2 keyboard and I have access to the root prompt. Can I just install the 4.31 files into the /etc/rc.d folder and change their permissions and run it after whatever damage was done to the file system or is it too late already and should I reinstall puppy again for the 2nd time.

User avatar
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

#50 Post by pri »

SilverPuppy :
the script is work on 4.3.1, but there is a new problem. i must set up mouse every boot.
Learning by Doing

Post Reply