You are not logged in.

#101 2009-02-22 11:55:00

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: 2 days of tweaking for a faster boot time

Hide wrote:

I'm interested in one thing here (and it's a bit OT, sorry smile). The part of the boot process, after the grub, but before the rc.sysinit stuff - does its speed depend on the system adjustments or the computer itself (cpu and memory speed, etc)?

Before rc.sysinit, you'll have initrd. To tweak this you need to recompile the kernel. Also check mkinitcpio.conf for this.

The speeds(boot and running) always depend on your hardware, otherwise I'll be using a cheap second hand [$€]50 laptop with a Pentium 3 or something. Now I think of it, I should get me one of those for low-end stuff.

Offline

#102 2009-02-22 12:06:19

Hide
Member
From: Castalia
Registered: 2007-02-02
Posts: 368

Re: 2 days of tweaking for a faster boot time

Oh, so that's initrd work? I had no idea. I'll fiddle with kernel when I have some more time smile

Thanks for the info smile

Offline

#103 2009-03-13 03:14:22

hybwar
Member
Registered: 2009-03-13
Posts: 10

Re: 2 days of tweaking for a faster boot time

Hi all

after apply this this tutorial, that are realy nice my archlinux 64 dont boot anymore

The trouble come from rc.sysinit, and that fail to checking filesystem.
i use a jfs partition and in my fstab my drive is named by UUID
BTW Im using the latest archlinux distro

like i said it fail at checking the filesystem
With error :

fsck.jfs version 1.1.13 17-jul-2008
can't open device UUID= (THE UUID)

So after this i can loging in root but the system root / is in read only
I look a bit up and it said that if i wanna set it in read/write i only need to type

mount -n -o remount,rw /

So i made that but it tell me that the / is not mounted or that the option is bad ????

i know that i need to put the original rc.sysinit for making my system reworking
but now i a bit lose ... Some advise is welcome

War

Offline

#104 2009-03-13 03:24:02

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,563

Re: 2 days of tweaking for a faster boot time

Probably related to JFS needing to be mounted read-only before it's mounted read-write.

Offline

#105 2009-03-13 03:30:19

hybwar
Member
Registered: 2009-03-13
Posts: 10

Re: 2 days of tweaking for a faster boot time

im starting at linux so if you can give some command to help it will be appreciate

War

Offline

#106 2009-03-13 05:45:06

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: 2 days of tweaking for a faster boot time

hybwar, If you have not backed up your initscripts, do the following:

Boot with the arch livecd.
"dhcpcd eth0" or get your network up and running the way you prefer.
Mount your root partition to /mnt/*whatever*.
Chroot into it: "chroot /mnt/*whatever*".
pacman -S initscripts.
Type "exit".
Reboot.

These "optimizations" can cause some problems and are not really worth it IMO.

Last edited by Ashren (2009-03-13 06:12:38)

Offline

#107 2009-03-13 06:55:37

Sander Hoksbergen
Member
Registered: 2009-01-06
Posts: 32

Re: 2 days of tweaking for a faster boot time

hybwar wrote:

im starting at linux so if you can give some command to help it will be appreciate

War

These optimizations were tuned specifically to his system ^_^. You should not just copy them, but learn from them and apply the changes yourself.

Offline

#108 2009-03-13 08:34:37

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: 2 days of tweaking for a faster boot time

As Sander says...
To be honest, I don't use these optimizations any more because of I need a really stable system.
They are just fun when you want to get to know linux and your system.

Offline

#109 2009-03-13 18:48:52

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: 2 days of tweaking for a faster boot time

there are two lines in /etc/rc.sysinit that affect successful system boot:

original:
# now mount all the local filesystems
/bin/mount -a -t $NETFS
stat_done

modified:
# now mount all the local filesystems
/bin/mount -F -a -t $NETFS
stat_done

forking is not a safe idea

second line:
original:
status "Activating Swap" /sbin/swapon -a

modified:
status "Activating Swap" /sbin/swapon -a &

swap needs to start in a specific order if fail then system will refuse to boot properly. The problems you described probably are caused by the first change, so boot any live CD and edit rc.sysinit, changing back these two (at least).
The reminder of the changes should not affect fs/partition mounting and mostly these are harmless meaning that these do not affect boot speed that much.

Finally, if you incompletely deleted, commented out something, you will also see some errors but message generated would be different (unless just before disk mounting)

Last edited by broch (2009-03-13 18:49:14)

Offline

#110 2009-03-13 21:33:14

hybwar
Member
Registered: 2009-03-13
Posts: 10

Re: 2 days of tweaking for a faster boot time

Hi again and thanks for the help
Like i said im new to Archlinux and i appreciate help here and like i said before i can login but the filesystem is in read only so i try to make what Ashren tell me

1 : first i but the livecd
2: dhcpcd eth0 up


Mount your root partition to /mnt/*whatever*

How can i  see where is my root partition are ? P.S i use jfs filesystem
plz give me the exact command to type

Sorry for my inexperience in shell command wink


P.S is some one can post the original rc.sysinit here it will be usefull if i can put the dans /etc/rc.sysinit read/write

War

Last edited by hybwar (2009-03-13 21:41:26)

Offline

#111 2009-03-13 21:50:34

csstaub
Member
From: Switzerland
Registered: 2009-02-09
Posts: 37

Re: 2 days of tweaking for a faster boot time

You need to run fsck on your JFS filesystem. JFS refuses to mount as read/write after an unclean reboot (that is, if it wasn't unmounted correctly). Just type fsck device into the livecd-console, where device is the device with your JFS filesystem, e.g. /dev/sda1. Maybe this should be checked for in the initscripts?

Last edited by csstaub (2009-03-13 21:51:43)

Offline

#112 2009-03-13 22:00:47

hybwar
Member
Registered: 2009-03-13
Posts: 10

Re: 2 days of tweaking for a faster boot time

ok i check what i have in /dev
And i have no sda1 or anything staring with sda

i have a scd0 but i thing its the cdrom, i have to sg0,sr0
again im lose but i know that you will help to find the fuck wink

war

Offline

#113 2009-03-13 22:07:44

csstaub
Member
From: Switzerland
Registered: 2009-02-09
Posts: 37

Re: 2 days of tweaking for a faster boot time

It's the device you installed your sytem on, how can you forget what it was called? Just look for devices with ls /dev/(s|h)d??

Offline

#114 2009-03-13 22:27:16

hybwar
Member
Registered: 2009-03-13
Posts: 10

Re: 2 days of tweaking for a faster boot time

Note to my self: always connect power when swap ide hd smile

ok now i got it and fsck /dev/sda3 make my filesystem read/write
Now i can boot my brand new archlinux 64
i wanna thanks you all that give me support here

Now it's my time to help the archlinux projet

P.S Duologic could your modifie you tutorial (rc.sysinit) for exlude this trouble
mabye other noob like me will broke there arch wink

War

Last edited by hybwar (2009-03-13 22:27:50)

Offline

#115 2009-03-14 01:15:24

salinas_v
Member
From: México
Registered: 2007-12-20
Posts: 17
Website

Re: 2 days of tweaking for a faster boot time

I just upgraded initscripts and applied again the changes. Somehow I got some problems with my wireless.

I use wicd and it didn't found my wireless network, I tried to set manually my essid and failed with some error about the operation not being available. iwlist scan do find my network but... something is wrong.
any idea?

Offline

#116 2009-03-14 09:18:48

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: 2 days of tweaking for a faster boot time

hybwar: You are free to edit the wiki as you like, as that is the same for anyone here.

salinas_v: I don't think that it has to do something with the initscripts (or the tweaks), You should be root to connect your wireless device to anything. For iwlist working right, your wireless device works right too.

Offline

#117 2009-03-14 20:40:19

salinas_v
Member
From: México
Registered: 2007-12-20
Posts: 17
Website

Re: 2 days of tweaking for a faster boot time

Dulogic: Obviously I was sudoing the commands. ;-)

I will try again. It just looks weird because when I restored the stock init scripts it worked again. Also, I saw 16ms for udev events, when I have seen ~30ms before upgrading, maybe it's unrelated.

Offline

#118 2009-03-14 20:53:14

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: 2 days of tweaking for a faster boot time

Strange, maybe certain modules don't get loaded or loaded in the wrong sequence.
What hardware are you running on? (wireless card etc.)
Maybe some modules are loaded in the background but not yet loaded when another needs them and so on..

Offline

#119 2009-03-14 21:18:18

salinas_v
Member
From: México
Registered: 2007-12-20
Posts: 17
Website

Re: 2 days of tweaking for a faster boot time

This is what my lspci -k says about my Wireless card.

Network controller: Intel Corporation PRO/Wireless LAN 2100 3B Mini PCI Adapter (rev 04)
    Subsystem: Intel Corporation Device 2565
    Kernel driver in use: ipw2100
    Kernel modules: ipw2100

and lsmod |grep ipw2100

ipw2100                71984  0 
ieee80211              29512  1 ipw2100

This is with the stock scripts.

The weirdest thing about this is iwlist scan do work and iwconfig do not.

Offline

#120 2009-03-15 17:04:03

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: 2 days of tweaking for a faster boot time

Search in /etc/rc.sysinit and /lib/udev/load-modules.sh

/sbin/modprobe $mod &

Remove the amperand (&) and reboot...

Offline

#121 2009-03-15 21:32:43

scottuss
Member
From: England
Registered: 2009-02-20
Posts: 77

Re: 2 days of tweaking for a faster boot time

I might have a look at doing something similar on my main box (if I get time.. forgive the bad pun) but I find Arch to boot so fast anyway, I'm not sure if it's much of an advantage, and yes I am one of those people who turn their computer's off regularly. I see no point in having it running when I'm not using it.

Offline

#122 2009-03-15 22:33:32

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: 2 days of tweaking for a faster boot time

As I said before, i'm not using these tweaks on my current system. I turn my computer off many times a day.. it is a laptop but I would do it with a normal computer too.
I'm a student and use may laptop all day long and turn the thing of between every course. Standby or hibernate would be an option, but not that much an advantage. Archlinux is somewhat the fastest booting distro around, with a standard install that is.

Offline

#123 2009-03-17 13:11:33

scottuss
Member
From: England
Registered: 2009-02-20
Posts: 77

Re: 2 days of tweaking for a faster boot time

Plus it's fun to tweak!

Offline

#124 2009-03-17 13:57:43

hit
Member
From: Estonia
Registered: 2009-01-14
Posts: 79

Re: 2 days of tweaking for a faster boot time

It *was* fun, since I've lost almost all tweaks now because of updates. I don't have time and will to re-do this, but it was cool smile

Offline

#125 2009-03-22 10:46:56

markp1989
Member
Registered: 2008-10-05
Posts: 431

Re: 2 days of tweaking for a faster boot time

i have done similar things to you. i still wana get it  faster, i will probably be able to save a bit by changing how the locale and time zone are set.


here is my bootchart
bootchart-9.png


here is my rc.multi

here i have all the daemons starting in the background. with delays so they do not run till after i am in X the only thing that runs straight away is the networking

#!/bin/bash
#
# /etc/rc.multi
#

. /etc/rc.conf
. /etc/rc.d/functions

# Load sysctl variables if sysctl.conf is present
[ -r /etc/sysctl.conf ] && /sbin/sysctl -q -p &>/dev/null

# Start daemons
#for daemon in "${DAEMONS[@]}"; do
#    if [ "$daemon" = "${daemon#!}" ]; then
#        if [ "$daemon" = "${daemon#@}" ]; then
#            start_daemon $daemon
#        else
#            start_daemon_bkgd ${daemon:1}
#        fi
#    fi
#done

dhcpcd eth0 &>/dev/null 2>&1
alsactl restore &
echo 2 > /sys/module/hid_apple/parameters/fnmode &
(sleep 20 && /etc/rc.d/sensors start &>/dev/null 2>&1) & 
(sleep 20 && /etc/rc.d/mpd start) & 
(sleep 120 && /etc/rc.d/portmap start &>/dev/null 2>&1) & 
(sleep 120 && /etc/rc.d/nfslock start &>/dev/null 2>&1) & 
(sleep 200 && mount 192.168.1.99:/media/torrents /media/downloads/ ) & 
#if [ -x /etc/rc.local ]; then
#    /etc/rc.local
#fi

# vim: set ts=2 noet:

and here is my rc.sysinit
i have removed all of the module loading stuff, and just used modprobe directly to load the modules that my hardware needs,

other stuff such as raid and encrypted partitions has also been removed

 #!/bin/bash
#
# /etc/rc.sysinit
#
. /etc/rc.conf
. /etc/rc.d/functions
#source_functions
# 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

echo > /proc/sys/kernel/hotplug
# Starting udev daemon
if [ -x /sbin/udevadm -a -d /sys/block ]; then
    # We have udev and /sys appears to be mounted, use UDev
    #status "Starting UDev Daemon" /etc/start_udev init
    stat_busy "Starting UDev Daemon"
    /sbin/udevd --daemon
    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
    #status "Loading UDev uevents" /etc/start_udev uevents
    stat_busy "Loading UDev uevents"
    udevstart="$(/bin/date +%s%0N)"
    /sbin/udevadm trigger
    /sbin/udevadm settle
    stat_done
    udevend="$(/bin/date +%s%0N)"
    printhl "   UDev uevent processing time: $((($udevend-$udevstart)/1000000))ms"
fi

##loading modules
stat_busy "Loading Modules"
/sbin/modprobe ohci_hcd >/dev/null 2>&1
/sbin/modprobe ehci-hcd >/dev/null 2>&1
/sbin/modprobe nvidia >/dev/null 2>&1 
/sbin/modprobe psmouse >/dev/null 2>&1
/sbin/modprobe r8169 >/dev/null 2>&1
/sbin/modprobe slhc >/dev/null 2>&1
#/sbin/modprobe  pcspkr >/dev/null 2>&1
#/sbin/modprobe  snd_pcsp >/dev/null 2>&1
stat_done

##loading acpi modules
stat_busy "Loading standard ACPI modules"
/sbin/modprobe thermal >/dev/null 2>&1
/sbin/modprobe processor >/dev/null 2>&1
/sbin/modprobe button  >/dev/null 2>&1
/sbin/modprobe battery >/dev/null 2>&1
/sbin/modprobe ac >/dev/null 2>&1
stat_done


# 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

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 5 seconds. *"
            echo "*                                                          *"
            echo "************************************************************"
            echo
            /bin/sleep 5
        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

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
stat_done


if [ "$HOSTNAME" != "" ]; then
    status "Setting Hostname: $HOSTNAME" /bin/hostname $HOSTNAME
fi


status "Updating Module Dependencies" /sbin/depmod -A

# 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:

and here is my inittab

#
# /etc/inittab
#

#  Runlevels:
#    0    Halt
#    1(S)    Single-user
#    2    Not used
#    3    Multi-user
#    4    Not used
#    5    X11
#    6    Reboot

## Only one of the following two lines can be uncommented!
# Boot to console
id:3:initdefault:
# Boot to X11
#id:5:initdefault:

rc::sysinit:/etc/rc.sysinit
rs:S1:once:/etc/rc.single
rm:2345:once:/etc/rc.multi
rh:06:once:/etc/rc.shutdown
su:S:once:/sbin/sulogin -p

# -8 options fixes umlauts problem on login
#c1:2345:respawn:/sbin/agetty -8 38400 vc/1 linux
c1:2345:respawn:/bin/login -f mark vc/1 </dev/vc/1 >/dev/vc/1 2>&1
c2:2345:respawn:/sbin/agetty -8 38400 vc/2 linux
c3:2345:respawn:/sbin/agetty -8 38400 vc/3 linux
#c4:2345:respawn:/sbin/agetty -8 38400 vc/4 linux
#c5:2345:respawn:/sbin/agetty -8 38400 vc/5 linux
#c6:2345:respawn:/sbin/agetty -8 38400 vc/6 linux

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# Example lines for starting a login manager
x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >& /dev/null

# End of file

Last edited by markp1989 (2009-03-22 10:51:25)


Desktop: E8400@4ghz - DFI Lanparty JR P45-T2RS - 4gb ddr2 800 - 30gb OCZ Vertex - Geforce 8800 GTS - 2*19" LCD
Server/Media Zotac GeForce 9300-ITX I-E - E5200 - 4gb Ram - 2* ecogreen F2 1.5tb - 1* wd green 500gb - PicoPSU 150xt - rtorrent - xbmc - ipazzport remote - 42" LCD

Offline

Board footer

Powered by FluxBB