8

I have installed a fresh Ubuntu 17.10 and it takes long time to shutdown. We are talking about 10 minutes.

My computer:

  • Acer Aspire E 15 E5-575G-55F8
  • CPU: Intel Core i5-7200U
  • GPU: Nvidia GeForce 940MX
  • Ram: 8GB
  • HD: 128 GB SSD

Image of shutdown

Any suggestions?

Edit 2017-10-28:

After I changed the grapich driver to Nvidia I was able to get more output from the shutdown: Network and WPA Supplicant shutdown took 5 minutes

Rest of shutdown

Edit 2017-10-29:

sudo blkid

[sudo] password for sindre: 
/dev/sda1: LABEL="Recovery" UUID="4C52B20E52B1FD30" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="afd7eb36-49c2-48df-93b7-a8f328f98581"
/dev/sda2: UUID="C8B2-804F" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="7c25539d-2831-487b-b467-3a6e3a62fe12"
/dev/sda3: PARTLABEL="Microsoft reserved partition" PARTUUID="59075249-24b1-413e-8310-4ae8dc65c50c"
/dev/sda4: LABEL="Windows" UUID="1AC0C05AC0C03E2F" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="8d462818-1f35-4925-858f-02ccc1a4900c"
/dev/sdb1: UUID="8037-5488" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="ce57fe35-c6af-42b8-bc25-49f2267c633f"
/dev/sdb2: UUID="ecd9e853-3f4b-47b8-b620-e2fbb5a5c677" TYPE="ext4" PARTUUID="f3879da4-fe63-4066-a2a6-c46dabaa200e"

cat /etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdc2 during installation
UUID=ecd9e853-3f4b-47b8-b620-e2fbb5a5c677 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=C8B2-804F  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0
/dev/mapper/cryptswap1 none swap sw 0 0

cat /etc/crypttab

cryptswap1 /target/swapfile /dev/urandom swap,offset=1024,cipher=aes-xts-plain64

free -h

              total        used        free      shared  buff/cache   available
Mem:           7,7G        1,6G        4,5G        469M        1,6G        5,5G
Swap:            0B          0B          0B

sudo swapon -s

(no output in terminal - blank screen)

gparted

I installed it from Ubuntu Software, but I can not start the program. I go to Start -> gparted -> (Enter password) -> Nothing happens..

sudo journalctl --list-boots

 0 89202fbe0dae42f98301d9f6decdddf2 Sun 2017-10-29 11:04:51 CET—Sun 2017-10-29 1

sudo journalctl -b -1

Data from the specified boot (-1) is not available: No such boot ID in journal

sudo jornalctl -b -0

-- Logs begin at Sun 2017-10-29 11:04:51 CET, end at Sun 2017-10-29 11:26:28 CET. --
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: microcode: microcode updated early to revision 0x62, date = 2017-04-27
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: random: get_random_bytes called from start_kernel+0x42/0x4e1 with crng_init=0
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: Linux version 4.13.0-16-generic (buildd@lcy01-02) (gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu2)) #19-Ubuntu SMP Wed Oct 11 18:35:14 UTC 2017 (Ubuntu 4.13.0-16.19-gener
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-16-generic.efi.signed root=UUID=ecd9e853-3f4b-47b8-b620-e2fbb5a5c677 ro
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: KERNEL supported cpus:
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel:   Intel GenuineIntel
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel:   AMD AuthenticAMD
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel:   Centaur CentaurHauls
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: x86/fpu: Supporting XSAVE feature 0x008: 'MPX bounds registers'
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: x86/fpu: Supporting XSAVE feature 0x010: 'MPX CSR'
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: x86/fpu: xstate_offset[3]:  832, xstate_sizes[3]:   64
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: x86/fpu: xstate_offset[4]:  896, xstate_sizes[4]:   64
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: x86/fpu: Enabled xstate features 0x1f, context size is 960 bytes, using 'compacted' format.
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: e820: BIOS-provided physical RAM map:
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x0000000000000000-0x0000000000057fff] usable
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x0000000000058000-0x0000000000058fff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x0000000000059000-0x000000000009dfff] usable
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x000000000009e000-0x00000000000fffff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x0000000000100000-0x000000007110afff] usable
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x000000007110b000-0x000000007110bfff] ACPI NVS
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x000000007110c000-0x000000007110cfff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x000000007110d000-0x0000000072a87fff] usable
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x0000000072a88000-0x0000000073b87fff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x0000000073b88000-0x0000000089d9dfff] usable
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x0000000089d9e000-0x000000008a78dfff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x000000008a78e000-0x000000008ae7dfff] ACPI NVS
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x000000008ae7e000-0x000000008aefdfff] ACPI data
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x000000008aefe000-0x000000008aefefff] usable
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x000000008aeff000-0x000000008fffffff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x00000000e0000000-0x00000000efffffff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x00000000fd000000-0x00000000fe7fffff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x00000000fed00000-0x00000000fed00fff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x00000000fed10000-0x00000000fed19fff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x00000000fed84000-0x00000000fed84fff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x00000000ffa00000-0x00000000ffffffff] reserved
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: BIOS-e820: [mem 0x0000000100000000-0x000000026effffff] usable
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: NX (Execute Disable) protection: active
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: e820: update [mem 0x70ec0018-0x70ed0057] usable ==> usable
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: e820: update [mem 0x70ec0018-0x70ed0057] usable ==> usable
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: e820: update [mem 0x70ea6018-0x70ebf857] usable ==> usable
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: e820: update [mem 0x70ea6018-0x70ebf857] usable ==> usable
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: extended physical RAM map:
okt. 29 11:04:51 sindre-Aspire-E5-575G kernel: reserve setup_data: [mem 0x0000000000000000-0x0000000000057fff] usable

ls -al /

total 2097264
drwxr-xr-x  24 root root       4096 okt.  29 16:09 .
drwxr-xr-x  24 root root       4096 okt.  29 16:09 ..
drwxr-xr-x   2 root root       4096 okt.  29 17:01 bin
drwxr-xr-x   4 root root       4096 okt.  29 16:35 boot
drwxrwxr-x   2 root root       4096 okt.  29 16:08 cdrom
drwxr-xr-x  20 root root       4420 okt.  29 16:55 dev
drwxr-xr-x 127 root root      12288 okt.  29 17:01 etc
drwxr-xr-x   4 root root       4096 okt.  29 16:08 home
lrwxrwxrwx   1 root root         33 okt.  29 16:09 initrd.img -> boot/initrd.img-4.13.0-16-generic
drwxr-xr-x  23 root root       4096 okt.  29 16:10 lib
drwxr-xr-x   2 root root       4096 okt.  18 20:32 lib64
drwx------   2 root root      16384 okt.  29 16:06 lost+found
drwxr-xr-x   2 root root       4096 okt.  18 20:32 media
drwxr-xr-x   2 root root       4096 okt.  18 20:32 mnt
drwxr-xr-x   2 root root       4096 okt.  18 20:32 opt
dr-xr-xr-x 240 root root          0 okt.  29 16:55 proc
drwx------   4 root root       4096 okt.  29 16:59 root
drwxr-xr-x  28 root root        800 okt.  29 16:59 run
drwxr-xr-x   2 root root      12288 okt.  29 17:01 sbin
drwxr-xr-x   5 root root       4096 okt.  29 16:59 snap
drwxr-xr-x   2 root root       4096 okt.  18 20:32 srv
-rw-------   1 root root 2147483648 okt.  29 16:08 swapfile
dr-xr-xr-x  13 root root          0 okt.  29 16:55 sys
drwxrwxrwt  13 root root       4096 okt.  29 18:17 tmp
drwxr-xr-x  10 root root       4096 okt.  18 20:32 usr
drwxr-xr-x  14 root root       4096 okt.  18 20:42 var
lrwxrwxrwx   1 root root         30 okt.  29 16:09 vmlinuz -> boot/vmlinuz-4.13.0-16-generic

Edit gparted: Gparted1 Gparted2

Solo
  • 883
  • You're having a problem with your swap. Are you using a swapfile or a swap partition? Edit your question to include the output of sudo blkid and cat /etc/fstab and cat /etc/crypttab and free -h and sudo swapon -s and a screenshot of gparted, and I'll take a look. – heynnema Oct 28 '17 at 22:31
  • check the logs; enable persistent logging; sudo mkdir /var/log/journal, journalctl --list-boots, journalctl -b -1, looks like your cryptswap has not been setup correctly – Artyom Oct 28 '17 at 22:32
  • I updated my question with the information. Thanks for having a look. – Solo Oct 29 '17 at 10:24
  • I tried another fresh install of Ubuntu, without encrypting my home folder. It sadly still uses a lot of time on shutdown. – Solo Oct 29 '17 at 12:53
  • When replying to another user's comments, be sure to start your comment with @{enter username here} of the other user, to make sure that the other user will be flagged for your comment, or they'll probably miss it. – heynnema Oct 29 '17 at 13:21

4 Answers4

4

For some reason your encrypted /swapfile is not being setup correctly, and as such you're not using swap at all.

The main problem seems to be in your /etc/crypttab file.

Edit this file with ...

sudo -H gedit /etc/crypttab

change this:

cryptswap1 /target/swapfile /dev/urandom swap,offset=1024,cipher=aes-xts-plain64

to this:

cryptswap1 /swapfile /dev/urandom swap,offset=1024,cipher=aes-xts-plain64

Then...

sudo swapon -a # enable swap
free -h # review memory and swap usage
swapon -s # review swap summary

Note: gparted won't start for you because you're probably running 17.10 gnome on wayland. Best to log out, and at the login screen, click the cog wheel and select gnome on xorg and now gparted (and other apps) will run properly.

heynnema
  • 70,711
  • sudo swapon -a # enable swap

    swapon: /swapfile: read swap header failed

    swapon: cannot open /dev/mapper/cryptswap1: No such file or directory

    – Solo Oct 29 '17 at 14:26
  • Is there a reason why I should have swap at all? I'm using SSD disk, and I have 8 GB DDR4 RAM. – Solo Oct 29 '17 at 15:09
  • @Solo everybody needs a swap, even with 8G RAM. If you installed a fresh 17.10, then a /swapfile should have been created for you. Do a ls -al / and see if you have one. If not, search here on AskUbuntu (or Google) for "creating /swapfile" and follow the instructions to create the missing file. – heynnema Oct 29 '17 at 16:54
  • I updated my question with gparted screenshots and ls-al / command. Do you need a swapdisk when you have SSD? Is it not strange that Ubuntu did not create one for me during installation? – Solo Oct 29 '17 at 17:45
  • Actually, if you look at the ls -al / you'll see that there IS a swapfile there. Somehow though it's not using it. Maybe the actual file is damaged. Did you reboot after editing /etc/crypttab and then recheck the free -h and swapon -s commands again? Swapfile has nothing to do with whether you have a SSD or a HDD. It has to do with what the system does when it begins to run out of RAM resources. – heynnema Oct 29 '17 at 21:17
  • "sudo swapon -a # enable swap" gives swapon: /swapfile: read swap header failed – Solo Oct 30 '17 at 17:59
  • @Solo I've run out of ideas. Sorry. – heynnema Oct 30 '17 at 18:08
4

My educated guess would be that it is related to WiFi. Try to turn off WiFi before shutting down and see how that works out for you.

René Neim
  • 166
  • 1
  • 5
  • Your education had to be very good because after disabling WiFi it took only few seconds to power off Ubuntu. Hurray. – Solo Oct 30 '17 at 21:03
  • @Solo : Does your educated guessing skill tell you what the problem with WiFi actually is? Because yes, shutdown is much shorter with the WiFi off (I am experiencing identical problems) but turning off the WiFi still takes forever, so the problem simply moved. – Patrick Da Silva Nov 13 '17 at 01:40
  • @PatrickDaSilva Have no idea. I just learned to live with the problem. – Solo Nov 13 '17 at 08:57
  • I always switch off wifi, bluetooth etc. Yet still I have the same issue – Sachith Muhandiram Jul 04 '21 at 04:15
2

I had same issue, on my Dell Latitude E6540. I solved it by chance, after install software to read SD card with ex-fat format.
I ran this:

sudo apt install exfat-fuse exfat-utils

And a very long time to shut down issue was disappared.
I don't konw why, but it worked.

Thomas
  • 6,223
Claudio
  • 21
0

disable cryptswap. it is overkill in most cases and you should aim to not use swap to begin with.

after you do, report back so we can hunt other errors, since most now are about it.

other culprits are commonly network connections waiting to close/timeout.

gcb
  • 119
  • Will that make my home folder unencrypted? It need to be encrypted because I have work files in it. It is on a laptop that I often bring home from work. – Solo Oct 28 '17 at 21:20
  • 1
    I tried another fresh install of Ubuntu, without encrypting my home folder. It sadly still uses a lot of time on shutdown. – Solo Oct 29 '17 at 12:52