0

When I connected a USB modem to my machine, it complained that /dev/sr1 does not exist. So, after a bit of Googling, I used the following commands to create this device.

ls -l /dev/sr*
brw-rw----+ 1 root cdrom 11, 0 Aug 16 08:05 /dev/sr0

sudo mknod /dev/sr1 b 11 0
sudo chown -v :cdrom /dev/sr1
sudo chmod -v g+w /dev/sr1
ls -l /dev/sr*
brw-rw----+ 1 root cdrom 11, 0 Aug 16 08:05 /dev/sr0
brw-rw-r--+ 1 root cdrom 11, 0 Aug 16 08:10 /dev/sr1

Then my modem worked without any problem. However, after a reboot, I find that the device has vanished, and I have to create the device again.

Please tell me,

  • Why such a strange thing like a device vanishing is happening?
  • How do I get rid of the situation?

I am using Ubuntu 15.04.

(As I am going to hit the Post button, I notice that creation date-time of /dev/sr0 coincides with the boot time this morning.

Are the devices being created at boot time?

Looks like the answer is, yes, indeed,

ls -l /dev/
total 0
lrwxrwxrwx  1 root root           7 Aug 16 08:14 atttyUSB1 -> ttyUSB1
crw-------  1 root root     10, 235 Aug 16 08:05 autofs
drwxr-xr-x  2 root root         640 Aug 16 08:14 block
drwxr-xr-x  2 root root         120 Aug 16 08:14 bsg
crw-------  1 root root     10, 234 Aug 16 08:05 btrfs-control
drwxr-xr-x  3 root root          60 Aug 16  2015 bus
lrwxrwxrwx  1 root root           3 Aug 16 08:14 cdrom -> sr0
lrwxrwxrwx  1 root root           3 Aug 16 08:14 cdrw -> sr0
drwxr-xr-x  2 root root        4300 Aug 16 08:14 char
crw-------  1 root root      5,   1 Aug 16 08:06 console
lrwxrwxrwx  1 root root          11 Aug 16  2015 core -> /proc/kc

<snipped>

So, if I ask, which list do I update to cause /dev/sr1 created at boot time?, can we move in the right direction? )

1 Answer 1

1

Are the devices being created at boot time?

Yes.

So, if I ask, which list do I update to cause /dev/sr1 created at boot time?

makedev

DESCRIPTION

   MAKEDEV is a script that will  create  the  devices  in  /dev  used  to
   interface with drivers in the kernel.

   Note  that  programs  giving  the  error  ``ENOENT:  No  such  file  or
   directory'' normally means that the device  file  is  missing,  whereas
   ``ENODEV:  No such device'' normally means the kernel does not have the
   driver configured or loaded.

Regarding your sr1:

CDROM DEVICES

   sr or scd or scd-all
          Creates scd{0..16} SCSI CD players and  sr{0..16}  symlinks  for
          these  devices.   cdrom is a symlink which can be created by the
          user to the active CD device.  It is not created by MAKEDEV.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .