new devicewith mknod
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Debian support > Linux Debian support > new devicewith mknod




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    new devicewith mknod  
carex


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-21-07 06:12 PM

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.





[ Post a follow-up to this message ]



    Re: new devicewith mknod  
Mumia W.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-21-07 06:12 PM

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.






[ Post a follow-up to this message ]



    Re: new devicewith mknod  
Kees Theunissen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-23-07 12:14 PM

Mumia W. wrote:
> On 07/21/2007 08:24 AM, carex wrote: 
>
> 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.





[ Post a follow-up to this message ]



    Re: new devicewith mknod  
Mumia W.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-23-07 06:13 PM

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.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:34 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register