* clean unmount?
@ 2003-03-07 5:26 anil vijarnia
2003-03-10 23:12 ` Bryan Henderson
0 siblings, 1 reply; 6+ messages in thread
From: anil vijarnia @ 2003-03-07 5:26 UTC (permalink / raw)
To: linux-fsdevel
hi everybody!
can anyone tell me how at bootup time the filesystem is checked
for clean unmount,i mean which flags are set by umount() and
checked at bootup time(paricularly the FAT filesystem).also which
part of code checks this thing and calls 'fsck'
prog. if necessary.
regards
vijarnia
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: clean unmount?
2003-03-07 5:26 clean unmount? anil vijarnia
@ 2003-03-10 23:12 ` Bryan Henderson
2003-03-10 23:23 ` Matthew Wilcox
0 siblings, 1 reply; 6+ messages in thread
From: Bryan Henderson @ 2003-03-10 23:12 UTC (permalink / raw)
To: anil vijarnia; +Cc: linux-fsdevel
>can anyone tell me how at bootup time the filesystem is checked
>for clean unmount,i mean which flags are set by umount() and
>checked at bootup time(paricularly the FAT filesystem).also which
>part of code checks this thing and calls 'fsck'
>prog. if necessary.
The fsck gets called unconditionally; Depending on invocation options, Fsck
determines whether the filesystem was unmounted cleanly and based on the
results, does or does not scan the filesystem.
I don't know how the "clean unmount" information is represented in FAT.
Frankly, I'm surprised it is at all, since DOS doesn't have fsck.
I also don't know which program in your system calls 'fsck'; it varies from
one system to the next. But it's in one of the startup scripts; it
shouldn't be hard to locate.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: clean unmount?
2003-03-10 23:12 ` Bryan Henderson
@ 2003-03-10 23:23 ` Matthew Wilcox
2003-03-10 23:48 ` Andries Brouwer
0 siblings, 1 reply; 6+ messages in thread
From: Matthew Wilcox @ 2003-03-10 23:23 UTC (permalink / raw)
To: Bryan Henderson; +Cc: anil vijarnia, linux-fsdevel
On Mon, Mar 10, 2003 at 03:12:31PM -0800, Bryan Henderson wrote:
> I don't know how the "clean unmount" information is represented in FAT.
> Frankly, I'm surprised it is at all, since DOS doesn't have fsck.
Hmm.. I saw it mentioned somewhere... ah, found it:
OSR2 includes versions of the Io.sys and Win.com files that check the
Clean Shutdown and Hard Disk Error bits in the Virtual File Allocation
Table (VFAT) during startup. If either of these bits is turned on (that
is, cleared to 0) on any drive present in real mode, you are prompted to
run ScanDisk.
The Clean Shutdown and Hard Disk Error bits are the two low-order bits of
the FAT entry for cluster 1. If bit 0 is 0, it indicates an unclean
shutdown; if bit 1 is 0, it indicates that a hard disk error occurred on
that drive. These bits are turned on by VFAT; they are turned off only by
ScanDisk. The Clean Shutdown bit is turned off upon completion of a
standard run. The Hard Disk Error bit is turned off upon completion of a
surface scan (regardless of whether errors were repaired).
If either of these bits is on for a real-mode drive, Win.com displays the
appropriate error message.
--
"It's not Hollywood. War is real, war is primarily not about defeat or
victory, it is about death. I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: clean unmount?
2003-03-10 23:23 ` Matthew Wilcox
@ 2003-03-10 23:48 ` Andries Brouwer
2003-03-13 4:40 ` H. Peter Anvin
0 siblings, 1 reply; 6+ messages in thread
From: Andries Brouwer @ 2003-03-10 23:48 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Bryan Henderson, anil vijarnia, linux-fsdevel
On Mon, Mar 10, 2003 at 11:23:22PM +0000, Matthew Wilcox wrote:
> > I don't know how the "clean unmount" information is represented in FAT.
>
> OSR2 includes versions of the Io.sys and Win.com files that check the
> Clean Shutdown and Hard Disk Error bits in the Virtual File Allocation
> Table (VFAT) during startup. If either of these bits is turned on (that
> is, cleared to 0) on any drive present in real mode, you are prompted to
> run ScanDisk.
>
> The Clean Shutdown and Hard Disk Error bits are the two low-order bits of
> the FAT entry for cluster 1. If bit 0 is 0, it indicates an unclean
> shutdown; if bit 1 is 0, it indicates that a hard disk error occurred on
> that drive. These bits are turned on by VFAT; they are turned off only by
> ScanDisk. The Clean Shutdown bit is turned off upon completion of a
> standard run. The Hard Disk Error bit is turned off upon completion of a
> surface scan (regardless of whether errors were repaired).
My docs say "high-order" instead of "low-order".
Are there people with a Windows system so that they can check?
Andries
http://www.win.tue.nl/~aeb/linux/fs/fat/fat-1.html#ss1.3.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: clean unmount?
2003-03-10 23:48 ` Andries Brouwer
@ 2003-03-13 4:40 ` H. Peter Anvin
0 siblings, 0 replies; 6+ messages in thread
From: H. Peter Anvin @ 2003-03-13 4:40 UTC (permalink / raw)
To: linux-fsdevel
Followup to: <20030310234800.GA4357@win.tue.nl>
By author: Andries Brouwer <aebr@win.tue.nl>
In newsgroup: linux.dev.fs.devel
>
> My docs say "high-order" instead of "low-order".
> Are there people with a Windows system so that they can check?
>
> Andries
>
> http://www.win.tue.nl/~aeb/linux/fs/fat/fat-1.html#ss1.3.1
>
The FAT spec claims it's the high bits, which makes sense because
0x..FF8 and 0x..FFF are all technically valid EOCs (in fact, Linux for
a long time wrote 0x...FF8 instead of the correct 0x...FFF):
For FAT16 and FAT32, the file system driver may use the high two bits
of the FAT[1] entry for dirty volume flags (all other bits, are always
left set to 1). Note that the bit location is different for FAT16 and
FAT32, because they are the high 2 bits of the entry. For FAT16:
ClnShutBitMask = 0x8000; HrdErrBitMask = 0x4000; For FAT32:
ClnShutBitMask = 0x08000000; HrdErrBitMask = 0x04000000; Bit
ClnShutBitMask If bit is 1, volume is clean . If bit is 0, volume
is dirty . This indicates that the file system driver did not
Dismount the volume properly the last time it had the volume
mounted. It would be a good idea to run a Chkdsk/Scandisk disk repair
utility on it, because it may be damaged. Bit HrdErrBitMask If this
bit is 1, no disk read/write errors were encountered. If this bit is
0, the file system driver encountered a disk I/O error on the Volume
the last time it was mounted, which is an indicator that some sectors
may have gone bad on the volume. It would be a good idea to run a
Chkdsk/Scandisk disk repair utility that does surface analysis on it
to look for new bad sectors.
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
^ permalink raw reply [flat|nested] 6+ messages in thread
* clean unmount?
@ 2003-03-07 5:24 anil vijarnia
0 siblings, 0 replies; 6+ messages in thread
From: anil vijarnia @ 2003-03-07 5:24 UTC (permalink / raw)
To: linux-fsdevel
hi everybody!
can anyone tell me how at bootup time the filesystem is checked
for clean unmount,i mean which flags are set by umount() and
checked at bootup time(paricularly the FAT filesystem).also which
part of code checks this thing and calls 'fsck'
prog. if necessary.
regards
vijarnia
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-03-13 4:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-07 5:26 clean unmount? anil vijarnia
2003-03-10 23:12 ` Bryan Henderson
2003-03-10 23:23 ` Matthew Wilcox
2003-03-10 23:48 ` Andries Brouwer
2003-03-13 4:40 ` H. Peter Anvin
-- strict thread matches above, loose matches on Subject: below --
2003-03-07 5:24 anil vijarnia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).