[9fans] fs(3) issues ('clear' missing and mirror question) - Plan9

This is a discussion on [9fans] fs(3) issues ('clear' missing and mirror question) - Plan9 ; Dear List, 1) I have been playing with fs(3). Unfortunately the clear command mentioned in the man page does not seem to exist. cpu% echo clear > /dev/fs/ctl echo: write error: unknown control message "clear" whereas fs(3) says: clear Discard ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: [9fans] fs(3) issues ('clear' missing and mirror question)

  1. [9fans] fs(3) issues ('clear' missing and mirror question)

    Dear List,

    1)
    I have been playing with fs(3). Unfortunately the clear command
    mentioned in the man page does not seem to exist.

    cpu% echo clear > /dev/fs/ctl
    echo: write error: unknown control message "clear"

    whereas fs(3) says:
    clear
    Discard all fs device definitions.

    One of each is wrong here

    2)
    I wanted to use fs(3) to setup mirrored venti arenas, and indeces.
    Now with fs I only get one device after a
    echo mirror m0 /dev/sdC1/data /dev/sdD0/data > /dev/fs/ctl

    I have read in earlier threads that it is possible to disk/part the
    m0 device. How can I specify the partitions later on? Also This
    seems to fail:

    cpu% disk/prep -a^(isect arenas fscfg) /dev/fs/m0 > /dev/fs/ctl
    no plan9 partition table found
    fscfg 1
    arenas 558164159
    isect 27908208
    ' fscfg 0 1 (1 sectors, 512 B )
    ' arenas 1 558164160 (558164159 sectors, 266.15
    GB)
    ' isect 558164160 586072368 (27908208 sectors, 13.30
    GB)
    >>> w

    adding part failed: fscfg: wrong #args in control message "part
    fscfg 0 1"
    adding part failed: arenas: wrong #args in control message "part
    arenas 1 558164160"
    adding part failed: isect: wrong #args in control message "part
    isect 558164160 586072368"
    ?warning: partitions could not be updated in devsd
    >>> q


    Is this supposed to work? Doing it a second time disk/part tells me:
    cpu% disk/prep -a^(isect arenas fscfg) /dev/fs/m0 > /dev/fs/ctl
    partitions already exist; not repartitioning
    >>> q


    The '>/dev/fs/ctl' part comes from a mail from erik (Message-ID:
    2cb5e9b012d84b84ab0216685114e141 () coraid ! com
    )

    Should I mirror each partition separately then?

    Thanks for your precious time,

    Christian

    --
    You may use my gpg key for replies:
    pub 1024D/47F79788 2005/02/02 Christian Kellermann (C-Keen)

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (OpenBSD)

    iD8DBQFG/QmFXYob3Uf3l4gRAiwKAKCxRqPR6tEDWdR3EVEY2FNDTahKtAC gxKNc
    6rK2XcwkO85fbmYS5wP2W9s=
    =ILcB
    -----END PGP SIGNATURE-----


  2. Re: [9fans] fs(3) issues ('clear' missing and mirror question)

    You need a recent kernel to get the "clear" command.

    fs(3) describes a "part" command for partitioning other devices.


  3. Re: [9fans] fs(3) issues ('clear' missing and mirror question)

    * geoff@plan9.bell-labs.com [070928 18:21]:
    > You need a recent kernel to get the "clear" command.
    >
    > fs(3) describes a "part" command for partitioning other devices.


    Thanks! I just haven't updated this machine for almost a year...

    Now I have just pull'ed from sources and rebuild a stock pccpuf
    kernel.

    After rebooting I get this:

    cpu% cat /dev/fs/ctl
    mirror m0 /dev/sdC1/data /dev/sdD0/data
    cpu% echo clear > /dev/fs/ctl
    cpu% cat /dev/fs/ctl
    mirror m0 /dev/sdC1/data /dev/sdD0/data
    clear
    cpu%

    Is this desired? The concatenation seems a bit disturbing...

    Cheers,

    Christian

    --
    You may use my gpg key for replies:
    pub 1024D/47F79788 2005/02/02 Christian Kellermann (C-Keen)

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (OpenBSD)

    iD8DBQFG/TI4XYob3Uf3l4gRAvGgAJ4p/P5xKu833W32nZ3ALSKCaWiD5wCeO13p
    yfnMJaz/I/g9SXD61rrAgbU=
    =e8ai
    -----END PGP SIGNATURE-----


  4. Re: [9fans] fs(3) issues ('clear' missing and mirror question)

    * geoff@plan9.bell-labs.com [070928 18:21]:
    > fs(3) describes a "part" command for partitioning other devices.


    Just to make sure I have understood the man page correctly:

    I can use the output of disk/prep -p /dev/fs/m0, for example:

    part fscfg 0 1
    part arenas 1 558164160
    part isect 558164160 586072368

    and insert the fs device (/dev/fs/m0 in my case) as 'file' parameter
    and then I am done?
    cpu% ls -l /dev/fs
    --rw-rw-r-- k 0 bootes bootes 558164160 Sep 28 18:45
    /dev/fs/arenas
    --rw-rw-r-- k 0 bootes bootes 0 Sep 28 18:45 /dev/fs/ctl
    --rw-rw-r-- k 0 bootes bootes 1 Sep 28 18:45
    /dev/fs/fscfg
    --rw-rw-r-- k 0 bootes bootes 586072368 Sep 28 18:45
    /dev/fs/isect
    --rw-rw-r-- k 0 bootes bootes 300069052416 Sep 28 18:45 /dev/fs/m0

    does this look ok to you?

    Thanks for your help!

    Christian

    --
    You may use my gpg key for replies:
    pub 1024D/47F79788 2005/02/02 Christian Kellermann (C-Keen)

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (OpenBSD)

    iD8DBQFG/TYUXYob3Uf3l4gRAqcHAJ94cbNM5V+oZsoLANJ0eebRfwaNxQC gjFEp
    UfsgCl2Q7PgIGP4fkdpX2Is=
    =7Eje
    -----END PGP SIGNATURE-----


  5. Re: [9fans] fs(3) issues ('clear' missing and mirror question)

    No, that shouldn't have been happening; "clear" should have resulted
    in an empty configuration. I've just pushed out a new devfs.c that
    fixes it.


  6. Re: [9fans] fs(3) issues ('clear' missing and mirror question)

    devsd's partition commands and devfs's are currently different. Among
    other differences, devsd's partitions are defined in terms of sectors
    but devfs's are defined in terms of bytes. There's no need to use
    prep to configure devfs and it isn't really appropriate.


  7. Re: [9fans] fs(3) issues ('clear' missing and mirror question)

    > devsd's partition commands and devfs's are currently different. Among
    > other differences, devsd's partitions are defined in terms of sectors
    > but devfs's are defined in terms of bytes.


    another way of saying this is that fs's sector size is one byte.

    i think it would be more useful to use the least common multiple
    of the fs's devices' sector sizes. an ata disk, for example can only
    read in multiples of 512 bytes. so if a partition offset % 512 != 0,
    a sector-sized read will require reading two sectors.

    > There's no need to use
    > prep to configure devfs and it isn't really appropriate.


    why not use prep to partition an fs device? what is the advantage
    of making things different. the result of fs's operations is a block
    device. i would think one should be able to prep it just like a sd
    device. am i missing something?

    - erik

  8. Re: [9fans] fs(3) issues ('clear' missing and mirror question)

    I was just explaining the current situation. Admittedly, it's not
    ideal.


+ Reply to Thread