Operating System - Linux
1827862 Members
1797 Online
109969 Solutions
New Discussion

Re: how to associate one physical device to one block device-file?

 
SOLVED
Go to solution

how to associate one physical device to one block device-file?

yes, I know such as:
mknod -m 660 /dev/ram b 1 1
can make up one block file, but, how it can associate to the designated device, or call locate the driver program? for example, if i want to create /dev/fla what link to one flash-memory, how mknod can know it should use the flash card driver for /dev/fla?

apprecate for your helps in advance.

Best Regards,
Frederick
frederick van targero
1 REPLY 1
Goran Koruga
Honored Contributor
Solution

Re: how to associate one physical device to one block device-file?

Hi Frederick.

The actual device filename doesn't matter so much, but it depends on the applicaitons. If you can tell your application which device file to use, it's not a problem to name it the way you want.

The driver doesn't care about the filename, it only needs to know the major and minor number of the device (those are the numbers that you specify at the end of the mknod command).

So you can create a device /tmp/foo and use it to happily mount your flash device, as long as the major and minor numbers correctly correspond to it (i.e. it should be the same as sda1 in most cases).

Hope this helps,
Goran