LinuxQuestions.org
Visit Jeremy's Blog.
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-19-2005, 01:20 PM   #1
f1d094
LQ Newbie
 
Registered: Nov 2003
Posts: 5

Rep: Reputation: 0
Need to rebuild /dev


I had built myself a chroot environment on to run 32 bit apps on my 64-bit ubuntu box...I did a bonehead thing in that I tried deleting it while it was in use.

Now I need advice on how to rebuild /dev. Fortunately, the machine is still running and I've restored my home dir, and many of the nodes...but I want to be *really* sure before rebooting.


I have done the following:

1) Run all of the MAKEDEV scripts

2) run mknod <devname> <type> <major> <minor> for every device I could think of and find in the devices.txt file

3) Listed all of the devices in /proc/devices...

4) Now what?


My biggest worry is /dev/mapper I have no idea what was in there or how to rebuild it.

Tips? Advice? General taunting? Constructive help preferred.
 
Old 08-19-2005, 01:32 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
You don't use udev or devfs?
 
Old 08-19-2005, 05:46 PM   #3
f1d094
LQ Newbie
 
Registered: Nov 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Ok. I'm not sure now.

I'm not afraid of config files et. al. but after a moderate amount of homework, I'm not sure what I'm looking for.

I found /etc/udev and see that I have plenty of rules and whatnot in there. I found the following in udev.conf, but not the associated file:

udev_db="/dev/.udevdb"

Is this another item I will have to rebuild?

I also did "udevinfo -s" and it returned nothing.


Can you point me in the right direction?
 
Old 08-20-2005, 11:15 PM   #4
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Run 'ps -ef | grep udev'. If udevd is running, then you SHOULD be able to reboot without a problem. udevd only requires /dev/console and /dev/null to actually exist: it will recreate everything else (or should).
 
Old 08-21-2005, 01:55 AM   #5
Charred
Member
 
Registered: Mar 2005
Location: Utah, USA
Distribution: Slackware 11
Posts: 816
Blog Entries: 2

Rep: Reputation: 30
fld094, are you using the 2.4 or the 2.6 kernel? If I recall correctly, 2.4 does not use udev.
 
Old 08-21-2005, 04:41 AM   #6
f1d094
LQ Newbie
 
Registered: Nov 2003
Posts: 5

Original Poster
Rep: Reputation: 0
udevd is running (2.6.11-1-amd64-k8 kernel)

Ok...just double checking on a few things because I'm paranoid:

1) udevd is running and I am running a 2.6 kernel...so it should remake the "device-mapper" bits automatically? When I run MAKEDEV update, it complains about nearly everthing.

2) I am running raid 5 with 4 disks...(md0) Is there anything special I should have to check for them? Here is the output from "mount"

/dev/md0 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/mapper/tmp-tmp on /tmp type ext2 (rw,nosuid,nodev,noatime)
none on /dev type tmpfs (rw,size=5M,mode=0755)
/dev/sde1 on /boot type ext2 (rw,errors=remount-ro)

and here is mdadm --device /dev/md0

/dev/md0:
Version : 00.90.01
Creation Time : Tue Apr 26 20:44:06 2005
Raid Level : raid5
Array Size : 725671872 (692.05 GiB 743.09 GB)
Device Size : 241890624 (230.68 GiB 247.70 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Sun Aug 21 09:37:31 2005
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0

Layout : left-symmetric
Chunk Size : 64K

UUID : b22bea6d:62339cd7:0ce83b75:4ac59414
Events : 0.4083507

Number Major Minor RaidDevice State
0 8 51 0 active sync /dev/sdd3
1 8 35 1 active sync /dev/sdc3
2 8 19 2 active sync /dev/sdb3
3 8 3 3 active sync /dev/sda3

Thanks for the help! Its a slow process, but I'm learning.
 
Old 08-21-2005, 05:57 AM   #7
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
If udev is running then you won't have a problem. Udev creates /dev and everything in it on a temporary filesystem that will be deleted when you shut down and be recreated the next time you boot.
 
Old 08-21-2005, 07:13 AM   #8
Charred
Member
 
Registered: Mar 2005
Location: Utah, USA
Distribution: Slackware 11
Posts: 816
Blog Entries: 2

Rep: Reputation: 30
Feel free to reboot at your leasure.
 
Old 06-17-2008, 10:59 AM   #9
kyle.ryan
LQ Newbie
 
Registered: Jun 2008
Location: Austin, Texas
Distribution: Ubuntu
Posts: 1

Rep: Reputation: 0
I did the same thing, sudo rm -rf /opt/chroot and ended up in the same state with an empty /dev. I found the last message "Feel free to reboot at your leasure" to be pretty ominous, but I did it anyway and everything in /dev was recreated.

Thanks!
 
Old 06-19-2008, 02:12 PM   #10
f1d094
LQ Newbie
 
Registered: Nov 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks!

It seems I was still subscribed to this question...after reading the last post I realized I forgot to thank you for the help.

After rebooting, everything worked perfectly. (and still does!)

A few years late but: Thanks!

 
Old 06-19-2008, 07:53 PM   #11
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,377

Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
When you start the system, the "udev" facility examines the hardware configuration (according to established rules) and dynamically creates the entries in /dev.

"chroot" isn't the same thing.

It's a very nice feature. When you emptied the contents of /dev you of-course wiped out all those important entries, but it was "udev to the rescue!" You didn't have to worry about laboriously re-creating them: all you had to do was reboot.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I cannot access EITHER CD drive! And there's no /dev/hdc or /dev/hdd or /dev/cdrom! Dmalic Linux - Hardware 13 11-18-2005 07:11 PM
PLEASE HELP: fsck.reiserfs --rebuild-sb /dev/md0 fails ofdofd Linux - General 2 10-26-2005 02:18 PM
rebuild /dev eazarcon Linux - General 3 06-28-2005 09:07 PM
How can I boot either one of my hard drives /dev/hda or /dev/hdb, I have RH9 and FC2 omogunkristi Linux - General 1 06-21-2004 05:11 AM
Sandisk USB card Reader not linking /dev/sg0 to /dev/sda acidraven Linux - Hardware 1 06-19-2004 03:56 PM


All times are GMT -5. The time now is 07:30 PM.

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 Google+: linuxquestions
Open Source Consulting | Domain Registration