LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 09-17-2013, 11:45 PM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
Do file systems need fscking?


Conventional wisdom is that file systems need periodic fscking but is it always the best approach?

Ubuntu think not. On a default installation they disable boot time fsck on at least ext* file systems. Bug https://bugs.launchpad.net/ubuntu/+s...s/+bug/1083985 refers. From that bug page: "This was an intentional change in e2fsprogs. The periodic check is pretty pointless and annoying so it was disabled by default".

Maybe Ubuntu's decision came from prioritising user convenience over data integrity. Maybe their target users wouldn't know what to do if fsck generated a prompt for interaction. Maybe it's a good choice in Ubuntu's situation.

Theodore T'so, the ext4 developer, consistently says fscking is necessary and he should know. Sorry -- can't find any links now.

When block devices are provided by iSCSI they cannot be fscked at boot when processing fstab because they don't exist; they are not created until the iSCSI client/initiator service is running. There are a lot of pages on the 'net about this issue but none of the pages I found mention a way of periodically fscking such devices; the usual solution is simply to use option _netdev to defer mounting.

That suggests there are many file systems on iSCSI devices which are not periodically fscked. They are unlikely to be used with personal computers; iSCSI is mostly used with servers. So data integrity is more important and systems administration skills are more available.

Is the world moving away from periodic fscking?
 
Old 09-18-2013, 02:16 AM   #2
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,159

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
mostly used servers (NAS) are continuously online, the boot time fsck has no any meaning.
 
Old 09-18-2013, 03:07 AM   #3
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,467
Blog Entries: 11

Rep: Reputation: 184Reputation: 184
Maybe do a fsck on the machine providing the iSCSI target. Something like: we have an unmount okay lets clean it up. Whos turn is it. fsck's.

Honestly I never had any thoughts about fscking my filesystems and let the system handle it. With journals beeing around for quite some time now fsck at start up is realy fast as it does not need to check on all the files but only those in the journal. As for manually doing fsck I seldomly do. I somewhat must say for me this is forgotten lore so you might be right with the world moving away from periodic fsck. I guess mostly due to high uptime needs or no scheduled mantainance intervals.
 
Old 09-18-2013, 05:18 AM   #4
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbang
Posts: 661
Blog Entries: 1

Rep: Reputation: 144Reputation: 144
I can't comment on corporate and enterprise setups, but for my personal computer, I don't see it as vital. Good backups of one's data is far more important. Modern file systems are designed to be 'self-healing' as far as I know and all of the data recovery I've done for friends and relatives revolve around fat32 formatted flash memory cards. (usually for cellphones, which don't do any filesystem checks.)

Just my 2c worth!
 
Old 09-18-2013, 09:52 PM   #5
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 8,247

Rep: Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557
My experience accord with qlue's. I've only run fsck when I've had a problem, and that's been very rare.

I notice, though, that many distros are set by default to fsck the root partition after X number of reboots (X usually seems to equal 27 or 28). That is controlled by the sixth field in /etc/fstab.

Here's an excerpt from man fstab:

Code:
 The sixth field (fs_passno).
              This field is used by the fsck(8) program to  determine  the  order  in  which
              filesystem  checks  are  done  at  reboot time.  The root filesystem should be
              specified with a fs_passno of 1, and other filesystems should have a fs_passno
              of  2.   Filesystems within a drive will be checked sequentially, but filesys‐
              tems on different drives will be checked at the same time to utilize parallel‐
              ism  available  in the hardware.  If the sixth field is not present or zero, a
              value of zero is returned and fsck will assume that the  filesystem  does  not
              need to be checked.
 
Old 09-18-2013, 10:18 PM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Quote:
Originally Posted by qlue View Post
Modern file systems are designed to be 'self-healing'
This "self healing" is done via fsck during boot. Seriously, with a somewhat modern filesystem (for example ext4 or jfs) fsck during boot usually is less than 5 seconds even on very large drives. So if you do it as recommended (usually every 25-35 mounts or 180 days) it doesn't harm anyone and you are on the safe side.
 
Old 09-18-2013, 10:27 PM   #7
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,592

Rep: Reputation: 188Reputation: 188
Journaling file systems can heal themselves when they are mounted by checking out the entries in the journal. This is far faster than fscking the entire file system and may make fsck redundant for journaling file systems like ext3 and ext4. Ubuntu's disabling of fsck checks at boot is probably a reasonable thing to do.

------------------------
Steve Stites

Last edited by jailbait; 09-18-2013 at 10:32 PM.
 
Old 09-18-2013, 10:30 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Unless you get a power-outage.
 
Old 09-19-2013, 12:57 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Original Poster
Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
I found one of the Ted T'so mailings. It's from August 2009 (original at http://comments.gmane.org/gmane.linux.documentation/688, quoted at http://lwn.net/Articles/349005/)
Quote:
Is it *necessary*? In a world where hardware is perfect, no. In a
world where people don't bother buying ECC memory because it's 10%
more expensive, and PC builders use the cheapest possible parts --- I
think it's a really good idea.
 
Old 09-19-2013, 09:18 AM   #10
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,592

Rep: Reputation: 188Reputation: 188
"Unless you get a power-outage."

Including power outages. Everything that is being updated in the file system when the power outage hits is recorded in the journal.

http://en.wikipedia.org/wiki/Journaling_file_system

-----------------------
Steve Stites
 
Old 09-19-2013, 09:50 AM   #11
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Quote:
Originally Posted by jailbait View Post
"Unless you get a power-outage."

Including power outages. Everything that is being updated in the file system when the power outage hits is recorded in the journal.

http://en.wikipedia.org/wiki/Journaling_file_system

-----------------------
Steve Stites
Only if your filesystem is running in data=ordered mode, which some filesystems (XFS, BTRFS) aren't by default.
 
Old 09-19-2013, 08:08 PM   #12
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Original Poster
Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
From the tune2fs man page (e2fsprogs-1.42.6 version):
Quote:
You should strongly consider the consequences of disabling mount-count-dependent checking entirely. Bad disk drives, cables, memory, and kernel bugs could all corrupt a filesystem without marking the filesystem dirty or in error. If you are using journaling on your filesystem, your filesystem will never be marked dirty, so it will not normally be checked. A filesystem error detected by the kernel will still force an fsck on the next reboot, but it may already be too late to prevent data loss at that point
 
Old 09-19-2013, 09:41 PM   #13
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 8,247

Rep: Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557
I've had the experience of a power failure (which reminds me, my UPS needs a new battery) and seeing the "recovering journal" message on boot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Let's build our own fscking Internet. alan_ri General 7 09-01-2012 04:07 PM
Read only file systems, custom live CDs, and embedded systems coffeecoffee Linux - Newbie 2 02-25-2009 12:09 AM
udev and fscking jmoody Linux - Software 0 10-18-2007 12:25 PM
fscking problems microsoft/linux Debian 18 11-27-2006 03:13 PM
fscking an encrypted partition bungalowbill Linux - General 3 04-30-2004 10:04 AM


All times are GMT -5. The time now is 05:17 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration