openSUSE Forums > Applications » checking disk for errors

Go Back   openSUSE Forums > Applications
Forums FAQ Members List Search Today's Posts Mark Forums Read

Applications Questions about desktops (KDE, Gnome, XFCE, etc.), software applications (configuration, usage, bugs, documentation)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-Jul-2009, 17:46
Student Penguin
 
Join Date: Mar 2009
Location: Germany
Posts: 75
reis3k hasn't been rated much yet
Default checking disk for errors

Hi,
Ubuntu has a default property that after several boot of a partition of hdd, it checks the partition for errors on boot time. Can I apply this to opensuse? How can I manually check my disk for errors? If the electricity went off, it might affect the hdd. Would it be affect the os? Thanks
Reply With Quote
  #2 (permalink)  
Old 04-Jul-2009, 18:54
microchip8's Avatar
Wise Penguin
 
Join Date: Jun 2008
Location: /dev/belgium
Posts: 1,968
microchip8 has a spectacular reputation aura aboutmicrochip8 has a spectacular reputation aura aboutmicrochip8 has a spectacular reputation aura aboutmicrochip8 has a spectacular reputation aura about
Default Re: checking disk for errors

There's a difference between a corrupted filesystem and actual physical damaged blocks on the disk itself. What Ubuntu does is check the filesystem itself which SUSE also does after a set period of time which can be controlled by the tune2fs program (assuming you're using Ext2/3 file system). Also if power goes off suddenly, Ext3 upon boot will replay its journal so you'll be safe (in most cases)

from man tune2fs
Quote:
-i interval-between-checks[d|m|w]
Adjust the maximal time between two filesystem checks. No postfix or d result in
days, m in months, and w in weeks. A value of zero will disable the time-depen-
dent checking.
tune2fs -i 2m /dev/sdXX (replace XX accordingly - will set check interval for 2 months).

To see the interval between checks: tune2fs -l /dev/sdXX (replace XX accordingly)
and look for "Last Checked" and "Check Interval"

if, on the other hand, you want to check the disk itself for physical problems, you can use as root the badblocks utility

badblocks -b 4096 -n -s /dev/sdXX (change XX accordingly)
__________________
My site: http://microchip.bplaced.net
My repo: http://download.opensuse.org/repositories/home:/microchip8
SUSE Unbound Forum: http://suseunbound.lefora.com


Do coders dream of sheep() ?
Reply With Quote
  #3 (permalink)  
Old 04-Jul-2009, 23:48
TaraIkeda's Avatar
Parent Penguin
 
Join Date: Feb 2009
Posts: 564
TaraIkeda hasn't been rated much yet
Default Re: checking disk for errors

Its good in any case, EXT is very good at surviving power outages, as is many Linux filesystems.
This is because of most linux filesystems are journalized and from what I hear thats a very good thing.
Now so far Ubuntu is the only one I know that does a disk check every 20 or so boots, the others not so much but meh its nothing to panic about.

http://en.wikipedia.org/wiki/Journaling_file_system
Reply With Quote
  #4 (permalink)  
Old 05-Jul-2009, 04:45
Chris Maaskant
Guest
 
Posts: n/a
Default Re: checking disk for errors

TaraIkeda wrote:

> Now so far Ubuntu is the only one I know that does a disk check every
> 20 or so boots


Opensuse checks after 60 bootups i believe..
--
Chris Maaskant
Reply With Quote
  #5 (permalink)  
Old 05-Jul-2009, 06:33
Student Penguin
 
Join Date: Mar 2009
Location: Germany
Posts: 75
reis3k hasn't been rated much yet
Default Re: checking disk for errors

I've been using reloaded (kde 4.2.3) version of opensuse 11.1, and when I get info with tune2fs, it hadn't showed any "check interval". So, I can say that opensuse has no default value for "check interval". After I set the interval to 15 day, I got this:

Code:
linux-fxl5:/home/baris # tune2fs -l /dev/sda7
tune2fs 1.41.1 (01-Sep-2008)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          873f94a5-4436-46ff-8b7b-8c01b38e03dc
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              14098432
Block count:              56384125
Reserved block count:     2819206
Free blocks:              48966441
Free inodes:              14083816
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1010
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Filesystem created:       Fri May 29 18:44:54 2009
Last mount time:          Sun Jul  5 12:08:25 2009
Last write time:          Sun Jul  5 13:19:12 2009
Mount count:              169
Maximum mount count:      -1
Last checked:             Fri May 29 18:44:54 2009
Check interval:           1296000 (2 weeks, 1 day)
Next check after:         Sat Jun 13 18:44:54 2009
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      748ddf23-697a-4b29-801f-6cc078846a0c
Journal backup:           inode blocks
When I was using ubuntu, it doesn't allow you to cancel disk check in boot time, which is sometime quite disturbing if want a quick reboot. NTFS is also using journaling file system,but after a improper shutdown to the system, it always results bad situations for me. Are there any difference between the journaling system of EXT3 and NTFS?

Regards,
Reply With Quote
  #6 (permalink)  
Old 05-Jul-2009, 06:52
microchip8's Avatar
Wise Penguin
 
Join Date: Jun 2008
Location: /dev/belgium
Posts: 1,968
microchip8 has a spectacular reputation aura aboutmicrochip8 has a spectacular reputation aura aboutmicrochip8 has a spectacular reputation aura aboutmicrochip8 has a spectacular reputation aura about
Default Re: checking disk for errors

That's very strange that suse doesn't set a check interval. IIRC, check interval is not controlled by suse itself but by mkfs.ext3 which automatically sets it for 2 months and I don't think suse disables this as it will be very stupid to do so. Are you sure you have created your partition with SUSE? Because if you have, the check interval will always be set as I've never experienced partitions created by SUSE to not have a check interval.

Yes, there are differences between journaling NTFS and Ext3. The check interval in Ext3 is there to ensure proper filesystem consistency. In case there's a kernel bug, a bad disk cable or something else which can *silently* corrupt the filesystem, the check interval ensures consistency after ext3 runs a check. IIRC, NTFS does not have such a feature (auto check interval) and only replays its journal after a power failure / unclean shutdown, but this alone will not catch possible kernel bugs/cable problems which may corrupt the filesystem. Checks are *not* meant to be interrupted as it can bring problems. I, for one, have completely disabled check intervals on my ext3 partitions and never had any problems in doing so. Ext3 has a robust enough journaling technology (though not perfect)

Further, NTFS uses meta-data only logical journaling whereas Ext3 uses ordered meta-data physical journaling which can be much more robust in specific cases (but also slower, mostly due to the physical journaling which overwrites a whole block instead of only commiting the changes to that block as done by logical journaling). However, latest version of NTFS has added transactional atomic support which ensures that in specific cases, if a transaction does not finish due to interruption like a power failure, it won't show up on next boot (rollback). If a transaction finishes (success) and then a power failure occurs, it most certainly will show up on next boot
__________________
My site: http://microchip.bplaced.net
My repo: http://download.opensuse.org/repositories/home:/microchip8
SUSE Unbound Forum: http://suseunbound.lefora.com


Do coders dream of sheep() ?
Reply With Quote
  #7 (permalink)  
Old 05-Jul-2009, 07:12
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,109
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: checking disk for errors

Quote:
Originally Posted by microchip8 View Post
That's very strange that suse doesn't set a check interval. IIRC, check interval is not controlled by suse itself but by mkfs.ext3 which automatically sets it for 2 months and I don't think suse disables this as it will be very stupid to do so. Are you sure you have created your partition with SUSE? Because if you have, the check interval will always be set as I've never experienced partitions created by SUSE to not have a check interval.
I didn't think so too, but I just looked at a 11.1 EXT3 superblock with tune2fs -l, and this is part of the result.

Quote:
Maximum mount count: -1
...
Check interval: 0 (<none>)
There are two types of check counters in EXT3, a max mount count and a check interval. Both can be enabled or disabled separately.

However I do know that openSUSE does check from time to time and I don't know at the moment how or where it forces that check. Maybe someone with time to kill can look through the startup scripts and work it out.
Reply With Quote
  #8 (permalink)  
Old 06-Jul-2009, 07:23
Student Penguin
 
Join Date: Mar 2009
Location: Germany
Posts: 75
reis3k hasn't been rated much yet
Default Re: checking disk for errors

Quote:
Originally Posted by microchip8 View Post
That's very strange that suse doesn't set a check interval. IIRC, check interval is not controlled by suse itself but by mkfs.ext3 which automatically sets it for 2 months and I don't think suse disables this as it will be very stupid to do so.
Actually, there was no line as "Check interval" and "Next check after", before I set the check intervals to 15 days. It might be that tune2fs -l didn't show the default values for them as well, if you say that check interval is 2 months.
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2