Volume/partition names - Setup

This is a discussion on Volume/partition names - Setup ; Hi, .. how could you know the type of filesystem of a partition prior to mounting it? .. the thing is that even if you make the filesystem as a resier one, Linux fdisk shows it as a "Linux filesystem" ...

+ Reply to Thread
Results 1 to 12 of 12

Thread: Volume/partition names

  1. Volume/partition names

    Hi,
    ..
    how could you know the type of filesystem of a partition prior to
    mounting it?
    ..
    the thing is that even if you make the filesystem as a resier one,
    Linux fdisk shows it as a "Linux filesystem"
    ..
    Is there a way to set the volume when you run mkfs so that you have
    an idea of what type of partition you are dealing with?
    ..
    Thanks
    lbrtchx


  2. Re: Volume/partition names

    On 5 Feb 2007 10:35:46 -0800, lbrtchx@hotmail.com wrote:
    > Hi,
    > .
    > how could you know the type of filesystem of a partition prior to
    > mounting it?


    Hey, let mount figure it out.
    mount -t auto /dev/whatever /wherever
    and to see what was picked
    mount | grep wherever



  3. Re: Volume/partition names

    lbrt...@hotmail.com wrote:
    >
    > how could you know the type of filesystem of a partition prior to
    > mounting it?


    Try running "file" on the raw device. You'll be amzed what file
    will tell you.


  4. Re: Volume/partition names

    On Feb 5, 1:49 pm, "Doug Freyburger" wrote:
    > lbrt...@hotmail.com wrote:
    >
    > > how could you know the type of filesystem of a partition prior to
    > > mounting it?

    >
    > Try running "file" on the raw device. You'll be amzed what file
    > will tell you.

    ..
    Well, I am affraid, I don't appear to be able to do that. I am
    running Knoppix. Is there anyother way?
    ..
    root@2[Desktop]# cat /proc/devices
    Character devices:
    1 mem
    2 pty
    3 ttyp
    4 /dev/vc/0
    4 tty
    4 ttyS
    5 /dev/tty
    5 /dev/console
    5 /dev/ptmx
    7 vcs
    10 misc
    13 input
    14 sound
    29 fb
    116 alsa
    128 ptm
    136 pts
    171 ieee1394
    180 usb
    189 usb_device
    254 pcmcia

    Block devices:
    1 ramdisk
    2 fd
    8 sd
    11 sr
    22 ide1
    65 sd
    66 sd
    67 sd
    68 sd
    69 sd
    70 sd
    71 sd
    128 sd
    129 sd
    130 sd
    131 sd
    132 sd
    133 sd
    134 sd
    135 sd
    240 cloop
    254 device-mapper



  5. Re: Volume/partition names

    lbrt...@hotmail.com wrote:
    > "Doug Freyburger" wrote:> lbrt...@hotmail.com wrote:
    >
    > > > how could you know the type of filesystem of a partition prior to
    > > > mounting it?

    >
    > > Try running "file" on the raw device. You'll be amzed what file
    > > will tell you.

    >
    > Well, I am affraid, I don't appear to be able to do that. I am
    > running Knoppix. Is there anyother way?


    dd if=/dev/hda2 of=wow bs=512 count=1
    file wow
    wow: data

    Okay, so it doesn't understand the magic number for an EXT3
    filesystem.
    Sorry about that.


  6. Re: Volume/partition names

    On 5 Feb 2007 12:43:24 -0800, "Doug Freyburger" wrote:

    >lbrt...@hotmail.com wrote:
    >> "Doug Freyburger" wrote:> lbrt...@hotmail.com wrote:
    >>
    >> > > how could you know the type of filesystem of a partition prior to
    >> > > mounting it?

    >>
    >> > Try running "file" on the raw device. You'll be amzed what file
    >> > will tell you.

    >>
    >> Well, I am affraid, I don't appear to be able to do that. I am
    >> running Knoppix. Is there anyother way?

    >
    >dd if=/dev/hda2 of=wow bs=512 count=1
    >file wow
    >wow: data
    >
    >Okay, so it doesn't understand the magic number for an EXT3
    >filesystem.


    ~# file -s /dev/hda1
    /dev/hda1: ReiserFS V3.6 block size 4096 num blocks 64240 r5 hash

    Need '-s' for block devices

    Grant.
    --
    http://bugsplatter.mine.nu/

  7. Re: Volume/partition names

    On 2007-02-05, Doug Freyburger wrote:

    > Try running "file" on the raw device. You'll be amzed what file
    > will tell you.


    Like this?

    [root@vector john]# file /dev/hda
    /dev/hda: block special (3/0)
    [root@vector john]#


    --

    John (john@os2.dhs.org)

  8. Re: Volume/partition names

    Doug Freyburger wrote:
    > lbrt...@hotmail.com wrote:
    >> how could you know the type of filesystem of a partition prior to
    >> mounting it?

    >
    > Try running "file" on the raw device. You'll be amzed what file
    > will tell you.
    >

    Not much:

    # file /dev/[sh]da
    /dev/hda: block special (3/0)
    /dev/sda: block special (8/0)
    # file -s /dev/[sh]da
    /dev/hda: x86 boot sector
    /dev/sda: x86 boot sector


    --
    .~. Jean-David Beyer Registered Linux User 85642.
    /V\ PGP-Key: 9A2FC99A Registered Machine 241939.
    /( )\ Shrewsbury, New Jersey http://counter.li.org
    ^^-^^ 17:05:01 up 107 days, 19:40, 4 users, load average: 4.27, 4.21, 4.20

  9. Re: Volume/partition names

    On Mon, 05 Feb 2007 22:09:34 GMT, Jean-David Beyer wrote:
    | Doug Freyburger wrote:
    |> lbrt...@hotmail.com wrote:
    |>> how could you know the type of filesystem of a partition prior to
    |>> mounting it?
    |>
    |> Try running "file" on the raw device. You'll be amzed what file
    |> will tell you.
    |>
    | Not much:
    |
    | # file /dev/[sh]da
    | /dev/hda: block special (3/0)
    | /dev/sda: block special (8/0)
    | # file -s /dev/[sh]da
    | /dev/hda: x86 boot sector
    | /dev/sda: x86 boot sector


    It tells me quite a lot, when I ask about a specific partition rather
    then the whole disk:

    tux ~ # file -s /dev/sd[abcd]?
    /dev/sda1: Linux rev 1.0 ext2 filesystem data
    /dev/sda2: Linux/i386 swap file (new style) 1 (4K pages) size 502030 pages
    /dev/sda3: ReiserFS V3.6 block size 4096 (mounted or unclean) num blocks 2502112 r5 hash
    /dev/sda4: x86 boot sector; partition 1: ID=0x83, starthead 254, startsector 63, 20016927 sectors; partition 2: ID=0x5, starthead 254, startsector 20016990, 20016990 sectors, extended partition table
    /dev/sda5: ReiserFS V3.6 block size 4096 (mounted or unclean) num blocks 2502112 r5 hash
    /dev/sda6: ReiserFS V3.6 block size 4096 (mounted or unclean) num blocks 2502112 r5 hash
    /dev/sda7: ReiserFS V3.6 block size 4096 (mounted or unclean) num blocks 41750912 r5 hash
    /dev/sdb1: Linux/i386 swap file (new style) 1 (4K pages) size 489501 pages
    /dev/sdb2: ReiserFS V3.6 block size 4096 (mounted or unclean) num blocks 1954256 r5 hash
    /dev/sdb3: ReiserFS V3.6 block size 4096 (mounted or unclean) num blocks 9767520 r5 hash
    /dev/sdb4: ReiserFS V3.6 block size 4096 (mounted or unclean) num blocks 36628192 r5 hash
    /dev/sdc1: LVM2 (Linux Logical Volume Manager) , UUID: T7wpZdZdf8bGCPMIwpPHh07yHzSO5yF
    /dev/sdd1: LVM2 (Linux Logical Volume Manager) , UUID: 1BeDdOU9bfmUVQYgEqjVGHXmbSJwK1f


    --
    Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/~paulcol
    Asking for technical help in newsgroups? Read this first:
    http://catb.org/~esr/faqs/smart-questions.html#intro

  10. Re: Volume/partition names

    > ~# file -s /dev/hda1
    > /dev/hda1: ReiserFS V3.6 block size 4096 num blocks 64240 r5 hash
    >
    > Need '-s' for block devices
    >
    > Grant.
    > --http://bugsplatter.mine.nu/


    OK, but what is the meaning of "data" and "MPEG ADTS, layer I, v1,
    Monaural"?
    ..
    knoppix@2[knoppix]$ su -
    root@2[~]# file -s /dev/hda1
    /dev/hda1: Linux rev 1.0 ext3 filesystem data
    root@2[~]# file -s /dev/hda2
    /dev/hda2: data
    root@2[~]# file -s /dev/hda3
    /dev/hda3: Linux rev 1.0 ext3 filesystem data
    root@2[~]# file -s /dev/hda5
    /dev/hda5: MPEG ADTS, layer I, v1, Monaural
    root@2[~]# file -s /dev/hda
    /dev/hda: x86 boot sector
    root@2[~]#
    ..
    lbrtchx


  11. Re: Volume/partition names

    lbrt...@hotmail.com wrote:
    >
    > > ~# file -s /dev/hda1
    > > /dev/hda1: ReiserFS V3.6 block size 4096 num blocks 64240 r5 hash
    > > Need '-s' for block devices

    >
    > OK, but what is the meaning of "data" and "MPEG ADTS, layer I, v1,
    > Monaural"?
    >
    > knoppix@2[knoppix]$ su -
    > root@2[~]# file -s /dev/hda1
    > /dev/hda1: Linux rev 1.0 ext3 filesystem data
    > root@2[~]# file -s /dev/hda2
    > /dev/hda2: data


    file will give specific answers when it can, or intuit as much
    as it can when it can't. Try it on lots of files and you'll get
    answers like "English text" or "shell script" or "ASCII text".
    The answer "data" means it does not have a known magic
    number or header format, that it contains data outside of
    the printable set and so is binary.

    Looking through the other answers it gave for your other
    partitions it looks to be like this is your swap partition.

    > root@2[~]# file -s /dev/hda3
    > /dev/hda3: Linux rev 1.0 ext3 filesystem data
    > root@2[~]# file -s /dev/hda5
    > /dev/hda5: MPEG ADTS, layer I, v1, Monaural


    MPEG is a range of formats for audio and/or video. The rest
    of the line gives which exact format it is. In this case it is
    sound without compression.

    I don't know if you use your system for streaming audio. If
    so this is likely to be a correct guess. Maybe it's a temp
    file mapped into virtual memory and that would mean this is
    also a swap space partition.

    Or it could be the guess is incorrect. file uses the first block
    or line or sector or whatever and if the data is truely random
    every so often it will hit the magic number of a specific
    format.

    I'm betting you use your host for streaming audio. Maybe
    even as a telephone ...

    > root@2[~]# file -s /dev/hda
    > /dev/hda: x86 boot sector
    > root@2[~]#




  12. Re: Volume/partition names

    On 2007-02-05, Bill Marcum wrote:

    > On Mon, 5 Feb 2007 14:36:47 -0600, John Thompson
    > wrote:
    >>
    >>
    >> On 2007-02-05, Doug Freyburger wrote:
    >>
    >>> Try running "file" on the raw device. You'll be amzed what file
    >>> will tell you.

    >>
    >> Like this?
    >>
    >> [root@vector john]# file /dev/hda
    >> /dev/hda: block special (3/0)
    >> [root@vector john]#


    > /dev/hda is the entire drive. You will want to run "file" on a partition.


    Ah, yes. Much better:

    [root@vector john]# file /dev/hda1
    /dev/hda1: block special (3/1)

    It appears the "-s" switch is required:

    [root@vector john]# file -s /dev/hda1
    /dev/hda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery)



    --

    John (john@os2.dhs.org)

+ Reply to Thread