Fsck question


 
Thread Tools Search this Thread
Operating Systems Solaris Fsck question
# 1  
Old 03-21-2014
Fsck question

Dear all,


solaris version
--------------------
Code:
Oracle Solaris 10 9/10 s10s_u9wos_14a SPARC
Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
Assembled 11 August 2010

-bash-3.2$ uname -a
SunOS nblabsvr 5.10 Generic_144488-08 sun4u sparc SUNW,SPARC-Enterprise


I'm really confused with the behaviour of fsck. I'm scripting a fsck process to check and mount some FS, yes without rebooting and getting initiated through vfstab. As a condition to initiate a fsck i check the status of the devices using fsck -m. If the check ( fsck -m) returns 0. I consider that a mountable device and i mount it. No issues. Stuff gets mounted and i manged to write to it as well.
To really check the integrity of my script, i unmounted one of the FSs and ran a fsck -Y against the device. Now is the part i cannot comprehend. It says :
Code:
fsck -Y /dev/md/set1/rdsk/d214
** /dev/md/set1/rdsk/d214
** Last Mounted on /netbackup76/logs
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
FILE SYSTEM STATE IN SUPERBLOCK IS WRONG; FIX? yes
547 files, 26131930 used, 26467083 free (171 frags, 3308364 blocks, 0.0% fragmentation)

How can this happen ? if the device is mountable how can it have a wrong state in the superblock ?

This is when things get really interesting.

Following is another device. Check this out.
Code:
fsck -Y /dev/md/set1/rdsk/d220
** /dev/md/set1/rdsk/d220
** Last Mounted on /opt/openv76
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
UNREF DIR I=1569356 OWNER=root MODE=40755
SIZE=512 MTIME=Oct 6 15:23 2011
RECONNECT? yes
DIR I=1569356 CONNECTED. PARENT WAS I=1057
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
LINK COUNT lost+found I=3 OWNER=root MODE=40700
SIZE=8192 MTIME=Nov 14 14:25 2008 COUNT 2 SHOULD BE 3
ADJUST? yes
LINK COUNT DIR I=1569356 OWNER=root MODE=40755
SIZE=512 MTIME=Oct 6 15:23 2011 COUNT 1 SHOULD BE 2
ADJUST? yes
** Phase 5 - Check Cylinder Groups
1202877 files, 83768296 used, 184590193 free (0 frags, 184590193 blocks, 0.0% fragmentation)
***** FILE SYSTEM WAS MODIFIED *****
ORPHANED DIRECTORIES REATTACHED; DIR LINK COUNTS MAY NOT BE CORRECT.
***** PLEASE RERUN FSCK *****

sysop @nblabsvr> sudo fsck -m /dev/md/set1/rdsk/d220
** /dev/md/set1/rdsk/d220
ufs fsck: sanity check: /dev/md/set1/rdsk/d220 okay

It wants me to rerun fsck and at the sametime fsck -m tells me that the device is ready to be mounted.

Now, which one should i believe. I have scripted the process to reduce time of manual intervention. If i can use the -m option and check the devices are actually candidates for fsck i don't mind running it. But, i'm at a juncture of not being able to understand and decide what to believe. Gurus, a way forward please.

cheers
JJ

Last edited by Scott; 03-21-2014 at 05:27 AM.. Reason: Use CODE tags, please...
# 2  
Old 03-21-2014
One thing that comes to my mind is: Did you use sync before umounting or before using fsck ( and after...)? If not, how can you be sure you are not seeing side effects of some cache somewhere?

Then you must remember that systems have evolved and fsck isnt suitable for all cases...
This User Gave Thanks to vbe For This Post:
# 3  
Old 03-21-2014
Quote:
Originally Posted by vbe
One thing that comes to my mind is: Did you use sync before umounting or before using fsck ( and after...)? If not, how can you be sure you are not seeing side effects of some cache somewhere?

Then you must remember that systems have evolved and fsck isnt suitable for all cases...
Thanks again for the reply Vbe, There are FC luns broken away from the consistent relationship.
What i hard to understand is how would fsck -m mark a device as clear and say it needs checking when you are running the fsck -Y.
What would be the best way to script this ?

