Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 21 Apr 2014, 03:27
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Check all your ext* and vfat partitions automatically
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 5 [74 Posts]   Goto page: 1, 2, 3, 4, 5 Next
Author Message
musher0


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

PostPosted: Tue 10 Dec 2013, 02:08    Post subject:  Check all your ext* and vfat partitions automatically
Subject description: ... in one fell swoop! It's not a chore anymore! (:-)
 

Now up to version 11b. See changes log below for added &
modified features.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hello, all.

Here is a little script that will help you maintain your partitions / disks in tip-top
shape. The script is well remarked, so I won't repeat myself!

Main features:
- a cinch to install and use; almost no intervention required on your part once the pet is installed;
- keeps your partitions running at optimal speed;
- runs four times a month, unobtrusive on other days; can also be run "standalone";
- easy browsing of fsck reports in the CLI window to spot any issues;
- NEW, March 25 2014:
-----> check partition types separately or one after the other;
-----> ANSI colors used;
-----> complete check each time.
[b]- NEW, March 27 2014:
-----> CD/DVD types totally excluded, as well as add'l non-Puppy file systems.
-----> new longer, easier to read, window.


~~~~~~~~~~~
I am sharing this script in the hope of making everybody's computing life easier.
Even if the ext* partition systems are among the most stable, partition checking
must still be done from time to time, to maintain the health and speed of your
system
. Now you can run this script to "defrag" your drives and properly align
their nodes, check superblocks, etc., and forget about the repetitive typing part.

That said, there are two reasons this script uses the "verbose" mode:
a) you can consult the log that shows up for each drive. If a problem show up, you
will know;
b) each user has his/her personalized partition or drive configuration, which is why
I didn't favor a batch check for partitions.

Please note that this script is not a cure-all for partitions. You may still have to use
the more arcane fsck parameters on partition x or y, if it seems to have problems
like bizarre superblocks, etc.

~~~~~~~~~~~
A little how-to note is in order.

1) On the first boot of your Puppy after the script is installed, the script will run automa-
tically. It takes a few minutes, unfortunately, 'cause there is no hurrying the partition
correction process. Once it has finished, though, you should notice some speed
improvement in the general operation of your Puppy if you had never done a fsck of
your partitions before, or in a long time.

After that first time, though, the script will run automatically once a week. Six days
out of seven, then, a rectangle shows up at launch, towards the top-left of your
screen, saying that the script is active, but that it does not need to run.

If you need to run the script anyway between that time interval, click on the
"automverif" entry in your File System sub-menu, and follow the prompts.

2) The script checks ext2, ext3, ext4 and vfat partitions ONLY. The reason for
this constraint is as follows:

* ntfs partitions can only be checked reliably from a WhineDose OS. The ntfs utilities
on Linux allow the user to read-write on ntfs partitions, but it can only set the check
flag on the ntfs drive, not actually check it.

* there are reports on the Internet that the fsck.reiser utility is the "closest thing to
file system Lotto" http://linuxmafia.com/faq/Filesystems/reiserfs.html. I'm not
all that familiar with reiser fs (except on a KNOPPIX full install), so I decided to play
it safe and NOT offer the choice to use it, even if the utility is included in some
Puppies. Maybe a Puppy-ist with wide reiser fs experience will come up and offer
good advice on this subject, and then the reiserfs choice could be added, but until
then, I'm playing it safe.

* Puppies present a limited choice of file systems (which is OK for our needs, IMO).
If on your computer you have other Linuxes using other file systems, those distros
no doubt have proper partition checking utilities, so use those. The present script
leaves those partitions un-touched until you boot into that other distro to check
the partition(s) it resides on.

3) Don't overuse this script or fsck generally. Using fsck every day -- or worse,
every hour... -- doesn't improve the disk speed.

4) Other scripts are included in this pet, that you may find of use:

* Createfstab -- Populates the default Puppy fstab with whatever partitions blkid
shows up with. For meaningful results, it is important that you mount all your
partitions BEFORE you use this script.
Creating a static fstab comes in handy when you wish to mount or unmount
all your inactive partitions at once. With a static fstab, you can simply enter a terminal and type
Code:
mount -a

OR
Code:
umount -a

and the job is done. To do the same in a dynamic environment, you have to issue
as many mount or unmount commands as you have partitions.

* rep-to-mnt -- Again based on blkid, this script creates a sub-directory in /mnt
for every partition you have on your system, if the proper corresponding sub-folders
are not already in /mnt.

* tunefs25.sh -- This script allows the user to set the mount count (how many times
a partition has been mounted) before fsck does anything. Can be set between 25
and 35 mounts. The "automverif" script ignores it and does a forced fsck anyway,
but it's good to have the option of setting the frequency of fs checks independently.

5) Following a picture hint by some1, starting with version 11, I have excluded
checking all CD / DVD file systems (audiocd, iso9660, udf). In previous versions,
only the iso9660 system was being excluded from the check. (Forgive me, some1!)

Enjoy! Any constructive comment welcome.

musher0

~~~~~~~~~~~~~
NB's. 1) Long list of version changes now condensed in attached zip.
____ 2) The free Monaco TTF font used in this script was taken at
http://www.eaglefonts.com/monaco-ttf-156995.htm#custompreview
It's a TTF Mono font, that is, a very nice non-proportional font usable in a
terminal.
automverif11.txt.zip
Description  Changes log.
zip

 Download 
Filename  automverif11.txt.zip 
Filesize  4.08 KB 
Downloaded  12 Time(s) 
automverif-11b.pet
Description  Latest version.
pet

 Download 
Filename  automverif-11b.pet 
Filesize  71.86 KB 
Downloaded  19 Time(s) 
automverif11.jpg
 Description   
 Filesize   31.42 KB
 Viewed   123 Time(s)

automverif11.jpg

automverif-10.pet
Description  Kept for reference.
pet

 Download 
Filename  automverif-10.pet 
Filesize  71.82 KB 
Downloaded  36 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Tue 08 Apr 2014, 12:11; edited 23 times in total
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


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

PostPosted: Tue 10 Dec 2013, 04:10    Post subject:  

Hi musher; A really useful script.

I`m sure awk will do the grep and cut all in the one awk command.
I`m not an awk expert, best to ask technosaurus about it.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2477
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Tue 10 Dec 2013, 04:37    Post subject: Re: Check all your ext* and vfat partitions automatically
Subject description: ... in one fell swoop! It's not a chore anymore! (:-)
 

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


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

PostPosted: Tue 10 Dec 2013, 12:26    Post subject:  

sunburnt wrote:
Hi musher; A really useful script.

I`m sure awk will do the grep and cut all in the one awk command.
I`m not an awk expert, best to ask technosaurus about it.


Hi, sunburnt.

Thanks for the compliment. As to awk, you're right. I just started, I need to study it more.

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


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

PostPosted: Tue 10 Dec 2013, 12:28    Post subject: Re: Check all your ext* and vfat partitions automatically
Subject description: ... in one fell swoop! It's not a chore anymore! (:-)
 

L18L wrote:
Embarassed


My most sincere condolences for whatever is afflicting you. Wink

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


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

PostPosted: Tue 10 Dec 2013, 17:08    Post subject:  

Updated. See first post.
_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


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

PostPosted: Tue 10 Dec 2013, 20:27    Post subject:  

Hello, all.

I've updated the script to v. 3. Please see first post for details.

Enjoy!

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


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

PostPosted: Wed 11 Dec 2013, 02:59    Post subject:  

Hello, all.

Here's a handy interactive companion for automverif3.sh.

I ran < tune2fs -l > on my ext? drives and the intervals indicated were a mess.
One drive in particular had been mounted 698 times without having been checked.

Linux file systems are reknowned for their stability, and I wasn't worried about the
data access being at risk. Still, that number was no good. An uncleaned partition
gets slower and slower without you noticing it, and affects the reactiveness of your
entire system. I decided to do something about it.

This companion script sets the interval for checking your ext? partitions at a
reasonable interval of between 25 and 35 mounts. It requires your input.

Obviously, you don't access all your partitions at every session, but this way,
fsck will check all your ext? partitions at the same interval, based on the use
of the partition, when you run the automverif?.sh script.

Enjoy!

musher0

~~~~~~~~~~~~~
P.S. Unfortunately, tune2fs doesn't handle vfat partitions. Ring in if you know of
^^^^^ such an utility running in Linux. Thanks in advance.
tuneDisks25.zip
Description 
zip

 Download 
Filename  tuneDisks25.zip 
Filesize  593 Bytes 
Downloaded  92 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


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

PostPosted: Wed 11 Dec 2013, 03:08    Post subject:  

I`m thinking there`s no facility for counting FAT mounts for such a utility.
Like Puppy should check /mnt/home before mounting and check+mounting the Save file.
Simple enough to setup a mount counter to read at boot and do the partition check.

musher; Is this partition checker what you wanted gui help with.?
.

Last edited by sunburnt on Wed 11 Dec 2013, 18:26; edited 1 time in total
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Wed 11 Dec 2013, 11:46    Post subject:  

sunburnt wrote:
I`m thinking there`s no facility for counting FAT mounts for such a utility.
Like Puppy should check /mnt/home before mounting and check+mounting the Save file.
Simple enough to setup a mount counter to read a boot and do the partition check.

musher; Is this partition checker what you wanted gui help with.?
.


Hi, sunburnt and all!

Answering in reverse order:
-- No, that was for the pupsave creation script.
I discovered that ASRI, from the French side of the forum, had already created
such an utility with GUI, at the end of October or thereabouts. It had escaped me.
He's good at what he does, so the pressure is off, there's no rush anymore.

-- IMO, since the partition checker is a rather low-level utility, there's no need for
anything fancy. Besides as it is, the user can move up and down the CLI window
to read the info.

-- As to the first problem: actually, if we use a time stamp, it's just as good, I think.
Drives should not be checked too frequently anyway, it's intensive use of them.
Maybe once every two weeks? This way, we sort of bypass the sad fact that in
Linux, we cannot know the last time a vfat drive was checked.

See my latest version, v.4. (I spent the night debugging it, but I think it was worth it!)
I promise it will be the last version for awhile. (Something like BK's retirement...) Laughing

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Wed 11 Dec 2013, 12:26; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
musher0


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

PostPosted: Wed 11 Dec 2013, 11:48    Post subject:  

Hello, all.

Now up to version to v. 4. Please see first post for details. Thanks.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


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

PostPosted: Wed 11 Dec 2013, 18:28    Post subject:  

Yep, time is almost as good as a counter, the counter is exact of course...
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Wed 11 Dec 2013, 18:39    Post subject:  

sunburnt wrote:
Yep, time is almost as good as a counter, the counter is exact of course...


True, but this is the best we can do if vfat drives. The ext? drives have the counter stored
on them somehow, so they say they're clean when it's not really the time to check them.
But begs the question: how to put a counter on a vfat drive? Maybe there's some doc
from the DOS era about this... BFN.

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
RetroTechGuy


Joined: 15 Dec 2009
Posts: 2635
Location: USA

PostPosted: Wed 11 Dec 2013, 20:10    Post subject:  

musher0 wrote:
sunburnt wrote:
Hi musher; A really useful script.

I`m sure awk will do the grep and cut all in the one awk command.
I`m not an awk expert, best to ask technosaurus about it.


Hi, sunburnt.

Thanks for the compliment. As to awk, you're right. I just started, I need to study it more.


Thanks for the script, Musher. I'll have to give it a try.

I found that AWK was even more obscure than most Linux commands... I had an old script I wrote because I didn't like the way "ls" displayed data (IIRC, using awk and sed to rearrange things).

And it is obscure right down to its name... What does A W K mean?

Aho, Weinberger, and Kernighan...

Boooooo!... Wink

_________________
Wellminded Search
Add swapfile
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Thu 12 Dec 2013, 00:28    Post subject:  

Hi, R.T.G.

I hope you like my little partitions checker.

Yeah, AWK is a bit obscure from the outside. Slow but sure is the way to learn it. But it's
worth it, if only for the ease with which it can juggle items on a line (for example).

[Edited + URL added]
I got really interested when I read an article about a booking DB written in awk in only a few lines.
http://www.freesoftwaremagazine.com/articles/look_mum_no_database_thanks_to_awk

Besides, learning something new keeps my brain cells growing! Smile

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 5 [74 Posts]   Goto page: 1, 2, 3, 4, 5 Next
Post new topic   Reply to topic 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.0844s ][ Queries: 12 (0.0044s) ][ GZIP on ]