LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-07-2018, 02:15 PM   #1
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 9, SH4, Debian
Posts: 367

Rep: Reputation: 8
FSCK non-root filesystem after each boot


I want to check non-root filesystem after each boot. But I want do do it via fstab parameters and tune2fs. Of course first I need to

Code:
tune2fs -c 1 /dev/sda1
But I want FSCK to be done with -y option, that is automatically fix any problem. Is it possible?

Last edited by mackowiakp; 04-07-2018 at 02:16 PM. Reason: Ortography
 
Old 04-07-2018, 06:37 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
The periodic check options are ignored by default these days - the filesystem will be automatically checked at every mount by current e2fsprogs. This is not well (badly) documented in the manpages.
How boot-time mounts are handled is a funtion of your init system. Which is of course distro dependent - and systemd changed that significantly too.
 
Old 04-07-2018, 11:31 PM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
You could write a script to do it, and run it each boot.
 
Old 04-08-2018, 12:03 AM   #4
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 9, SH4, Debian
Posts: 367

Original Poster
Rep: Reputation: 8
Of course, it is possible to write such script. But my system is Raspberry Pi 3B with Jessie system. I use it as unit to collect data from measuring sensors to MySQL DB. All temporary file, including MySQL tmp files are moved from SD card to ramdisk. It works 365/24. All data are collected on SSD USB attached disk. So reboots accrues very rarely. The problem is that hardware watchdog from particular sensor, restarts RPi after 5 sec of inactivity. No way to change this time. So I want to FSCK attached USB disk during boot.
One more question. Is it better to use -p or -y option for FSCK, to make FSCK process fully non-interactive, fully automatic.
 
Old 04-08-2018, 01:19 AM   #5
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
You should use both p and y for noninteractive repair. And I don't see what the rest of your post has to do with making a script. Just run it a cron job each reboot. Or, make it a service that runs on boot.
 
Old 04-08-2018, 03:01 AM   #6
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 9, SH4, Debian
Posts: 367

Original Poster
Rep: Reputation: 8
As I wrote, its because of hardware watchdog. It simply turn off/on power without shutdown system. I try to write script but the timeout of watchdog if to short to execute it from rc.local of /etc/init.d. It must be done during filesystem mount from fstab. Watchdog activates itself when this one particular process is finished. It is piece of hardware (based on ATTiny) and it interprets several communicates from TTY console. No way to modify it in way necessary for me.
 
Old 04-08-2018, 10:31 PM   #7
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
OK, I understand now. I don't think it will work from fstab anymore.
 
  


Reply

Tags
fix, fsck, fstab



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Debian doesn't fsck non-root partitions at boot the98 Debian 4 12-14-2014 07:43 PM
fsck not checking non-root file system at boot time... robertjinx Slackware 2 04-21-2011 03:28 PM
How do I keep a filesystem from being checked with fsck at boot time? ccmelton Linux - General 1 05-10-2006 11:32 AM
fsck on root filesystem without reboot? Barx Linux - General 3 03-29-2005 03:55 AM
Run fsck on root (/) at boot Sako73 Linux - Newbie 2 12-02-2004 02:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration