LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-14-2016, 06:56 PM   #1
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Recovering deleted device nodes


How does one recover deleted device nodes without rebooting?

I had a shell script that had an undefined variable.

The script command that failed was

Code:
umount -f -l /dev/${SOME_VARIABLE}
The variable $SOME_VARIABLE was undefined because of a typo. The infamous typo.

The script is fixed, but from an admin perspective the discovery has me wondering how to resolve a bigger problem.

Some device nodes were deleted when the script executed the broken command. In particular that caused me to hunt this down was the loss of /dev/dvb, which resulted in the system not being able to record.

I am not a udev guru at all. I have tinkered some to no avail with udevadm trying to recover the lost device nodes. I also tried booting to run level 1 and returning. That helps some but I notice a few other quirks. The only reliable method I have discovered is rebooting.

I do not believe mknod helps because that creates a static node.

I surfed the web with no success. Most people seem to recommend rebooting.

I would appreciate some ideas about recovering deleted device nodes.

Thanks.
 
Old 08-14-2016, 07:47 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Quote:
Originally Posted by upnort View Post
I am not a udev guru at all. I have tinkered some to no avail with udevadm trying to recover the lost device nodes.
What "tinkering" ?. Did you try a trigger with the appropriate subsystem (probably dvb) ?.
 
Old 08-14-2016, 09:02 PM   #3
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,819

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
Reloading the DVB kernel module concerned (eg dvb-core) should be all that's required.
 
Old 08-15-2016, 12:34 PM   #4
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Quote:
Did you try a trigger with the appropriate subsystem (probably dvb)?
I tried the trigger command. Do you have a more specific command in mind?

Quote:
Reloading the DVB kernel module concerned (eg dvb-core) should be all that's required.
Deleting the /dev/dvb node does not affect module status. I checked before posting. The lsmod output remains the same after /dev/dvb is deleted.
 
Old 08-15-2016, 06:44 PM   #5
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,819

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
Quote:
Deleting the /dev/dvb node does not affect module status. I checked before posting. The lsmod output remains the same after /dev/dvb is deleted.
That's because you've got it the wrong way round. Reload the kernel driver and the device node should be recreated.
 
Old 08-16-2016, 04:40 PM   #6
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
I tried the following.

Simulate the original script error with the undefined variable:
umount -f -l /dev/

rmmod cx2341x
rmmod cx18_alsa
rmmod cx18
rmmod dvb_core

modprobe dvb_core
modprobe cx18
modprobe cx2341x

At that point /dev/dvb still does not exist.
 
Old 08-16-2016, 04:45 PM   #7
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
udevadmin trigger perhaps?
 
Old 08-16-2016, 05:46 PM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,819

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
The device concerned may need reinitialising. Is it a USB-attached device? If so, physically reconnecting it should do the trick. Alternatively, udevadm trigger (as has already been suggested) with something like
Code:
udevadm trigger -v -t subsystems -c add -s usb -a "idVendor=xxxx"
where xxxx pertains to the vendor ID of the device concerned.
 
Old 08-18-2016, 03:22 PM   #9
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
No luck thus far. I tried the following:

Code:
udevadm trigger -v -t subsystems -c add -s pci -a "idVendor=14f1"
Where 14f1 is the vendor id of the TV capture card, harvested from the lspci command.
 
Old 08-18-2016, 05:50 PM   #10
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,819

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
1) I don't have a definitive answer here, but you might want to check that "idVendor" is a valid attribute for that device.

https://wiki.archlinux.org/index.php...es_of_a_device

2) I'm in uncharted territory with this, but perhaps it is feasible to reset the device (to cause it to be re-initialised without rebooting the OS) as described here:
http://unix.stackexchange.com/questi...-a-pcie-device

Other than that, I'm not sure what else to suggest. Good luck.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recovering a deleted file brazilian_user Linux - General 2 08-09-2007 02:23 PM
recovering a deleted file? berrance Linux - Software 4 03-24-2006 07:56 AM
Recovering a deleted photo hongman Linux - Newbie 1 03-18-2005 12:46 PM
Recovering Deleted Files Brian of Gep Linux - Newbie 1 03-02-2004 02:26 AM
Recovering deleted data Korff Linux - Software 13 06-23-2003 01:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration