new devicewith mknod - Debian

This is a discussion on new devicewith mknod - Debian ; Hello, I did try to create the logical partition sda16 but it just failed. And I found sda16 (an higher) is not present in /dev I just looked in the newsgroups and the only thing I have found is I ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: new devicewith mknod

  1. new devicewith mknod

    Hello,

    I did try to create the logical partition sda16 but it just failed.
    And I found sda16 (an higher) is not present in /dev
    I just looked in the newsgroups and the only thing I have found is
    I shoud use mknod to create sda16 (man mknod)
    But the mknod manpage is not sufficient for me to use it.

    Where could I find more info about the way to create this new device ?
    (dev/sda16)

    Thanks.
    carex.

  2. Re: new devicewith mknod

    On 07/21/2007 08:24 AM, carex wrote:
    > Hello,
    >
    > I did try to create the logical partition sda16 but it just failed.
    > And I found sda16 (an higher) is not present in /dev
    > I just looked in the newsgroups and the only thing I have found is
    > I shoud use mknod to create sda16 (man mknod)
    > But the mknod manpage is not sufficient for me to use it.
    >
    > Where could I find more info about the way to create this new device ?
    > (dev/sda16)
    >
    > Thanks.
    > carex.


    Look at the other sda* devices. Perhaps you want this:

    mknod -m 0660 sda16 b 8 16

    That creates sda16 as a (b)lock device with major number 8 and minor
    number 16 with mode 0660.

    I have no idea if this will work. Sda15 is the highest such device node
    on my system. Perhaps kernel support for higher-numbered devices does
    not exist.

    The system I'm currently running on does not have udev enabled, and I'm
    tempted to assume the same for your computer, but that might not be true.

    If you're running a 2.6.x kernel, and you have udev enabled, if a device
    is connected to the computer during bootup, and Linux has a proper
    driver for that device, it should appear in /dev automatically.

    Under such circumstances, manually creating the device node will
    probably not work.


  3. Re: new devicewith mknod

    Mumia W. wrote:
    > On 07/21/2007 08:24 AM, carex wrote:
    >> Hello,
    >>
    >> I did try to create the logical partition sda16 but it just failed.
    >> And I found sda16 (an higher) is not present in /dev
    >> I just looked in the newsgroups and the only thing I have found is
    >> I shoud use mknod to create sda16 (man mknod)
    >> But the mknod manpage is not sufficient for me to use it.
    >> Where could I find more info about the way to create this new
    >> device ?
    >> (dev/sda16)
    >>
    >> Thanks.
    >> carex.

    >
    > Look at the other sda* devices. Perhaps you want this:
    >
    > mknod -m 0660 sda16 b 8 16
    >
    > That creates sda16 as a (b)lock device with major number 8 and minor
    > number 16 with mode 0660.
    >
    > I have no idea if this will work. Sda15 is the highest such device node
    > on my system. Perhaps kernel support for higher-numbered devices does
    > not exist.


    No it won't work. It will alias /dev/sdb as /dev/sda16.
    The _names_ of the 'device special files' in /dev have no special
    meaning at all. The kernel references device drivers by type (block or
    char) and major and minor device number. The entries in /dev are just
    a method to assign names to the type-major-minor combinations.

    The assignment of device numbers is documented in the file
    Documentation/devices.txt in the kernel source.

    I'll first quote the text about the ide-driver (block, major 3) as
    this is referenced in the scsi section.

    3 block First MFM, RLL and IDE hard disk/CD-ROM interface
    0 = /dev/hda Master: whole disk (or CD-ROM)
    64 = /dev/hdb Slave: whole disk (or CD-ROM)

    For partitions, add to the whole disk device number:
    0 = /dev/hd? Whole disk
    1 = /dev/hd?1 First partition
    2 = /dev/hd?2 Second partition
    ...
    63 = /dev/hd?63 63rd partition

    For Linux/i386, partitions 1-4 are the primary
    partitions, and 5 and above are logical partitions.
    Other versions of Linux use partitioning schemes
    appropriate to their respective architectures.


    And now the section about scsi disks (block major 8)

    8 block SCSI disk devices (0-15)
    0 = /dev/sda First SCSI disk whole disk
    16 = /dev/sdb Second SCSI disk whole disk
    32 = /dev/sdc Third SCSI disk whole disk
    ...
    240 = /dev/sdp Sixteenth SCSI disk whole disk

    Partitions are handled in the same way as for IDE
    disks (see major number 3) except that the limit on
    partitions is 15.


    So if you would create a node for a block device with major device
    number 8 and minor device number 16 and give it whatever name you
    want, it will refer to the second scsi disk as a whole (commonly
    known as /dev/sdb) despite of the name you give to that node.

    Regards,

    Kees.

    --
    Kees Theunissen.

  4. Re: new devicewith mknod

    On 07/23/2007 02:42 AM, Kees Theunissen wrote:
    > [...]
    > So if you would create a node for a block device with major device
    > number 8 and minor device number 16 and give it whatever name you
    > want, it will refer to the second scsi disk as a whole (commonly
    > known as /dev/sdb) despite of the name you give to that node.
    >
    > Regards,
    >
    > Kees.
    >


    Thank you.


+ Reply to Thread