Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to disable udev for a faster boot?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
whitehead1415
n00b
n00b


Joined: 06 Jan 2010
Posts: 2

PostPosted: Wed Jan 06, 2010 6:48 am    Post subject: How to disable udev for a faster boot? Reply with quote

I am trying to make gentoo boot faster and in my searching I came across this article http://lwn.net/Articles/299483/. One of the things they did was revert to a "persistent, old-school /dev directory so that boot doesn't depend on udev". I would like to know how to do this, but when I searched for disabling udev all the forums say that its a bad idea. All I want to know is how to make a static /dev directory. If someone could tell me how to do this or even just point me in the right direction I would really[/quote] appreciate it.
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Wed Jan 06, 2010 7:57 am    Post subject: Reply with quote

Had a brief discussion on that in this thread - https://forums.gentoo.org/viewtopic-t-402844-highlight-devtmpfs.html

In terms of speeding up boot time, the biggest bang for your buck would be making the move to baselayout-2/openrc

It alone took my laptop from booting in around a minute, to 34 seconds (I'm now down to 26s with other tweaks)

If you care to experiment as well, check /etc/conf.d/rc

I don't know if this is specific to baselayout-2/openrc, or if it's available on baselayout-1 as well, but I did find these two options:

Code:

# Use this variable to control the /dev management behavior.
#  auto   - let the scripts figure out what's best at boot
#  devfs  - use devfs (requires sys-fs/devfsd)
#  udev   - use udev (requires sys-fs/udev)
#  static - let the user manage /dev (YOU need to create ALL device nodes)

RC_DEVICES="auto"

# UDEV OPTION:
# Set to "yes" if you want to save /dev to a tarball on shutdown
# and restore it on startup.  This is useful if you have a lot of
# custom device nodes that udev does not handle/know about.

RC_DEVICE_TARBALL="no"


I have not tried them myself, but again, if you're in a position where you can experiment, try it out and see how you get on.

NB: if anyone else has more to add, it would be most welcome as I too have been curious as to what devtmpfs means in terms of if we can move udev to a later runlevel.
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
honp
Guru
Guru


Joined: 25 Sep 2006
Posts: 355
Location: Good old Prague, Czech rep.

PostPosted: Wed Jan 06, 2010 7:59 am    Post subject: Reply with quote

I think that you have to allow devfs in kernel(if it is still possible) and then you need something that create all the needed devices in /dev.
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Wed Jan 06, 2010 9:37 am    Post subject: Reply with quote

honp wrote:
I think that you have to allow devfs in kernel(if it is still possible) and then you need something that create all the needed devices in /dev.


this is something different actually (well, it is in theory)

devtmpfs is a *new* feature added to recent kernels, not the same as devfs

fire up menuconfig and do a search for 'devtmpfs', you should get

Code:

Symbol: DEVTMPFS_MOUNT [=y]
  │ Prompt: Automount devtmpfs at /dev
  │   Defined at drivers/base/Kconfig:28
  │   Depends on: DEVTMPFS [=y]
  │   Location:
  │     -> Device Drivers
  │       -> Generic Driver Options
  │         -> Create a kernel maintained /dev tmpfs (EXPERIMENTAL) (DEVTMPFS [=y])
  │
  │
  │ Symbol: DEVTMPFS [=y]
  │ Prompt: Create a kernel maintained /dev tmpfs (EXPERIMENTAL)
  │   Defined at drivers/base/Kconfig:11
  │   Depends on: HOTPLUG [=y] && SHMEM [=y] && TMPFS [=y]
  │   Location:
  │     -> Device Drivers
  │       -> Generic Driver Options


I did a bit of experimenting

-if you remove udev completely (it's in sysinit on bl-2/openrc) == epic fail, even with the device tarball..though in my case that *may* have been because i use lvm2, and have /usr /home /var and others on their own LVM partitions
-if you move udev from 'sysinit' to 'boot' things actually function, but for some odd reason I can no longer hit "F2" to go from 'quiet' to 'verbose' mode on my splash

result: having things the second way (udev at 'boot') is no faster than having it the original way (udev at 'sysinit')

If we are supposed to see some big increase in boot speed, I'm not seeing it. There is virtually zero doc that explains how to take advantage of it that I've found, so at least being an early adopter who granted, doesn't know how this is supposed to work, I flatly don't see it
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
honp
Guru
Guru


Joined: 25 Sep 2006
Posts: 355
Location: Good old Prague, Czech rep.

PostPosted: Wed Jan 06, 2010 11:24 am    Post subject: Reply with quote

Nono, devtmpfs is not what i thought. I tried to find devfs in 2.6.31 kernel but i didn`t find it. Probably it is too old:(
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Wed Jan 06, 2010 12:12 pm    Post subject: Reply with quote

honp wrote:
Nono, devtmpfs is not what i thought. I tried to find devfs in 2.6.31 kernel but i didn`t find it. Probably it is too old:(


yip, devfs went byebye far as i know, early on in 2.6
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Wed Jan 06, 2010 9:46 pm    Post subject: Reply with quote

Linux 2.3.46pre5 – 2.6.17 devfs /dev
Implemented fully in the kernel. DEPRECATED: Users are encouraged to migrate to udev.
Back to top
View user's profile Send private message
whitehead1415
n00b
n00b


Joined: 06 Jan 2010
Posts: 2

PostPosted: Thu Jan 07, 2010 1:51 am    Post subject: Reply with quote

Thanks for the advice. The reason why I wanted a static /dev was because I tried to use the finit-arc but I think because arch linux uses bsd style init the scripts like udev and hal didn't start. I tried to modify everything needed for boot to be like the arch linux for example the rc.conf, and I got everything working like loading modules but I couldn't figure out how to start the services. The only thing I really needed to load was udev but I figured it would be easier to just use a static /dev. So I put a line in the finittab to cp a saved /dev directory to /dev and everything was working except for my wireless card which couldn't find the firmware for some weird reason. Anyway I booted into x in 7 seconds but there is still a few things that don't work like terminals couldn't access the psuedo-ptty even though it worked for root and the permissions were set right. so I think that I will just revert back to the old boot and experiment more with openrc, readahead, and making my kernel load faster.

If there is anyone out there that knows how to make the finit-arc work in gentoo, or even how to get another fast-init/finit type of init to work in gentoo please let me know. I think the best for gentoo is probably something like einit, mininit, or initng. At least those are the ones I found in portage, I will be testing these out also. Maybe if I can learn enough about it I will just write my own init.

As a side note I understood devfs to be an attempt at making a dynamic /dev but it didn't work out so well and it was replaced by udev. I think the static /dev was before devfs, and devfs wasn't added until the 2.3-2.4 kernel
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Thu Jan 07, 2010 5:06 am    Post subject: Reply with quote

so having read through this thread:

http://lkml.indiana.edu/hypermail/linux/kernel/0909.2/00785.html

Seems the suggestion that devtmpfs would provide an improvement in boot time is completely false under most if not all circumstances.
As well they concede that saying boot speed as a selling point is flat wrong, as well that it's completely unnecessary if you call udev early during init

So it would seem I'm wasting my time trying to leverage this to get my boot time down from 20s into the teens :P

I could roll a static dev, but thus far my efforts have been epic fail since I'm using lvm.
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum