You are not logged in.
I'll do it somewhere tommorow I gues.
Offline
i made my arch boot much faster than before by:
1. recompile kernel, lots of modules removed, fast boot option turned on(zen sources)
2. setting network manually
3. edit xinitab
4. remove some daemons and some modules loading uneeded
the process was not hard
anyway
the result:
before: boot up took about 35-40 secs
now: boot up takes 10-13 secs
unbelievable
arch powa!!
Offline
All of this doesn't help me any since my board takes ~45-60 seconds in BIOS before passing on to GRUB. This board (Intel D5400XS) is the slowest booting board that I've ever had.
Still, keep up the good work.
I'm sure you have checked but .... is your board doing a full test on ram before boot? You can safely change it to a fast test .... I have never seen the full test catch anything the fast test couldn't.
If that is the fastest that board can boot it really sucks big time.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
#!/bin/bash # /etc/rc.shutdown . /etc/rc.conf . /etc/rc.d/functions # avoid staircase effect /bin/stty onlcr echo " " printhl "Initiating Shutdown..." echo " " # avoid NIS hanging syslog-ng on shutdown by unsetting the domainname if [ -x /bin/domainname ]; then /bin/domainname "" fi if [ -x /etc/rc.local.shutdown ]; then /etc/rc.local.shutdown fi if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then # Shutdown daemons let i=${#DAEMONS[@]} while [ $i -ge 0 ]; do if [ "${DAEMONS[$i]:0:1}" != '!' ]; then ck_daemon ${DAEMONS[$i]#@} || stop_daemon ${DAEMONS[$i]#@} fi let i=i-1 done # find any leftover daemons and shut them down in reverse order if [ -d /var/run/daemons ]; then for daemon in $(/bin/ls -1t /var/run/daemons); do stop_daemon $daemon done fi fi # Terminate all processes stat_busy "Sending SIGTERM To Processes" /sbin/killall5 -15 &> /dev/null /bin/sleep 5 stat_done stat_busy "Sending SIGKILL To Processes" /sbin/killall5 -9 &> /dev/null /bin/sleep 1 stat_done stat_busy "Saving Random Seed" /bin/dd if=/dev/urandom of=/var/run/random-seed count=1 bs=512 2> /dev/null stat_done stat_busy "Saving System Clock" /bin/rm -f /etc/localtime /bin/cp "/usr/share/zoneinfo/Europe/Brussels" /etc/localtime /sbin/hwclock --systohc --localtime --directisa stat_done # removing psmouse module to fix some reboot issues on newer laptops /sbin/modprobe -r psmouse >/dev/null 2>&1 # Write to wtmp file before unmounting /sbin/halt -w stat_busy "Deactivating Swap" /sbin/swapoff -a stat_done stat_busy "Unmounting Filesystems" /bin/umount -a -r -t noramfs,notmpfs,nosysfs,noproc stat_done stat_busy "Remounting Root Filesystem Read-only" /bin/mount -n -o remount,ro / stat_done # Power off or reboot if [ "$RUNLEVEL" = "0" ]; then printsep printhl "${C_H2}POWER OFF" /sbin/poweroff -d -f -h -i else printsep printhl "${C_H2}REBOOTING" # if kexec is installed and a kernel is loaded, use it [ -x /sbin/kexec ] && /sbin/kexec -e > /dev/null 2>&1 /sbin/reboot -d -f -i fi # End of file
Will this speed up my shutdown time? I'm having slow shutdown and also restart on my subnotebook which is an acer aspire one...Btw, nice job..:)
Netbook (Acer Aspire One 110 || 160gb SATA HD || 1.5gb ram): archlinux i686 / KDEmod 4.3
Registered Linux User # 481212 / Machine Registration # 390468
"In a world without walls and fences, who needs windows and gates?"
Offline
the rc.shutdown is mostly for completelyness, I've changed things in other files what broke stuff in rc.shutdown.
Offline
What about changing the initscripts from Bash to Dash? I've heard that you can increase boot time by doing so by a few secounds;-)
Ofc I might be wrong :-P
Offline
Sounds great, never heard of it but read the wikipedia article just now. Didn't had any experience with other shell than bash to be honest.
Offline
Thanks, will definitely try some of these
Xyne wrote:
"We've got Pacman. Wacka wacka, bitches!"
Offline
Nice post!
You can also speed up boot (3-5 seconds) by compiling kernel (with PKGBUILD + xconfig it is very easy) - removing modules you dont need and modules you need compile into kernel. Than you will need no modules (and no scanning for autoloading modules) at all, while everything will work. You may also specify your CPU when compiling kernel. This also speeds boot and whole system a bit.
Offline
I finally contributed this the the wiki: http://wiki.archlinux.org/index.php/Twe … _boot_time
I've also added some additional comments.
Offline
Maybe if someone could help me about this http://bbs.archlinux.org/viewtopic.php?id=63143
we could maybe go below 10 seconds D:
Offline
Managed mine to get to 14s (http://www.postimage.org/image.php?v=aV3743mJ).
/sbin/udevadm settle &
This didn't work for me (filesystem didn't mount at all), so I had to remove the ampersand.
Offline
I found that out pretty soon too, check http://bbs.archlinux.org/viewtopic.php? … 25#p476625
The new version is on the wiki http://wiki.archlinux.org/index.php/Twe … _boot_time
Offline
My final result from grub to gnome is 12s (~12-15s).
http://www.postimage.org/image.php?v=Pq327HKJ
Last edited by hit (2009-01-20 01:39:39)
Offline
In case anybody else wasn't paying attention like me: there's a new version of initscripts in the repository and rc.sysinit and rc.shutdown aren't in the array to be backed up as .pacsave files, so these got overwritten in my upgrade. Figured some other might appreciate a warning to be sure they back up before this upgrade.
Offline
That's the reason I'd put all these scripts here together. I'm also thinking of rewriting these scripts to make them useable on most systems.
Offline
Great job. There is plenty info on the web and this forum about tewaking for a faster boot time. It would be great to have all the info in the wiki.
Whenever I have time, and a good mood to screw things up, I will try this .
Thanks!
By striving to do the impossible, man has always achieved what is possible. Those who have cautiously done no more than they believed possible have never taken a single step forward - Mikhail Bakunin
Offline
Thank you Duologic
One of the things I like most about Arch is the speed. The instructions were clear enough that this arch newbie was able to cut his boot time in half.
I trust Microsoft about as far as I can comfortably spit a dead rat.
Cinnamon is a wonderful desktop
"Faith is the substance of things hoped for, the evidence of things not seen."
Offline
Very nice Kilz, thank you for the compliments.
joephantom: maybe make a index of all tweak articles on the wiki, that should inspire other people too to post there articles.
Offline
Hello Duologic,
I've got a small problem with my customed rc.sysinit script (based on yours)
I've got a filesystem check failed at boot time, although everything is fine. Here is the rc.sysinit script
#!/bin/bash
#
# /etc/rc.sysinit
#
. /etc/rc.conf
. /etc/rc.d/functions
echo " "
printhl "Arch Linux\n"
printhl "${C_H2}http://www.archlinux.org"
printhl "Copyright 2002-2007 Judd Vinet"
printhl "Copyright 2007-2009 Aaron Griffin"
printhl "Distributed under the GNU General Public License (GPL)"
printsep
# mount /proc, /sys and our RAM /dev
/bin/mount -n -t ramfs none /dev
/bin/mount -n -t proc none /proc
/bin/mount -n -t sysfs none /sys
# Create our default nodes that minilogd may need
/bin/mknod /dev/null c 1 3
/bin/mknod /dev/zero c 1 5
/bin/mknod /dev/console c 5 1
# More initial /dev setup that udev doesn't do
/bin/ln -snf /proc/self/fd /dev/fd
/bin/ln -snf /proc/self/fd/0 /dev/stdin
/bin/ln -snf /proc/self/fd/1 /dev/stdout
/bin/ln -snf /proc/self/fd/2 /dev/stderr
/bin/ln -snf /proc/kcore /dev/core
/bin/mkdir /dev/pts
/bin/mkdir /dev/shm
# start up our mini logger until syslog takes over
/sbin/minilogd
# anything more serious than KERN_WARNING goes to the console
# 'verbose' cmdline parameter enables more messages
if /bin/grep -q " verbose" /proc/cmdline; then
/bin/dmesg -n 8
else
/bin/dmesg -n 3
fi
# enable rtc access
/sbin/modprobe rtc-cmos >/dev/null 2>&1
RTC_MAJOR=$(/bin/grep -w rtc /proc/devices 2>/dev/null); RTC_MAJOR="${RTC_MAJOR%% *}"
if [ -n "$RTC_MAJOR" ]; then
/bin/mkdir /dev/misc/
/bin/mknod /dev/misc/rtc0 c $RTC_MAJOR 0
/bin/ln -s /dev/misc/rtc0 /dev/rtc
fi
# Set clock early to fix some bugs with filesystem checks
# Clock is set again later to match rc.conf
if [ -f /etc/localtime ]; then
/sbin/hwclock --hctosys --localtime --directisa --noadjfile
fi
echo > /proc/sys/kernel/hotplug
if [ -x /sbin/udevadm -a -d /sys/block ]; then
# We have udev and /sys appears to be mounted, use UDev
stat_busy "Starting UDev Daemon"
/sbin/udevd --daemon
/sbin/udevadm trigger &
udevstart="$(/bin/date +%s%0N)"
stat_done
else
# Static /dev, our last resort
status "Using static /dev filesystem" true
fi
# run udev uevents
if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
stat_busy "Loading UDev uevents"
udevstart="$(/bin/date +%s%0N)"
/sbin/udevadm settle &
stat_done
udevend="$(/bin/date +%s%0N)"
printhl " UDev uevent processing time: $((($udevend-$udevstart)/1000000))ms"
fi
# bring up the loopback interface
if [ -d /sys/class/net/lo ]; then
stat_busy "Bringing up loopback interface"
/sbin/ifconfig lo 127.0.0.1 up
if [ $? -ne 0 ]; then
stat_fail
else
stat_done
fi
fi
status "Mounting Root Read-only" /bin/mount -n -o remount,ro /
FORCEFSCK=
[ -f /forcefsck ] && FORCEFSCK="-- -f"
NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs,nofuse,nofuseblk"
if [ -x /sbin/fsck ]; then
stat_busy "Checking Filesystems"
if /bin/grep -qw quiet /proc/cmdline; then
/sbin/fsck -A -T -C -a -t $NETFS $FORCEFSCK >/dev/null 2>&1
else
/sbin/fsck -A -T -C -a -t $NETFS $FORCEFSCK 2>/dev/null
fi
fsckret=$?
if [ ${fsckret} -gt 1 ]; then
stat_fail
if [ $((${fsckret}&2)) -eq 2 ]; then
echo
echo "********************** REBOOT REQUIRED *********************"
echo "* *"
echo "* The system will be rebooted automatically in 15 seconds. *"
echo "* *"
echo "************************************************************"
echo
/bin/sleep 15
else
echo
echo "***************** FILESYSTEM CHECK FAILED ****************"
echo "* *"
echo "* Please repair manually and reboot. Note that the root *"
echo "* file system is currently mounted read-only. To remount *"
echo "* it read-write type: mount -n -o remount,rw / *"
echo "* When you exit the maintenance shell the system will *"
echo "* reboot automatically. *"
echo "* *"
echo "************************************************************"
echo
/sbin/sulogin -p
fi
echo "Automatic reboot in progress..."
/bin/umount -a
/bin/mount -n -o remount,ro /
/sbin/reboot -f
exit 0
fi
stat_done
fi
stat_busy "Mounting Local Filesystems"
/bin/mount -n -o remount,rw /
/bin/rm -f /etc/mtab*
# make sure / gets written to /etc/mtab
/bin/mount -o remount,rw /
# Write /proc, /sys and /dev to /etc/mtab
if [ -e /proc/mounts ]; then
/bin/grep -e "/proc " -e "/sys " -e "/dev " /proc/mounts >> /etc/mtab
fi
# now mount all the local filesystems
/bin/mount -a -t $NETFS
stat_done
status "Activating Swap" /sbin/swapon -a
/bin/rm -f /etc/localtime
/bin/cp "/usr/share/zoneinfo/Asia/Ho_Chi_Minh" /etc/localtime &
/sbin/hwclock --hctosys --localtime --directisa &
stat_done
if [ -f /var/run/random-seed ]; then
stat_busy "Initializing Random Seed"
/bin/cat /var/run/random-seed >/dev/urandom
stat_done
fi
stat_busy "Removing Leftover Files"
/bin/rm -f /etc/nologin &>/dev/null
/bin/rm -f /etc/shutdownpid &>/dev/null
/bin/rm -f /var/lock/* &>/dev/null
/bin/rm -rf /tmp/* /tmp/.* &>/dev/null
/bin/rm -f /forcefsck &>/dev/null
(cd /var/run && /usr/bin/find . ! -type d -exec /bin/rm -f -- {} \; )
: > /var/run/utmp
/bin/chmod 0664 /var/run/utmp
# Keep {x,k,g}dm happy with xorg
/bin/mkdir /tmp/.ICE-unix && /bin/chmod 1777 /tmp/.ICE-unix
/bin/mkdir /tmp/.X11-unix && /bin/chmod 1777 /tmp/.X11-unix
stat_done
#status "Updating Shared Library Links" /sbin/ldconfig
if [ "$HOSTNAME" != "" ]; then
status "Setting Hostname: tinh-desktop" /bin/hostname "tinh-desktop" &
fi
status "Updating Module Dependencies" /sbin/depmod -A &
# Flush old locale settings
: >/etc/profile.d/locale.sh
/bin/chmod 755 /etc/profile.d/locale.sh
# Set user defined locale
[ -z "$LOCALE" ] && LOCALE="en_US"
stat_busy "Setting Locale: en_US"
echo "export LANG=$LOCALE" >>/etc/profile.d/locale.sh
stat_done
stat_busy "Setting Consoles to UTF-8 mode"
# UTF-8 consoles are default since 2.6.24 kernel
# this code is needed not only for older kernels,
# but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8.
for i in $(/usr/bin/seq 0 63); do
/usr/bin/kbd_mode -u < /dev/vc/${i}
printf "\e%%G" > /dev/vc/${i}
done
# the $CONSOLE check helps us avoid this when running scripts from cron
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\e%%G"; fi' >>/etc/profile.d/locale.sh
stat_done
[ -n "$KEYMAP" ] && status "Loading Keyboard Map: $KEYMAP" /bin/loadkeys -q -u $KEYMAP
if [ -n "$CONSOLEFONT" ]; then
stat_busy "Loading Console Font: $CONSOLEFONT"
#CONSOLEMAP in UTF-8 shouldn't be used
if [ -n "$CONSOLEMAP" ] && echo "$LOCALE" | /bin/grep -qi utf ; then
CONSOLEMAP=""
fi
for i in $(/usr/bin/seq 0 63); do
if [ -n "$CONSOLEMAP" ]; then
/usr/bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C /dev/vc/${i} >/dev/null 2>&1
else
/usr/bin/setfont $CONSOLEFONT -C /dev/vc/${i} >/dev/null 2>&1
fi
done
if [ $? -ne 0 ]; then
stat_fail
else
for i in $(/usr/bin/seq 0 63); do
printf "\e(K" > /dev/vc/${i}
done
# the $CONSOLE check helps us avoid this when running scripts from cron
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\e(K"; fi' >>/etc/profile.d/locale.sh
stat_done
fi
fi
# Save our dmesg output from this boot
if [ -f /var/log/dmesg.log ]; then
/bin/rm /var/log/dmesg.log
fi
/bin/dmesg > /var/log/dmesg.log
# End of file
# vim: set ts=2 noet:
I don't know why the Filesystem check fail for my case. Any helps are appreciated.
Tinh
Offline
I never touched the part for filesystem checks, I find that too important to rumble with it.
If something goes on mounting, do a e2fsck on those filesystems from the root command line. Maybe it came with the new kernel, some exotic bug? Just mindstorming...
Offline
I had same problem as tinhtruong. Delete lines where FS is being checked. I know my FS is without errors, so why I must check it?
Offline
I had that problem too, but only after upgrading to kernel 2.6.28. After restoring the original sysinit.rc everything was back to normal.
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
I had same problem as tinhtruong. Delete lines where FS is being checked. I know my FS is without errors, so why I must check it?
I think its because errors can happen. Its best to check every so often and repair small issues that you may not be aware of before they cause even bigger ones.
I trust Microsoft about as far as I can comfortably spit a dead rat.
Cinnamon is a wonderful desktop
"Faith is the substance of things hoped for, the evidence of things not seen."
Offline
I have got a funny result, not autoloading modules and inserting them in rc.conf in modules=() . Gave me a slowdown of 2 sec. My default boot time with no tweaking gives me a boottime of 18 sec. Would be nice if it where 10 sec. I use gnome and gdm, can i not use gdm to start gnome because i dont need the login manager, but would it be faster?
Offline