schedule usb disks check on linux boot

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

schedule usb disks check on linux boot

Postby msdobrescu » Aug 15th, '12, 08:38

Hello,

The fixed disks are automatically scheduled to be checked on boot time.
Can I schedule the usb attached disks check on linux boot too?
If so, how?

Thank you.
msdobrescu
 
Posts: 213
Joined: Jun 2nd, '11, 07:28

Re: schedule usb disks check on linux boot

Postby doktor5000 » Aug 15th, '12, 20:46

Why do you want to do this during boot process, why not do it afterwards when the system is already usable?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18058
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: schedule usb disks check on linux boot

Postby msdobrescu » Aug 15th, '12, 20:54

It is already scheduled by the default setup for the fixed disks.
I do not want to forget checking them, especially when I add a new disk. I have some storage attached permanently to the PC, via USB.
After some time, the new disk might fail.
In my experience, if a disk has to fail, it will do it in the first 3-6 months, then it could live for more than 5 years.
So, automatic check is useful to me.
msdobrescu
 
Posts: 213
Joined: Jun 2nd, '11, 07:28

Re: schedule usb disks check on linux boot

Postby doktor5000 » Aug 15th, '12, 21:17

Set up a fixed mountpoint and mount them automatically, and set it up the same way you did for your fixed disks, maybe?

I won't go on about the overall usefulness, and i already told my opinion about doing this during boot ...
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18058
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: schedule usb disks check on linux boot

Postby msdobrescu » Aug 16th, '12, 08:02

Yeah, you basically are correct. At least, the option when to check (before or after boot) should be implemented.
Let's say you don't have a critical setup, just a home media server as I have, and your system does not depend on the integrity of other disks, except the one with the system of course. Then, the scheduled check should be done after the system boot, and mount the disk later would do no big harm...
msdobrescu
 
Posts: 213
Joined: Jun 2nd, '11, 07:28

Re: schedule usb disks check on linux boot

Postby doktor5000 » Aug 16th, '12, 19:23

You could implement that yourself, mount them via a script after user logon and run an fsck on them, or whatever you want.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18058
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: schedule usb disks check on linux boot

Postby msdobrescu » Aug 16th, '12, 20:04

To my shame, I have no idea on which basis should I count the reboots on my system, as the bootloader does.
I could use a scheduler, of course.
msdobrescu
 
Posts: 213
Joined: Jun 2nd, '11, 07:28

Re: schedule usb disks check on linux boot

Postby doktor5000 » Aug 16th, '12, 21:28

Why do you want to count them? You only wanted the disk to be checked during/after boot, so you can just drop a script into one of the autostart folders and let them mount and check the drives you want to be checked. If you really want to count the reboots, compare the output of
Code: Select all
who -b
. If it did not change, no reboot happened.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18058
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: schedule usb disks check on linux boot

Postby msdobrescu » Aug 16th, '12, 21:53

Because I wouldn't check each time I reboot.
msdobrescu
 
Posts: 213
Joined: Jun 2nd, '11, 07:28

Re: schedule usb disks check on linux boot

Postby doktor5000 » Aug 16th, '12, 22:44

Then just launch the script when you want to check them manually.
Basically you propose that the software should read your mind when you want to check the disks?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18058
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: schedule usb disks check on linux boot

Postby alf » Aug 16th, '12, 23:53

doktor5000 wrote:Basically you propose that the software should read your mind when you want to check the disks?

Well, it should be possible to implement a memory in such a script. ;)
for windows problems reboot; for linux problems be root
alf
 
Posts: 326
Joined: Apr 1st, '11, 23:07
Location: DE Paderborn

Re: schedule usb disks check on linux boot

Postby msdobrescu » Aug 17th, '12, 06:50

I mean, the boot scripts count and check every disk at the 20th reboot at least.
This is not memory reading (not mine, anyway).
It's just a way to avoid checking each time the system reboots.
msdobrescu
 
Posts: 213
Joined: Jun 2nd, '11, 07:28

Re: schedule usb disks check on linux boot

Postby tom_ » Aug 17th, '12, 10:43

so you need to save the number of boots done in a file,
and increment it at each boot.

When the value is 20, yuor script can do the check.
It seems simple!

which languages you know?
tom_
 
Posts: 423
Joined: Sep 3rd, '11, 12:26
Location: Porto Ercole, Italy

Re: schedule usb disks check on linux boot

Postby alf » Aug 17th, '12, 10:55

tom_ wrote:so you need to save the number of boots done in a file,
and increment it at each boot.

When the value is 20, yuor script can do the check.
It seems simple!

which languages you know?


Yes, exactly what i meant. If you are familiar with bash-scripting have a look into this simple script
Attachments
test12.txt
(337 Bytes) Downloaded 67 times
for windows problems reboot; for linux problems be root
alf
 
Posts: 326
Joined: Apr 1st, '11, 23:07
Location: DE Paderborn

Re: schedule usb disks check on linux boot

Postby msdobrescu » Aug 17th, '12, 11:05

Wow..
Thank you.
I don't know sh or similar.
I'm experienced with C, C++, .net, java (and most of them used on Windows...)
msdobrescu
 
Posts: 213
Joined: Jun 2nd, '11, 07:28


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest