LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 01-12-2012, 05:02 AM   #1
LauMars
Member
 
Registered: Sep 2007
Location: /root/
Distribution: Arch, CentOS, Debian, FreeBSD, Slackware, Solaris, SuSE (Open & SLES)
Posts: 111

Rep: Reputation: 16
Repairing /dev after accidental deletion.


I've just accidentally:
# rm -Rv /dev
(I meant to ./dev but hadn't spotted I missed the full stop until after I hit return).

Anyhow, I've run a simulation of doing the same action on a VM and the system appeared to rebuild the /dev directory upon restart. However I just wanted to make sure that this would fix everything or if there will be other outstanding issues?

OS: SLES 11.1
 
Old 01-12-2012, 07:29 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware, Cross Linux from Scratch, Gentoo
Posts: 2,640
Blog Entries: 1

Rep: Reputation: 194Reputation: 194
You might want to execute these commands.
Code:
mknod -m 600 /dev/console c 5 1
mknod -m 666 /dev/null c 1 3
These are required by the kernel at boot time and not dynamically created during boot.
 
1 members found this post helpful.
Old 01-12-2012, 08:33 AM   #3
David the H.
Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 5,338

Rep: Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202
The /dev directory entries on most Linux systems are handled by udev these days, which dynamically builds the device tree from detected hardware. In fact on many distros, the /dev directory itself is now hosted on a ram-based virtual filesystem.

What weibullguy posted above could be an exception; I'm no expert there. But if so, I imagine the default init scripts or initramfs probably handle such things usually.
 
1 members found this post helpful.
Old 01-12-2012, 08:45 AM   #4
LauMars
Member
 
Registered: Sep 2007
Location: /root/
Distribution: Arch, CentOS, Debian, FreeBSD, Slackware, Solaris, SuSE (Open & SLES)
Posts: 111

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by weibullguy View Post
You might want to execute these commands.
Code:
mknod -m 600 /dev/console c 5 1
mknod -m 666 /dev/null c 1 3
These are required by the kernel at boot time and not dynamically created during boot.
The test I performed in a VM booted fine without those commands (I tested it before you had replied). So -on SLES at least- /dev/console and /dev/null are not required to boot.

I will however check to see if they have been recreated. So I definitely appreciate the input.
 
Old 01-12-2012, 08:48 AM   #5
LauMars
Member
 
Registered: Sep 2007
Location: /root/
Distribution: Arch, CentOS, Debian, FreeBSD, Slackware, Solaris, SuSE (Open & SLES)
Posts: 111

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by David the H. View Post
The /dev directory entries on most Linux systems are handled by udev these days, which dynamically builds the device tree from detected hardware. In fact on many distros, the /dev directory itself is now hosted on a ram-based virtual filesystem.
This is what I suspected (or at least secretly hoped).
I'll keep testing (and reading these forums in case others have any input / advice) for now, just to be safe.

Thank you

Quote:
Originally Posted by David the H. View Post
What weibullguy posted above could be an exception; I'm no expert there. But if so, I imagine the default init scripts or initramfs probably handle such things usually.
I see. That might explain why the VM rebooted without a problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Help! Accidental Deletion need to recover from loss :( heberg21 Linux - Newbie 4 06-19-2010 08:28 AM
Accidental deletion of "/usr/X11R6//lib/browser_plugins/" folder on FreeBSD. int80 *BSD 2 01-02-2009 10:19 AM
accidental deletion of /etc/profile on MDK9.2 lolmc Mandriva 2 05-06-2004 12:49 PM
Accidental Deletion of some /usr/lib files Huddlebum Linux - General 17 03-08-2004 02:05 PM
accidental deletion of /bin/ steve1394 Linux - Newbie 3 11-03-2003 02:06 PM


All times are GMT -5. The time now is 12:28 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration