[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: EXT2 or EXT3 : What have I got?



Ron Johnson <ron.l.johnson@cox.net> writes:

> On Wed, 2005-03-16 at 02:35 -0800, Harshal wrote:
> > i don't see any filesystem type, after file -s /dev/hda1, instead i see
> > the following, what's wrong?
> > 
> > [harshal@aips ~]$ file -s /dev/hda1
> > /dev/hda3:
> > [harshal@aips ~]$

Is that really the output you got from file(1), or did you hand edit
this?  Your argument to file is /dev/hda1 and the output reports
something about /dev/hda3.  This is very strange and suggests there is
something really broken on your system.

> That's because "file" looks at files, not devices.

No, that's why I told to use the -s option.

>From file(1):

   -s, --special-files
       Normally, file only attempts to read and determine the type of
       argument files which stat(2) reports are ordinary files.  This
       prevents problems, because reading special files may have
       peculiar consequences.  Specifying the -s option causes file to
       also read argument files which are block or character special
       files.  This is useful for determining the filesystem types of
       the data in raw disk partitions, which are block special files.
       This option also causes file to disregard the file size as
       reported by stat(2) since on some systems it reports a zero
       size for raw disk partitions.

Here I get

    # file /dev/hda5
    /dev/hda5: block special (3/5)
    # file -s /dev/hda5
    /dev/hda5: Linux rev 1.0 ext3 filesystem data (needs journal recovery)


urs



Reply to: