You are not logged in.

#1 2009-12-31 10:54:46

korpenkraxar
Member
Registered: 2006-04-02
Posts: 123

Cleansing /dev

Hi all!

This is an embarrasing case of not thinking things through fully before doing.

I just moved my / from one partition to the next using "rsync -av" and updated grub. Since /dev is a tmpfs filesystem, I figured (erroneously) that its contents is completely dynamically generated by the kernel these days and excluded it from rsync (just as I did with /proc and /sys) and got a kernel oops upon reboot since I lacked /dev/console. I am not very up to date on how the kernel plays with /dev, but from this experience it would seem as if the tmpfs itself mounted on top of /dev does not provide all the devices needed for operation. So I rsynced /dev too to the new partition and now it boots nicely.

I am however getting a tad worried that rsyncing a directory with partially dynamically generated data such as dev, while online, might write device stuff to disc which should only be temporarly kept in RAM using tmpfs and that I am now stuck with device cruft in the new directory, which may cause unexpected problems further down the line.

My questions are:

Should I be worried about this?
If yes, how do I best cleanse the directory? Should I recreate /dev from scratch? If so, how?

Offline

#2 2009-12-31 11:35:24

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Cleansing /dev

I had some fun with /dev myself today... rm -rf'd a directory I was using to build a chroot with /dev mounted in it.  Oops. wink

Anyway, I don't think it's something to worry about, but it wouldn't hurt to clean it up.

Three files are created by the installation of udev:
/dev/console
/dev/null
/dev/zero

Others should be created dynamically and can be removed safely.

Offline

#3 2009-12-31 13:20:25

korpenkraxar
Member
Registered: 2006-04-02
Posts: 123

Re: Cleansing /dev

gr8! Thanks! I'll try with only those three devices.

Offline

Board footer

Powered by FluxBB