View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 14 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Jul 19, 2009 12:08 pm 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
A friend told me that the e2fsck program could be set to scan your hard disk partitions on the next boot. He said it sets a flag to force a scan on the next boot of the system - before the partitions are mounted by the system.

http://man.linuxmanpages.com/man8/e2fsck.8.php

I just looked over the man page for e2fsck and don't see any references to forcing a scan on the next reboot.

Is my friend wrong?

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 19, 2009 12:24 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
No, he's right. You can even get shutdown to trigger it using the "-F" flag if memory serves.

Now if I could just remember how to delay it so when I'm doing testing it doesn't trigger every 32 boots (that goes by really fast sometimes). ;-)

BTW - Thanks for reminding me to look this up, tune2fs is the utility that lets you fiddle these params.


Top
 Profile  
 
 Post subject: any idea which switch?
PostPosted: Sun Jul 19, 2009 1:05 pm 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
Do you see any of the e2fsck switches that look like they would force the scan on next boot? None look obvious to me.

Appreciated,
Eric

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 19, 2009 2:51 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
Code:
# shutdown -rF now


From the shutdown man page:

Quote:
The -F flag means `force fsck'. This only creates an advisory file /forcefsck which can be tested by the system when it comes up again. The boot rc file can test if this file is present, and decide to run fsck(1) with a special `force' flag so that even properly unmounted filesystems get checked. After that, the boot process should remove /forcefsck.


Alternatively, you can Login as the root, change directory to root (/) directory and manually create that empty file named forcefsck (source for that little trick).:

Code:
 $ su -
# cd /
# touch /forcefsck

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject: all partitions?
PostPosted: Sun Jul 19, 2009 3:10 pm 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
Any idea if
Code:
# shutdown -rF now
will force a scan of all partitions - specifically the /myth partition (/dev/sda3)?

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 19, 2009 4:12 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
I believe it will run through all the partitions in your /etc/fstab assuming you haven't set them to 0 in the 6th column (pass or fsck options).

Code:
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
none                   /dev/pts      devpts    defaults            0      0
none                   /dev/shm      tmpfs     defaults            0      0

LABEL=Arch   /       ext4    defaults,noatime     0       1
LABEL=Homes   /home   ext4    defaults,noatime     0       2
LABEL=Data   /media/data        ntfs-3g defaults,noatime        0       0
/dev/sda5   swap    swap    defaults        0       0
/dev/dvd   /media/dvd  auto    ro,user,noauto,unhide   0      0

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject: it worked - scan ran
PostPosted: Mon Jul 20, 2009 7:02 pm 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
This is a scan of sda3 - the /myth partition.
Does 13% fragmentation seem like a lot?

Code:
Log of fsck -C -R -A -a -f
Mon Jul 20 19:24:54 2009

fsck 1.40.6 (09-Feb-2008)
/dev/sda3: 2124/121241600 files (13.2% non-contiguous), 162771377/242477077 blocks

Mon Jul 20 19:47:11 2009

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
 Post subject: Re: it worked - scan ran
PostPosted: Tue Jul 21, 2009 1:52 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
neutron68 wrote:
This is a scan of sda3 - the /myth partition.
Does 13% fragmentation seem like a lot?

Code:
Log of fsck -C -R -A -a -f
Mon Jul 20 19:24:54 2009

fsck 1.40.6 (09-Feb-2008)
/dev/sda3: 2124/121241600 files (13.2% non-contiguous), 162771377/242477077 blocks

Mon Jul 20 19:47:11 2009


In my mind, yeah it does seem like too much. Others may disagree.

What is the file system of /dev/sda3? Ext3 or...? Unless it's XFS, I don't think you can use a defragger on it (ext2/ext3 for example). Have a look at this howto for more on XFS and XFS defragging. There is also a section in the howto with info that should help you avoid future fragmentation, but as file systems age, they also become fragmented (so long as they are being used as they age). If you have less than 20 % free space, this too can contribute to fragmentation.

You can defrag an ext3 partition if you literally copy all the files off it, reformat it, and copy them back. If you're gonna go through the trouble of doing that, you might as well use a filesystem designed for large files (XFS) and one that has an online defragger :)

Your other option is to just leave it and wait for R6 to go final. The 2.6.29 and above kernel support ext4 which is rumored to have an online defragger although as of right now as I write this reply, no such util is stable to my knowledge.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject: /myth is ext3
PostPosted: Tue Jul 21, 2009 4:33 pm 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
The /myth partition is ext3. The 1TB drive is about 70% full.

I record and delete about 2GB a day.

I started wondering about fragmentation, when I saw a standard definition recording being made a week or 2 ago, and the hard drive access LED was blinking more rapidly than it used to do during a standard definition recording, from the PVR-150 card. With standard definition recordings, the hard drive light used to blink maybe 1 time per second. Now it is more like 5 times per second. This has become a trend, so I suspected fragmentation.

Eric

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
 Post subject: Re: it worked - scan ran
PostPosted: Wed Jul 22, 2009 1:34 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
Probably best to switch to XFS in your situation...

graysky wrote:
Have a look at this howto for more on XFS and XFS defragging. There is also a section in the howto with info that should help you avoid future fragmentation, but as file systems age, they also become fragmented (so long as they are being used as they age). If you have less than 20 % free space, this too can contribute to fragmentation.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 22, 2009 8:12 pm 
Offline
Joined: Wed Apr 28, 2004 10:42 pm
Posts: 405
Location: Bendigo, Victoria, Australia
tjc wrote:
No, he's right. You can even get shutdown to trigger it using the "-F" flag if memory serves.

Now if I could just remember how to delay it so when I'm doing testing it doesn't trigger every 32 boots (that goes by really fast sometimes). ;-)

BTW - Thanks for reminding me to look this up, tune2fs is the utility that lets you fiddle these params.


Does anyone know of an easy way to skip fsck on a the current boot?
I can hit control-c but then it doesn't mount the partition and I still can't use the system. Apparently on Ubuntu you can hit escape to delay it until the next boot, does this work on Knoppmyth? (I read this after it had already done the scan.)
If there isn't something as simple as a keypress I will add an option to the Knoppmyth menu to "Reboot without fsck." so that I can at least shorten the process a bit.

_________________
Paul Turpie
-------------
<--Is your location in your profile? Why not?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 23, 2009 9:06 am 
Offline
Joined: Fri Sep 15, 2006 12:16 pm
Posts: 292
turpie wrote:
Does anyone know of an easy way to skip fsck on a the current boot?
I can hit control-c but then it doesn't mount the partition and I still can't use the system.

Google says we used to do this in Ubuntu before they added it to the distro:

See man e2fsck.conf(5). Create a file /etc/e2fsck.conf, with the
contents:

[options]
allow_cancellation = true

Then you should be able to type ^C while it is doing a check, and
cancel the fsck. (It is safe to abort fsck while it is scanning the
filesystem.)


Top
 Profile  
 
 Post subject: Re: all partitions?
PostPosted: Thu Jul 23, 2009 9:14 am 
Offline
Joined: Fri Sep 15, 2006 12:16 pm
Posts: 292
neutron68 wrote:
Any idea if
Code:
# shutdown -rF now
will force a scan of all partitions - specifically the /myth partition (/dev/sda3)?


To force a scan on a particular partition use:
Code:
tune2fs -C 9999 /dev/sda3


This assumes that you have a scan set up for every say 30 mounts. It sets the current mount count to 9999. If you have tweaked your ext file system to use time based fsck you would need to run
Code:
man tune2fs

and look for the time based fsck options.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 23, 2009 5:29 pm 
Offline
Joined: Wed Apr 28, 2004 10:42 pm
Posts: 405
Location: Bendigo, Victoria, Australia
cliffsjunk wrote:
See man e2fsck.conf(5). Create a file /etc/e2fsck.conf, with the
contents:

[options]
allow_cancellation = true

Then you should be able to type ^C while it is doing a check, and
cancel the fsck.

Thanks Cliffsjunk,
I give that a go this weekend.

_________________
Paul Turpie
-------------
<--Is your location in your profile? Why not?


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 10 guests


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 post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu