(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
https://forum.puppylinux.com
and continue your work there. Thank you.

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 20 Sep 2020, 10:09
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Check all your ext* and vfat partitions automatically
Moderators: Flash, Ian, JohnMurga
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 2 of 5 [74 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5089
Location: Arizona, U.S.A.

PostPosted: Thu 12 Dec 2013, 03:39    Post subject:  

Once Puppy has booted to the point that PUPSTATE is sourced then:
Code:
if [ "$DEV1FS" = vfat ];then
 PF=/etc/rc.d/vfat-boot-cnt
 [ -f $PF ]|| echo 0 > $PF
 CNT=$(<$PF)
 if [ $CNT -gt 32 ];then
 fsck.vfat
 echo 0 > $PF
 else
 echo $((CNT+1)) > $PF
 fi
fi

disktype could be used in place of PUPSTATE, and other ways to do it also.
# I haven`t tested this code... So it`s not proofed yet.
.
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Thu 12 Dec 2013, 11:19    Post subject:  

Hi, sunburnt.

I confess my failings. I had to comment your script to fully understand it! (See attached.
My IQ is only of...) Twisted Evil That said...

The logic of it is great! I know a little bit what PUPSTATE is and does, but please
explain where to find it, and most importantly, how we insert / hook up your routine
in the Puppy boot process.

I suspect we'd have to add in front of it something like

Code:
(code in words)
if [ PUPSTATE number means Puppy is running frugal or full -a we have a vfat drive somewhere on this rig ]
   activate sunburnt's vfat-boot-counter
fi


Then all we need to do is use the counter setter routine alongside tunefs, ONCE, to set
the counter trigger for both ext? and vfat drives at, say, 32, as you suggest. We incorporate your routine in the partition checker, and we're all set!

(The above logic is still a bit fuzzy now, but I'm sure you get the idea.)

As a refinement, we could link the partition checker in ~/Startup, and voilà, disks will be
checked automatically every 32 boots.

BFN.

musher0
vfat-boot-cnt.sh.zip
Description 
zip

 Download 
Filename  vfat-boot-cnt.sh.zip 
Filesize  670 Bytes 
Downloaded  233 Time(s) 

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5089
Location: Arizona, U.S.A.

PostPosted: Thu 12 Dec 2013, 15:49    Post subject:  

Hi musher; We`re talking about the Save file partition, so it must be checked early in init script.
init is where most of the Puppy setup occurs, the first image file mounted is the Save file.
Otherwise I put mounting code like this ( like my mnt-all.puppy script ) into: /etc/rc.d/rc/local
PUPSTATE is also in: /etc/rc.d/rc/local

Your addition isn`t needed I think, $DEV1FS tells what the Save partition is, that`s all we need.
In my PUPSTATE, $DEV1FS='ext3' I`m assuming vfat is the only fat designation used.
If it uses: vfat, fat32, fat16, msdos, etc., then my script would be need additional code added.
Perhaps this inplace of the first line: if [ "`echo $DEV1FS |grep fat`" ];then
This will use any $DEV1FS that has "fat" in it, but doesn`t account for "msdos" ( very old ).
.
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Thu 12 Dec 2013, 17:05    Post subject:  

Hello, everyone!

I've uploaded a new version, v. 5.

For the user, the main innovations of this version are:
- The archive is in pet format, easy to install.

- Automatic partition checks will be done once every fortnight. The wrapper queries the
day of the month and launches the script only on the 1st and 15th day of the month.

- This is done through a simple link in ~/Startup, so this disk-checking script will run at
every boot. A quick message appears if the time to check the partitions has not come.
In other words, the script reassures the user that it's there, but it checks the drives
only twice a month. I believe that this checking interval should be enough to keep our
partitions running at optimal speed.

Please see updated first post for other, more internal type, details.

Enjoy!

musher0

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Last edited by musher0 on Thu 12 Dec 2013, 17:36; edited 1 time in total
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Thu 12 Dec 2013, 17:13    Post subject:  

sunburnt wrote:
Hi musher; We`re talking about the Save file partition, so it must be checked early in init script.
init is where most of the Puppy setup occurs, the first image file mounted is the Save file.
Otherwise I put mounting code like this ( like my mnt-all.puppy script ) into: /etc/rc.d/rc/local
PUPSTATE is also in: /etc/rc.d/rc/local

Your addition isn`t needed I think, $DEV1FS tells what the Save partition is, that`s all we need.
In my PUPSTATE, $DEV1FS='ext3' I`m assuming vfat is the only fat designation used.
If it uses: vfat, fat32, fat16, msdos, etc., then my script would be need additional code added.
Perhaps this inplace of the first line: if [ "`echo $DEV1FS |grep fat`" ];then
This will use any $DEV1FS that has "fat" in it, but doesn`t account for "msdos" ( very old ).
.


Hi, sunburnt.

Sorry for the late reply. I've been busy all day... Smile (See post above this one.)

Thanks for the add'l info. Ok, so the vfat checking counter would go in /et/rc.d/rc.local.
Shucks, there'll have to be v. 5a! Smile

But isn't the pupsave file checked automatically if you add pfix=fsck in the boot line parameter?

Or do you mean that the drive on which the pupsave resides should also be checked at each boot?

BFN.

musher0

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Fri 13 Dec 2013, 04:04    Post subject:  

Hi, sunburnt.

You said:
> We`re talking about the Save file partition, so it must be checked early in init script.

- Since the partition where the pupsave file is located is active when you're running Puppy
from HD, you can't unmount it to check it.
- giving some thought at your suggestion for a vfat partitions counter.

TWYL. Have a great day!

musher0

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Sat 14 Dec 2013, 01:18    Post subject:  

Hello, all.

Version 6 uploaded in 1st post. From the change log:
Quote:
####
# Changes, v. 6
# ^^^^^^^^^^^^^^
# Useless message to user (from v. 5) suppressed. Checks the
# timestamp # and the dates silently. If no timestamp is found, the
# script is run.
#
# It does not run in the background. It does not grab resources for
# itself. At the beginning of your session, it simply sets some flags.
# It checks them and runs the main action script if the timeframe is
# met, or upon your request.
#
# Instead, a flag file (/root/my-applications/Systeme/automverif/6/
# started) is created at the beginning of the session and removed at
# the end of the session through a script in /etc/init.rd.
#
# Some code cleanup.
#
# Set to run only once on checking days (1st and 15th of the month),
# rather than at every boot on those days.
#
# Menu entry now more logically placed in Files category, next to
# PMount, rather than in the general Utilities category.
#
# You can still run this partition checking script at any time, either
# by clicking the menu entry, or typing in console:
# /root/my-applications/Systeme/automverif/6/automverif5-direct.sh.
# Doing so does not disturb the "automatic run" flags; only the
# timestamp is updated.
#
# Hopefully, you will share my feeling that overall, this v. 6 runs
# more smoothly while maintaining the same important functions.
#
# musher0, Dec. 14, 2013.
#
# PS. It is suggested that you remove any previous version before
# installing this one.
####


BTW, this script has been tested in raringPup 3992 (various pupsaves) and in wheezyPup running from DVD.

Have a great day!

musher0

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 4439
Location: West Lothian, Scotland, UK

PostPosted: Sat 14 Dec 2013, 08:46    Post subject:  

1. Running "Precise-5.6.1" on 2012 desktop PC hardware.

2. Made "PupsaveHotBackup" prior to installing "automverif-6.0.pet".

3. The pet installed OK, rebooted, saved session changes at shutdow/reboot.

4. Once back to the desktop...
Ran "Menu->Filesystem->automverif".
Program window appears on desktop.
CPU usage display indicates increased usage.
Program window scrolls down page.
Cursor flashing at bottom, BUT....
Text display showed faintly, but only one time.
In general I cannot see any display of text in the window [see screenshot below]....
Desktop wallpaper image showing faintly as if through deep-red glass [the wallpaper is deep blue lake scene from Lighthouse64].
Would it be possible to display plain black text on white/pale window?

5. Will now restore the PupsaveHotBackup.
00.jpg
 Description   
 Filesize   18.56 KB
 Viewed   277 Time(s)

00.jpg

Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Sat 14 Dec 2013, 11:32    Post subject:  

Hello, Sylvander.

Thank you for your useful feedback. Your remark is noted. In the next version, I will strive
to provide a more contrasted interface.

Best regards.

musher0

~~~~~~~~~~~~~~
Additional thoughts:

- You may already know that you can use the Puppy Package Manager to remove a
*.pet package that you have just installed and tested? A full backup is not necessary
beforehand (but it's up to you, of course).

- It might be a few days before I produce an updated version.

In the meantime, if you need to check your partitions, you can run the script directly.
That way, it will use your own console colors. To do so,

open a terminal and type (without the chevrons):

< cd ~/my-applications/Systeme/automverif/6 > and hit the Return key;

then type: < clear;./automverif6.sh > and hit the Return key. The script will run in your
default console.

Again thanks for your feedback.

musher0

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Sat 14 Dec 2013, 12:24    Post subject:  

@Sylvander and all.

I just uploaded a corrected version in 1st post.
Thanks for your understanding. BFN.

musher0

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 4439
Location: West Lothian, Scotland, UK

PostPosted: Sat 14 Dec 2013, 12:51    Post subject:  

SUCCESS! Very Happy
Installed version 6.1...
Rebooted...
On getting to the desktop, the window appeared...
White text easily readable against the dark background.
Looked to me like all tests were successful, and reporting no problems. Very Happy

THANK YOU! Cool
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Sat 14 Dec 2013, 13:00    Post subject:  

Hello again.

By default, in Puppy, there is a minimal fstab (at /etc/fstab; it's the central partition list
in Linux), and all the drive directories are not listed initially in the /mnt directory.

The "automverif" script relies on those informations, however, through the
< mount -a > and < umount -a > commands. Nothing new here: power users tend
to forget how they started and the "virgin" state of the Puppy system when they
started developing... Please accept my apologies for any previous inconvenience.

To correct the situation, the attached scripts will populate the fstab file and the
/mnt folder.

You initially run the scripts separately, in this sequence:

rep-dans-mnt.sh

Create-fstab.sh

MonterPartitions3.sh

Once that is done, only < MonterPartitions3.sh > should be used, the other scripts are
not needed. Subsequently, if you like all your drives to be mounted at boot, you can
make a link from it ( < /root/my-applications/Systeme/MonterPartitions3.sh > ) to
/root/Startup.

I'm putting a zip file here for the moment. I should be able to present a little later a 6.2
update of the automverif package, which will contain these utilities.

Any feedback is valued, of course. We're still in bêta mode, aren't we. (French spelling
and meaning of "bêta" intentional... Rolling Eyes ) BFN.

musher0
MonterPartitions.zip
Description  Please unpack in /root/my-applications/Systeme and make the scripts executable before running them.
zip

 Download 
Filename  MonterPartitions.zip 
Filesize  2.03 KB 
Downloaded  226 Time(s) 

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Last edited by musher0 on Sat 14 Dec 2013, 13:05; edited 1 time in total
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Sat 14 Dec 2013, 13:01    Post subject:  

Sylvander wrote:
SUCCESS! Very Happy
Installed version 6.1...
Rebooted...
On getting to the desktop, the window appeared...
White text easily readable against the dark background.
Looked to me like all tests were successful, and reporting no problems. Very Happy

THANK YOU! Cool


My pleasure! Smile

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 4439
Location: West Lothian, Scotland, UK

PostPosted: Sat 14 Dec 2013, 22:22    Post subject:  

Oops...
Shut down Precise Puppy.
Some hours later I booted again, AND...
At the desktop the Automverif window appeared having scanned yet again.
Looks like it's scanning at every boot. Sad
It's supposed to scan twice a month, right?
At the 1st and 15th of the month?

What to do about scanning the auto-mounted partition holding the pupsave file?
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Sat 14 Dec 2013, 22:50    Post subject:  

Sylvander wrote:
Oops...
Shut down Precise Puppy.
Some hours later I booted again, AND...
At the desktop the Automverif window appeared having scanned yet again.
Looks like it's scanning at every boot. Sad
It's supposed to scan twice a month, right?
At the 1st and 15th of the month?

What to do about scanning the auto-mounted partition holding the pupsave file?


Hi, Sylvander.

Please look in /root/my-applications/Systeme/automverif/6. On "non-scan" days, there
should be 2 flags there: a "timestamp" file and one called "started". If there are no flag
files there, the script will run.

Oh! I just thought of this: I live in Canada, my time zone is Eastern Standard Time,
and it is 10 p.m. here on Dec. 14. In Scotland you are 5-6 hours ahead of me, already
on Dec. the 15th, right? So... maybe the script is actually working as scheduled? Smile

Keeping my fingers crossed! Smile

BFN.

musher0

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 5 [74 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2131s ][ Queries: 13 (0.0710s) ][ GZIP on ]