You are not logged in.

#1 2012-11-23 01:42:15

minimal
Member
From: Quito, Ecuador
Registered: 2009-10-29
Posts: 42

bust boot (/home will not mount) [SOLVED]

Hello,
I have been experimenting and very happy with systemd on my old laptop - achieving 8.5s kernel+userspace boot time on an Acer travelmate 291.  Unfortunately I took it a step too far and moved systemd-udev-trigger.service unit into my ~ and now boot is stuck (I can get single-user mode only) and have figured out the simplest way out of this predicament would be to recreate  /usr/lib/systemd/systemd-udev-trigger.service and then reboot to get my /home partition back.  Could someone post this file please.  I would rather not have to restore from an old backup if possible.

Many thanks,


Peter

Last edited by minimal (2012-11-23 17:05:15)


|\/|
_________________________________________________________________________________________
"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

#2 2012-11-23 01:50:13

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: bust boot (/home will not mount) [SOLVED]

I do not know why you thought this was a good idea...

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=udev Coldplug all Devices
Documentation=man:udev(7) man:systemd-udevd.service(8)
Wants=systemd-udevd.service
After=systemd-udevd-kernel.socket systemd-udevd-control.socket
DefaultDependencies=no
ConditionCapability=CAP_MKNOD

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/udevadm trigger --type=subsystems --action=add ; /usr/bin/udevadm trigger --type=devices --action=add

Offline

#3 2012-11-23 03:24:54

minimal
Member
From: Quito, Ecuador
Registered: 2009-10-29
Posts: 42

Re: bust boot (/home will not mount) [SOLVED]

That was fast, thank you so very much.  Will try this out in the morning when I have the laptop with me and no doubt mark this one as solved.  I think its time for more reading up on the inner workings of systemd and less experimenting!  To anyone else experimenting - one lesson learnt is that many crucial unit files are set to [Service] Type=oneshot for good reason so setting those to Type=simple will most likely break dependencies -> break the boot process!

Finally, has anyone written a custom unit to mount /home?  I read somewhere that this was a good idea for faster loading of /home partition.

thanks again,


Peter

I read this last week which suddenly seems very appropriate:
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." — Albert Einstein.


|\/|
_________________________________________________________________________________________
"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

#4 2012-11-23 03:30:52

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: bust boot (/home will not mount) [SOLVED]

Your fstab is autogenerated into mount units.  You can find them at /run/systemd/generator.  You should be able to copy those, but you probably need to add a WantedBy= to them, as otherwise enabling them will not symlink them anywhere.  Or else you could always just symlink them manually to the proper places.  I would assume that these would be the local-fs.target and local-fs-pre.target.  I would think that / (or -.mount) would be in the pre, and the others would be in local-fs.target, but I am not entirely sure about this.

If you want to decrease boot time, you can take a tad off if you append libahci.ignore_sss=1 as this disables the kernel spinning disks up one at a time to check their existence.  Presumably this was created to save power on mobile systems, but if you have disks there, they are going to spin up no matter what, so you might as well disable the polling.

Offline

#5 2012-11-23 04:12:20

minimal
Member
From: Quito, Ecuador
Registered: 2009-10-29
Posts: 42

Re: bust boot (/home will not mount) [SOLVED]

Will test out that kernel option - those are safer to mess around with..  Also, I have just come across detailed information from the systemd author which I shall be reading carefully before blindly experimenting further.  I found it clearly indexed in 18 parts (to date) of a 'Systemd for administrators' blog/documentation series here:
http://www.freedesktop.org/wiki/Software/systemd

thanks a lot WonderWoofy and I hope this helps others,


Peter

Last edited by minimal (2012-11-23 04:13:58)


|\/|
_________________________________________________________________________________________
"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

#6 2012-11-23 06:56:03

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: bust boot (/home will not mount) [SOLVED]

Yeah, there is actually a post on how you can reduce boot time.  One of the examples given is that if you don't use things like LVM or any other device mapper controlled tool, you can make the systemd-udev-settle.service.  You need to figure out what your computer is actually going through on boot.  There is a built in function to make a chart to show you everything, or you can use something like bootchart2.  Bootchart2 is much more informative, but I think the built in gives adequate information. Also, 'systemd-analyze blame' will give you a very brief rundown of what your computer is starting at boot and how long each things takes.

Offline

#7 2012-11-23 17:03:41

minimal
Member
From: Quito, Ecuador
Registered: 2009-10-29
Posts: 42

Re: bust boot (/home will not mount) [SOLVED]

SOLVED: thanks a lot for your helpful tips smile will definitely look into systemd-udev-settle.service.  I didn't manage to get bootchart2 working the other day.  System-analyze blame is what got me messing with systemd-udev-trigger.service in the first place!

Last edited by minimal (2012-11-23 17:04:02)


|\/|
_________________________________________________________________________________________
"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

#8 2012-11-23 18:24:49

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: bust boot (/home will not mount) [SOLVED]

Are you using readahead?  I have heard reports that e4rat is faster, but I use an SSD, so both of those things don't benefit me at all.  In fact they can be destructive to an SSD since they simple gather boot files and write them to a single place (so more writes).  With a nearly non-existent seek time with SSDs, this serves no really useful purpose.

But with a rotational HDD, it can make huge differences.


Edit: Oh yeah, and i wanted to comment on you changing the service Type= from oneshot to simple.  The two are not the same whatsoever.  Oneshot is exaclty what it sounds like, it runs through the commands (ExecStartPre=, ExecStart=, then ExecStartPost=) and then finishes.  These are usually the one listed as "dead" when you run just systemctl without arguments.  This is because they are exactly that... dead... they have done what they needed to do and exited, they did not fail, but they are not alive any longer.  Simple is used to actually run something in a tradition daemon kind of a way.  I believe it is just used for things that run continuously, but do not fork and typicall do not have a pid file.

I have seen reports of people saying that vconsole.conf takes some time to set up on boot (systemd-vconsole-setup.service).  I do not experience this, but if you use the default keymap and console font, you can actually remove this file and/or mask the service file.  Though I think that since you are from Central America, there is a change that your system is not in English.

I would also imagine that if you have no specific modules being loaded per the /etc/modules-load.d directory, then masking systemd-modules-load.service file will proabbly not harm anything.

Here is some info about decreasing boot time.  It is written by Lennart Poettering himself, so the information is certainly good.


In the future, instead of simply editing the files in /usr/lib/systemd/system, copy them to /etc/systemd/system and then edit them there.  The files in /etc will take priority over the files in /usr if they bear the same name.  So if you f*ck one up real bad, you can simply delete (or rename) the file in question and then re-enable (probably disable then enable) to create the correct symlink.

Last edited by WonderWoofy (2012-11-23 18:42:23)

Offline

#9 2012-11-24 04:15:07

minimal
Member
From: Quito, Ecuador
Registered: 2009-10-29
Posts: 42

Re: bust boot (/home will not mount) [SOLVED]

Interesting about readahead, I will look into that one.  I read Lennart Poettering's article the other day and in it is mentioned service type=simple.  it really made a speed differnce to the running of systemd-logind.service.  Also, I have actually removed vconsole.conf and it reset the tty kepmap back to the default installed (US) but that's ok, I am considering recreating it though it doesn't really bother me.  My X keymap is not affected (I bought the laptop in the UK so this is uk keymap).  I don't have any modules in that directory so disabed and moved the systemd-modules-load.service out of the way now.  Your last comment is excellent, it certainly makes it a lot more failsafe! 

My laptop is not SSD unfortunately, its a 1st generation intel centrino Intel Pentium M 1.4GHz single processor, running aa 7200rpm ide hdd and maxed the ram with 2gb.  My hdd is 40gb in size and more than enough for me and it never ceases to amaze me how fast it can run compared to a work i7 processor 64-bit laptop on Windows7 if the config + software is carefully selected.

I have blacklisted a number of kernel modules in modprobe.conf before installing linux-ck kernel (from the binaries optimised for my processor):

install ohci1394 /bin/false
install firewire-ohci /bin/false
install firewire_core /bin/false

# Peter: disable ethernet port
# Peter: this next line required for tethering!
install mii /bin/false
install 8139too /bin/false
install 8139cp /bin/false

install bluetooth /bin/false
install btusb /bin/false

install mxm_wmi /bin/false
install ttm /bin/false
install nouveau /bin/false
install joydev /bin/false
install serio_raw /bin/false

install pcmcia_core /bin/false
install pcmcia_rsrc /bin/false
install yenta_socket /bin/false

install psmouse /bin/false
install lpc_ich /bin/false

#Peter: do NOT uncomment this line as it will prevent kernel from compiling wit$
###install crc_itu_t /bin/false

# Peter: according to laptop archwiki article:
options usbcore autosuspend=1

I didn't quite understand your comment about systemd-udev-settle.service - did you mean I can replace systemd-udev-trigger.service with the ..settle.service instead?

Last edited by minimal (2012-11-24 04:18:41)


|\/|
_________________________________________________________________________________________
"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

#10 2012-11-24 04:26:57

minimal
Member
From: Quito, Ecuador
Registered: 2009-10-29
Posts: 42

Re: bust boot (/home will not mount) [SOLVED]

Yes I am using readahead, I struggled getting e4rat to work last week and went back to this.  So its goodbye consolekit+initscripts and welcome systemd!  Incidentally, this is what I have for system-analyze at the moment:

peter ~ $ systemd-analyze
Startup finished in 3135ms (kernel) + 6079ms (userspace) = 9215ms
peter ~ $ systemd-analyze blame
   691ms systemd-udev-trigger.service
   680ms var-lib-pacman.mount
   420ms systemd-sysctl.service
   394ms dev-mqueue.mount
   387ms var-lib-ntp-proc.mount
   280ms systemd-udevd.service
   220ms var-lib-ntp-lib.mount
   145ms systemd-tmpfiles-setup.service
   124ms home.mount
   104ms dev-sda2.swap
    87ms systemd-vconsole-setup.service
    80ms var-lib-ntp-etc-services.mount
    76ms var-lib-ntp-etc-resolv.conf.mount
    46ms systemd-remount-fs.service
    34ms tmp.mount
     7ms home-peter-.cache-chromium.mount
     3ms systemd-user-sessions.service

times seem to vary quite a bit from boot to boot, not sure why. Can someone spot something more I could improve in my fstab file? 

# UUID=4bbe422c-ea53-4518-970f-dfaf0e747c94
##/dev/sda1             /               ext4            rw,relatime     0 1

# UUID=96ec271f-c5db-4cc9-9eae-0c76c684e6ca
/dev/sda3               /home           ext4            rw,relatime,noauto,x-systemd.automount  0 2

# UUID=d420454f-9183-4c05-b4f8-d5bad4c34912
/dev/sda2               none            swap            defaults        0 0

#ntpd chroot mounts
/etc/resolv.conf  /var/lib/ntp/etc/resolv.conf none bind 0 0
/etc/services     /var/lib/ntp/etc/services none bind 0 0
/lib                      /var/lib/ntp/lib none bind 0 0
/proc             /var/lib/ntp/proc none bind 0 0

#Peter: chromium cache in /home:
tmpfs     /home/peter/.cache/chromium tmpfs mode=1777,noatime 0 0
/var/lib/pacman.db /var/lib/pacman ext2 loop,noatime 0 0

Thanks for all the pointers, I think I will backup my /usr/lib/systemd directory so I don't lose all I have achieved with the next systemd upgrade..

Last edited by minimal (2012-11-24 04:43:04)


|\/|
_________________________________________________________________________________________
"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

#11 2012-11-24 05:13:09

minimal
Member
From: Quito, Ecuador
Registered: 2009-10-29
Posts: 42

Re: bust boot (/home will not mount) [SOLVED]

I commented out the last pacman line in my fstab file and I have a new record:

peter ~ $ systemd-analyze
Startup finished in 3292ms (kernel) + 5074ms (userspace) = 8366ms
peter ~ $ systemd-analyze blame
   465ms systemd-udev-trigger.service
   403ms systemd-sysctl.service
   377ms dev-mqueue.mount
   263ms systemd-udevd.service
   212ms var-lib-ntp-proc.mount
   185ms var-lib-ntp-lib.mount
   160ms var-lib-ntp-etc-services.mount
   158ms var-lib-ntp-etc-resolv.conf.mount
   144ms systemd-tmpfiles-setup.service
   140ms tmp.mount
   120ms home.mount
    79ms systemd-vconsole-setup.service
    38ms systemd-remount-fs.service
    26ms dev-sda2.swap
     8ms home-peter-.cache-chromium.mount
     4ms systemd-user-sessions.service

..and with that I am off to sleep

Last edited by minimal (2012-11-24 05:20:12)


|\/|
_________________________________________________________________________________________
"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

#12 2012-11-24 06:29:38

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: bust boot (/home will not mount) [SOLVED]

Code blocks use square brackets like [ and ].

I mean that the only reason why the udev settle service should be needed is if you use something that utilizes the device mapper module.  I am not sure if this gets pulled in with Arch if you do not use ofe of these things (ie. dm-raid, lvm, dm-crypt+LUKS).  But if it does and you do not use one of these things, you don't need it.  It can be masked. 

That makes me think of one more thing.  Instead of moving the actual file from the directory to disable it, instead mask it with

# systemctl mask <unit-to-be-masked> 

  systemd-udev-trigger.service apparently runs the udev rules, so is a vital part of your computers overall functionality.  Messing with that is probbaly very bad.  I would imagine that the configurations of the systemd-*.service files are all written the way they are for a reason.  I would venture to guess that the developers probably know what Type= is appropriate for the files that ship with systemd.  The other service files from 3rd part developers might be a bit more maliable, but still I would typically guess that their understanding of the daemon in question is better than the end users.

Offline

#13 2012-11-24 06:47:27

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: bust boot (/home will not mount) [SOLVED]

You don't need the ntpd crap in your fstab.  Running in a chroot is unnecessary.

Use noatime instead of relatime, it is faster all around.

Check out this post from Dave Reisner: http://blog.falconindy.com/articles/opt … tcpio.html

There is a thread about systemd startup times in the forums.  You should probably read through that, since you seem to be totally infatuated with boot time.  There are some good pointers in there on how to speed things up.

Offline

#14 2012-11-24 16:36:05

minimal
Member
From: Quito, Ecuador
Registered: 2009-10-29
Posts: 42

Re: bust boot (/home will not mount) [SOLVED]

Thanks for the useful tips as usual.  Will definitely use the 'mask' option, I wasn't aware of that one and yes, this has turned out to be a very entertaining waste of time for me haha.


|\/|
_________________________________________________________________________________________
"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

#15 2012-11-24 17:18:17

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

Re: bust boot (/home will not mount) [SOLVED]

minimal wrote:

I have blacklisted a number of kernel modules in modprobe.conf

What you're doing isn't blacklisting -- you're using install rules to force insertion to fail. It's a hack. It means that kmod will still resolve the alias, find dependencies, and try to insert the module. If you properly use the 'blacklist' directive instead, kmod will simply ignore the module.

I suggest you start using /etc/modprobe.d/ instead of /etc/modprobe.conf as well. The latter isn't recommended, and may some day stop being read.

Offline

#16 2012-12-03 21:10:05

minimal
Member
From: Quito, Ecuador
Registered: 2009-10-29
Posts: 42

Re: bust boot (/home will not mount) [SOLVED]

thanks a lot falconindy, will definitely look into that one when I have more time!


|\/|
_________________________________________________________________________________________
"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

Board footer

Powered by FluxBB