Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

fsck at shutdown, with a twist

User discussion about Debian Development, Debian Project News and Announcements. Not for support questions.
Post Reply
Message
Author
User avatar
Rolling Stone
Posts: 366
Joined: 2009-02-15 18:55
Location: Turku, Finland

fsck at shutdown, with a twist

#1 Post by Rolling Stone »

fsck is a pretty annoying little thing. I just had it suck some of my precious bodily fluids this morning when flipping my box on.

But it could be made a lot less so by having it do its thing at shutdown rather than at startup. Now, I've heard that you cannot do this because you need to run it on read-only disks to prevent data loss or something similar so it can only be run at startup.

But, what about if we modify the shutdown process to actually do a restart for us, run fsck and then shutdown. At the next actual startup it should work normally again. I guess this would be quite possible to implement but should be rigorously debugged so we don't end up in a never-ending loop.

OK, so where's the fault in my reasoning? :)

emariz
Posts: 2901
Joined: 2008-10-17 07:59

Re: fsck at shutdown, with a twist

#2 Post by emariz »

Rolling Stone wrote:where's the fault in my reasoning?
Use JFS and enjoy.

User avatar
julian67
Posts: 4633
Joined: 2007-04-06 14:39
Location: Just hanging around
Been thanked: 7 times

Re: fsck at shutdown, with a twist

#3 Post by julian67 »

Rolling Stone wrote:fsck is a pretty annoying little thing. I just had it suck some of my precious bodily fluids this morning when flipping my box on.
If you use ext4 the filesystem checking is in seconds, not minutes, even on filesystems of 100s of GB. Checking the filesystems when they were ext3 (before I converted them) would take many times longer. This is an ext4 filesystem with extents enabled. It's almost completely full and contains mostly very large files, up to DVD9 size.

Code: Select all

/dev/sdc6             425G  408G   18G  96% /home/julian/Video

Code: Select all

# umount Video

Code: Select all

 time e2fsck -f /dev/sdc6
e2fsck 1.41.9 (22-Aug-2009)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Video: 13317/28286976 files (1.6% non-contiguous), 108598488/113117673 blocks

real	0m47.953s
user	0m15.000s
sys	0m0.372s
Wisdom from my inbox: "do not mock at your pottenocy"

hameau
Posts: 257
Joined: 2008-11-13 17:42
Location: France

Re: fsck at shutdown, with a twist

#4 Post by hameau »

Rolling Stone wrote:OK, so where's the fault in my reasoning?
There is no fault in your reasoning -- you're just a couple of years too late. ;) I've been using AutoFsck since before my OS went from brown to blue and it's very useful. There's nothing worse than starting up your laptop in front a client and being faced with an embarrassing wait for fsck.

User avatar
Rolling Stone
Posts: 366
Joined: 2009-02-15 18:55
Location: Turku, Finland

Re: fsck at shutdown, with a twist

#5 Post by Rolling Stone »

Thanks for the replies. Can you convert a FS full of data? Which one should I pick?
AutoFsck - Technical Review wrote: AutoFsck actually doesn't check the filesystems on shutdown; it reboots your computer and then performs the check on startup, before shutting down your computer again.

There are a myriad of obvious problems with this approach; the major two being dual boot scenarios and kernel upgrades.
Dual booting is of no concern to me but what about kernel upgrades, and what might myriad of obvious problems mean?

hameau
Posts: 257
Joined: 2008-11-13 17:42
Location: France

Re: fsck at shutdown, with a twist

#6 Post by hameau »

Rolling Stone wrote:Dual booting is of no concern to me but what about kernel upgrades, and what might myriad of obvious problems mean?
You'll have to ask the author of the review about the problems.

I use autofsck on two machines:
  • Desktop, single boot to Squeeze -- partial reboot to read-only, fsck and then shutdown;
  • Laptop, dual-boot Squeeze and Windows -- fsck after remounting read-only, during shutdown.
Not an exhaustive test fleet, I agree, but it has worked for me on several versions of Ubuntu and subsequently on Lenny and Squeeze, without incident. [touch]wood[/touch]

(Aside)
Having now read the linked review to the end, it seems somewhat disingenuous. I have no idea who the author is, but posting to the ubuntu-devel list and with an e-mail address at canonical.com, I presume he is close to Ubuntu. His comments demonstrate a failure to read the autofsck wiki page as well as somewhat missing the point.

Autofsck was a private effort. It works, even if it isn't pretty, and adequately addresses a perceived shortcoming that no-one at Ubuntu (or anywhere else, it seems) was interested in. It may not be absolutely robust and it may have unforeseen effects if things don't go right. If he doesn't like it, he could always invent a better mousetrap. There is still, more than two years on, no alternative official arrangement, autofsck remains a private effort and the timing of the standard file-system check remains an embarrassment.
Nick.

User avatar
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: fsck at shutdown, with a twist

#7 Post by bugsbunny »

Rolling Stone wrote:Thanks for the replies. Can you convert a FS full of data? Which one should I pick?
ext3 to ext4: Ext4 Howto - Ext4

User avatar
Rolling Stone
Posts: 366
Joined: 2009-02-15 18:55
Location: Turku, Finland

Re: fsck at shutdown, with a twist

#8 Post by Rolling Stone »

Thanks again guys. I will meditate now.

Post Reply