Professional Web Applications Themes

how to know the size of a raw disk partition ? - UNIX Programming

"Michael Korte" <michael.kortematerna.de> wrote in message news:bgqeh0$38v$1pentheus.materna.de... > "Cho, Y.W." <ywchounisql.com> schrieb im Newsbeitrag > news:O62Ya.71096$H%2.786405news.bora.net... > > I want to know the size of a raw disk partition. (It's mounted as > > /dev/raw/raw33.) > > which OS ??? > > try the command : df (Disc Free) > > parameter : -b = bytes > else it shows the blocks... > > HTH > > Michael > > df only tells about mounted file systems. The OP wanted information about a raw partition. The only to get this information is to look at the disk label. On SunOS, ...

  1. #1

    Default Re: how to know the size of a raw disk partition ?


    "Michael Korte" <michael.kortematerna.de> wrote in message
    news:bgqeh0$38v$1pentheus.materna.de...
    > "Cho, Y.W." <ywchounisql.com> schrieb im Newsbeitrag
    > news:O62Ya.71096$H%2.786405news.bora.net...
    > > I want to know the size of a raw disk partition. (It's mounted as
    > > /dev/raw/raw33.)
    >
    > which OS ???
    >
    > try the command : df (Disc Free)
    >
    > parameter : -b = bytes
    > else it shows the blocks...
    >
    > HTH
    >
    > Michael
    >
    >
    df only tells about mounted file systems. The OP wanted information
    about a raw partition. The only to get this information is to look at
    the disk label. On SunOS, the command is prtvtoc.

    --
    Fletcher Glenn
    to reply remove NOSPAM from my reply address


    Fletcher Glenn Guest

  2. #2

    Default Re: how to know the size of a raw disk partition ?


    "Cho, Y.W." <ywchounisql.com> wrote in message
    news:O62Ya.71096$H%2.786405news.bora.net...
    > I want to know the size of a raw disk partition. (It's mounted as
    > /dev/raw/raw33.)
    >
    > stat() function seems not revealing it.
    Try this:

    1) 'open' it
    2) 'lseek' to the end.
    3) look at the return value

    DS


    David Schwartz Guest

  3. #3

    Default Re: how to know the size of a raw disk partition ?

    On Thu, 7 Aug 2003 15:59:51 -0700
    "David Schwartz" <com> wrote:
     
    >
    > Try this:
    >
    > 1) 'open' it
    > 2) 'lseek' to the end.
    > 3) look at the return value
    >
    > DS
    >
    >[/ref]

    I think this test will fail, because of stat is not work,
    so we don't know where to seek.

    I suggest to do following:

    #define BLOCK_SIZE 1024
    open it
    for( i = 0; read( fd, buf, BLOCK_SIZE ) >= 0; i++ )
    i*BLOCK_SIZE
    you can change BLOCK_SIZE to 1 :)

    --
    brgrds
    Egor
    Egor Guest

Similar Threads

  1. Increasing partition size
    By sbailey@netins.net in forum Windows Server
    Replies: 2
    Last Post: June 19th, 07:40 AM
  2. Maximum Partition Size
    By Bill Farinella in forum Windows Server
    Replies: 3
    Last Post: June 7th, 08:25 PM
  3. partition size in windows 2000 server
    By ashvin in forum Windows Server
    Replies: 1
    Last Post: June 7th, 02:02 PM
  4. Disk Partition
    By S Hebbar in forum Windows XP/2000/ME
    Replies: 3
    Last Post: July 15th, 01:08 AM
  5. How to change partition number & block size
    By spagi in forum Linux Setup, Configuration & Administration
    Replies: 8
    Last Post: June 28th, 12:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139