Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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).
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
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.