cheers
JJ
# 4  
Old 03-21-2014
What kind of FC ?
# 5  
Old 03-23-2014
Quote:
Originally Posted by vbe
What kind of FC ?
HDS SI
# 6  
Old 03-24-2014
What you describe is not unusual. Over long periods of time a filesystem may well develop inconsistencies that fsck will pick up and correct. However, even if these inconsistencies are not corrected but the filesystem is mounted and dismounted in an orderly manner, the filesystem remains usable. The 'flags' that fsck -m looks at are indicating that the filesystem was dismounted properly and so could be remounted okay.

However, a fsck check still finds the filesystem needs fixing.

Unreliable FC connections can be a nightmare and give rise to filesystem corruption.

Many fsck implementations support a '-o full' option which will check every last thing on a filesystem although it takes a very long time to run (depending on the filesystem size, of course). I think the Solaris fsck supports this too (but it is often undocumented).

Hope that helps in some way.
These 2 Users Gave Thanks to hicksd8 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

unable to repair the / filesystem. Run fsck manually (fsck -F ufs /dev/rdsk/c1t0d0s0)

What can I fix this issue? I have ran below commands but everything is same.:confused: WARNING: Last shutdown is later than time on time-of-day chip: check date. The / file system (/dev/rdsk/c1t0d0s0) is being checked WARNING - unable to repair the / filesystem. Run fsck manually (fsck -F... (4 Replies)
Discussion started by: getrue
4 Replies

2. UNIX for Dummies Questions & Answers

Fsck error

Hello I own a SPARC Ultra 10 workstation (standalone) and when issuing the fsck command I get the following output on fs C0t0d0s7: Phase 1 (checks blocks and sizes): dada warning: /pci@lf;0/pci@1, 1/ide@3/dad@0,0(dad1): ATA Transport failed:reason, `incomplete'> Uncorrectable data... (2 Replies)
Discussion started by: tjwops
2 Replies

3. UNIX for Dummies Questions & Answers

about fsck

i want to know what does it mean by doing a consistentcy check fsck on a disk and why journaling filesystems dont need to do it and what is meant by disk is in a consistent state when writing because entries are recorded in a journal and then to the metadata and then removed from journal (1 Reply)
Discussion started by: farhan_t49
1 Replies

4. Solaris

fsck -o

Hello I am getting this in dmesg: /mount1: unexpected free inode 1262865, run fsck(1M) -o f What are the options I should use with fsck? thanks (2 Replies)
Discussion started by: melanie_pfefer
2 Replies

5. UNIX for Dummies Questions & Answers

Fsck ques

hy guys I got a ques I cant acess root, i tried to fsck it, but gets errors to read file systems. What steps do you take to recover the host before you see if there is any data corruption on the root drive? Regards Charneet (1 Reply)
Discussion started by: charneet
1 Replies

6. Solaris

fsck run

Hi, Can anybody tell me that is it the command "fsck" can be run by the root account only? Thanks. (2 Replies)
Discussion started by: efang
2 Replies

7. UNIX for Dummies Questions & Answers

fsck - what should be done?

I want to use fsck to check and repair my linux system. When I use this command, what do I need to pay attention to or what should I do to make job running successfully. Thanks for your inputs for a newbie. (3 Replies)
Discussion started by: duke0001
3 Replies

8. Solaris

fsck

OS: Solaris 5.8 Everytime I run fsck -y I get: FILE SYSTEM STATE IN SUPERBLOCK IS WRONG; FIX? yes Do I need to run fsck with the backup superblock option or is there some other option I should use. I have tried the format->analyze->read option but that does not report any corrupt blocks.... (5 Replies)
Discussion started by: run_time_error
5 Replies

9. UNIX for Advanced & Expert Users

fsck with Linux

Hi, I'm running Red Hat 7.1 on an intel. After re-booting from a system crash, I am probpted to run fsck to repair filesystems manually with no options. For example, /: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (ie without -a or -p options) **Dropping you into a shell. ... (2 Replies)
Discussion started by: Breen
2 Replies

10. Filesystems, Disks and Memory

fsck -y

Once in a while, I would think it advisable to run fsck -y to check the disk. Should I sign in as su or sudo? What is the difference and which is preferred? Thank you in Advance! (4 Replies)
Discussion started by: rpatrick
4 Replies
Login or Register to Ask a Question