0

I have Windows 10 and Ubuntu 17.04 on dual boot (120Gb SSD, 100 for windows and the rest for Linux). When I installed Ubuntu in the second partition, I did not create any swap partition (I have 4Gb of ram and most forums said that with 4Gb+ you do not need swap), so I just created a root partition / with all the 20gb available and selected to encrypt my Home folder only.

The thing is that it's taking 1-2min to boot Ubuntu, while windows boots up in around 10 seconds or less.

I saw some posts here about this issue but most of the cases the OP had the swap partition created, and this is not my case.

What can I do? Install it again and create a swap partition this time or do I take another approach? I'm not tech savvy regarding Ubuntu, so I'd appreciate if you guys show me some steps do identify the issue, thanks!

EDIT #1

My Windows 10 is not set with fastboot because I can access all files/folders of Windows partition inside Linux.

EDIT #2

Output from sudo fdisk -l :

Disk /dev/loop0: 80,5 MiB, 84393984 bytes, 164832 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop1: 76 MiB, 79683584 bytes, 155632 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sda: 111,8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x39380a4e

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048   1026047   1024000  500M  7 HPFS/NTFS/exFAT
/dev/sda2         1026048 193478655 192452608 91,8G  7 HPFS/NTFS/exFAT
/dev/sda3       193480702 234440703  40960002 19,5G  5 Extended
/dev/sda5       193480704 234440703  40960000 19,5G 83 Linux

Disk /dev/sdb: 931,5 GiB, 1000204138496 bytes, 1953523708 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2de2a99a

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1        2048 1953519615 1953517568 931,5G  7 HPFS/NTFS/exFAT

Output from systemd-analyze :

Startup finished in 5.074s (kernel) + 3min 514ms (userspace) = 3min 5.588s

Output from systemd-analyze blame :

7.518s NetworkManager-wait-online.service
3.920s fwupd.service
3.015s iio-sensor-proxy.service
1.217s dev-sda5.device
739ms apt-daily.service

EDIT #3:

Output from systemd-analyze critical-chain :

graphical.target @1min 38.007s
└─multi-user.target @1min 38.007s
  └─virtualbox.service @1min 37.938s +68ms
    └─network-online.target @1min 37.937s
      └─NetworkManager-wait-online.service @1min 30.418s +7.518s
        └─NetworkManager.service @1min 30.306s +105ms
          └─dbus.service @1min 30.281s
            └─basic.target @1min 30.273s
              └─sockets.target @1min 30.273s
                └─snapd.socket @1min 30.265s +8ms
                  └─sysinit.target @1min 30.264s
                    └─apparmor.service @193ms +264ms
                      └─local-fs.target @190ms
                        └─media-gdf897g6f9-HD\x20TOURO.mount @1min 50.061s
                          └─dev-sdb1.device @1.467s

EDIT #4:

Here's a image of command systemd-analyze plot > test.svg, a huge gap before sysinit.target, not sure what it means.

http://svgur.com/s/2SA

muru
  • 207,228

3 Answers3

1

I could find a fix that a Reddit user posted, it was actually a bug:

In Ubuntu 17.04, there is a bug in the installer when using home folder encryption - a swap partition is referenced but 17.04 now uses a swap file.

Open /etc/crypttab in a text editor and change the following:

cryptswap1 UID=XXXXXXXX

to this:

cryptswap1 /swapfile

Now my Ubuntu boots in like 6 seconds :-)

0

I faced the same issue, with exactly 30 seconds gap around the following entries on dmesg, which reduced to less than 1 second after the fix -

[    3.675210] EXT4-fs (sda5): re-mounted. Opts: errors=remount-ro
[    3.804315] [drm] RC6 on
[    4.566877] random: crng init done
[    4.566879] random: 7 urandom warning(s) missed due to ratelimiting

I tried several fixes suggested, without any success -

  1. Updating '/etc/fstab' with output from 'blkid'
  2. Installing haveged and rng-tools or rng-tools5 (although my processor has support for Secure Key)

It turns out that the issue was that initramfs tried to locate the swap space that I had created while installing from a live USB. The UUID of swap partition lying on the USB is sought for 30 seconds, before moving on with the boot. This needs to be fixed at two places -

  1. update-initramfs -uk all' #using updated version of initramfs-tools - 0.130ubuntu3.1
  2. Removing the override (if any) from '/etc/initramfs-tools/conf.d/resume' by either commenting out the entry or marking RESUME=none

Detailed bug fix given here - https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1771962

0

Windows 10 takes less time, because by default it doesn't shutdown completely (If you want to access your windows partition from Linux, you have to turn off this feature). It hibernates and resumes at power on. Creating swap partition is a good thing as some apps use swap area (like gimp, inkscape, vmware etc). you can control swapiness for your OS, that will help you reduce the wear-tear of your SSD.

Use following link to adjust swapiness

How do I configure swappiness?

And to add swap to your install use

https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

Or you can start from fresh install.

And if you know exactly what kind of hardware you have, you can disable unwanted modules from kernel.

Keep only wanted apps in startup applications.

Disable services to start on, such as

  • ftp server
  • apache or nginx
  • clamav
  • openssh-server

etc.

But then you have to start them manually or you can add crontabs to start them after bootup.

I hope it helps.

DeepSidhu1313
  • 305
  • 1
  • 4
  • 15