Help!

new devicewith mknod


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions RSS
Next:  X windows freezes on keypress  
Author Message
carex
External


Since: Jul 17, 2004
Posts: 14



PostPosted: Sat Jul 21, 2007 1:24 pm    Post subject: new devicewith mknod
Archived from groups: alt>os>linux>debian (more info?)

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.
Back to top
Mumia W.
External


Since: Apr 09, 2007
Posts: 45



PostPosted: Sat Jul 21, 2007 2:40 pm    Post subject: Re: new devicewith mknod [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.
Back to top
Kees Theunissen
External


Since: Oct 20, 2006
Posts: 145



PostPosted: Mon Jul 23, 2007 9:42 am    Post subject: Re: new devicewith mknod [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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 Cool

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.
Back to top
Mumia W.
External


Since: Apr 09, 2007
Posts: 45



PostPosted: Mon Jul 23, 2007 3:27 pm    Post subject: Re: new devicewith mknod [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum