Check all your ext* and vfat partitions automatically

How to do things, solutions, recipes, tutorials
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#21 Post by musher0 »

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)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#22 Post by musher0 »

Hello, all.

Version 6 uploaded in 1st post. From the change log:
####
# 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)

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#23 Post by Sylvander »

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.
Attachments
00.jpg
(18.56 KiB) Downloaded 273 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#24 Post by musher0 »

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)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#25 Post by musher0 »

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

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#26 Post by Sylvander »

SUCCESS! :D
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. :D

THANK YOU! 8)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#27 Post by musher0 »

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... :roll: ) BFN.

musher0
Attachments
MonterPartitions.zip
Please unpack in /root/my-applications/Systeme and make the scripts executable before running them.
(2.03 KiB) Downloaded 235 times
Last edited by musher0 on Sat 14 Dec 2013, 17:05, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#28 Post by musher0 »

Sylvander wrote:SUCCESS! :D
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. :D

THANK YOU! 8)
My pleasure! :)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#29 Post by Sylvander »

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. :(
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?

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#30 Post by musher0 »

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. :(
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? :)

Keeping my fingers crossed! :)

BFN.

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

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#31 Post by Sylvander »

1.
musher0 wrote: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? :)
No, that isn't it, because I posted the above on the evening of the 14th.
See item 2 below for my idea of why it is happening.

2.
musher0 wrote: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.
a. Those files are...or rather were...there after the boot prior to this one.
See screenshot below.
I then clicked on the "Save..." icon, to save those [changes to the] files, so that at next boot they would be present, and...
Sure enough, They are still there, and as expected, automverif DID NOT RUN at this boot [unlike all previous boots].
Clicking "Save..." fixed it! :D

b. EXPLANATION:
I normally don't save any session changes...
In which case automverif would never find those 2 files in place [at next boot], and therefore would run at the next boot.
i.e. My normal practice of never normally saving session changes is messing up your arrangement made in automverif for keeping track of whether it aught to run or not.
Hmmm, how to work around that one? :?
I guess it would need to save those files [or ANY changes] somewhere under /mnt/home.
Might I move the folder there, and symlink back?
Attachments
00.jpg
(14.67 KiB) Downloaded 422 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#32 Post by musher0 »

Hi, Sylvander.

Thanks for your reply.

Oooh, a tough one... I believe that your symlinks would be lost at next boot too, if you're
working without a pupsave file. But please try it, who knows. I always make frugal
installs of my Puppies, or I launch them from a multi-session DVD, so this is new to me.

A silly question if I may: do you re-install the script every day? How do you save your
newly installed programs if you don't have a pupsave file to save them to?

In any case, I'll give some thought to alternative ways of saving the flags.

BFN.

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

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#33 Post by Sylvander »

musher0 wrote:How do you save your
newly installed programs if you don't have a pupsave file to save them to?
a. I DO have a pupsave file [it's on the internal HDD but treated by the Puppy as though on a Flash Drive], and I can and do save session changes [installed programs, config changes, etc], but only if I choose, and at a moment of my choosing.
Should I explain how I arrange for the Puppy to make that possible?
As I said, I CHOSE to save those 2 files and it fixed the problem where your script was initiating a scan when the desktop was reached at each/every new session.

b. Most of the time I choose to not save, because there are often no changes worth saving.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#34 Post by musher0 »

Ah, I see! Thanks for the explanation.

I was suspecting something like that, DVD or USB sessions. Or perhaps you were
running one of RSH's Puppies, which somehow, work without any pupsave.

BFN.

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

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#35 Post by Sylvander »

OK...
I moved...
"/root/my-applications/Systeme/automverif/6"
to...
"/mnt/home/automverif/6"
And symlinked it back to...
"/root/my-applications/Systeme/automverif".

Seems to be working OK.
Time will tell. :D

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#36 Post by musher0 »

Hello, all.

I've uploaded an update, version 7. Please read the changes and download from first post:
http://murga-linux.com/puppy/viewtopic. ... ost#742647

Enjoy!

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

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#37 Post by musher0 »

Hello, all!

Version 7.2 attached to 1st post. Constructive feedback appreciated. TWYL

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

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#38 Post by musher0 »

Should you need the replaceit utility, there's a fresh compile here:
http://murga-linux.com/puppy/viewtopic. ... ost#745370
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#39 Post by musher0 »

Hello, all.

Now up to version 10. Versions 8 and 9 were not published since I felt that they
were more developmental.

You'll find this new version at the bottom of my
initial post on page 1.


Any constructive comment welcome. Enjoy!

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

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#40 Post by L18L »

Hi musher0,

I use to check my partitions using this (very long) one-liner.

Code: Select all

# for dev in /sys/block/sd*; do echo ; cd $dev; for f in `echo $par*`; do cmd="fsck /dev/$f" ;  echo $cmd; $cmd ;echo ;done;echo =================; done &

fsck /dev/sda1
fsck from util-linux 2.21.2
dosfsck 3.0.11, 24 Dec 2010, FAT32, LFN
/dev/sda1: 5164 files, 47477/51693 clusters

fsck /dev/sda2
fsck from util-linux 2.21.2
e2fsck 1.42.6 (21-Sep-2012)
boot: clean, 30/4016 files, 11430/16064 blocks

fsck /dev/sda3
fsck from util-linux 2.21.2
e2fsck 1.42.6 (21-Sep-2012)
/dev/sda3: clean, 80146/1872304 files, 6892899/7476249 blocks

=================

fsck /dev/sdb1
fsck from util-linux 2.21.2
e2fsck 1.42.6 (21-Sep-2012)
/dev/sdb1: clean, 15/1616 files, 467/6456 blocks

fsck /dev/sdb2
fsck from util-linux 2.21.2
e2fsck 1.42.6 (21-Sep-2012)
/dev/sdb2 is mounted.
e2fsck: Cannot continue, aborting.



=================
#
Hope this helps to keep your code tiny.

Post Reply