Score:1

Disk manager is preventing shutdown

mf flag

I am new to Linux and was annoyed that my OS is always shutting down very slow though they start up in just few seconds.

Then I found that Disk Manager cannot be properly closed, always ending up with time out. I am running dual OS Ubuntu + Windows with Ubuntu version being 22.04.1 LTS. The system is installed on an NVMe ssd with two HDD and one SSD connected through SATA.

The following is the journalctl -rb -1 output. There is an approximately 90 second interval between udisks being terminated by timeout and the last shutdown event before that.

user.slice: Consumed 1min 36.500s CPU time.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: Removed slice User and Session Slice.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: Stopped target Slice Units.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: Stopped Start whoopsie on modification of the /var/crash directory.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: whoopsie.path: Deactivated successfully.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: Stopped CUPS Scheduler.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: cups.path: Deactivated successfully.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: Stopped ACPI Events Check.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: acpid.path: Deactivated successfully.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: Stopped target Path Units.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: Stopped target Basic System.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: udisks2.service: Consumed 1.476s CPU time.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: Stopped Disk Manager.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: udisks2.service: Unit process 3786 (mount.ntfs) remains running after unit stopped.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: udisks2.service: Unit process 3706 (mount.ntfs) remains running after unit stopped.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: udisks2.service: Unit process 3092 (mount.ntfs) remains running after unit stopped.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: udisks2.service: Failed with result 'timeout'.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: udisks2.service: Killing process 3786 (mount.ntfs) with signal SIGKILL.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: udisks2.service: Killing process 3706 (mount.ntfs) with signal SIGKILL.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: udisks2.service: Killing process 3092 (mount.ntfs) with signal SIGKILL.
Oct 27 17:27:17 Jacky-Home-Desktop systemd[1]: udisks2.service: State 'final-sigterm' timed out. Killing.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: Stopped ACPI event daemon.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: acpid.service: Deactivated successfully.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: Unmounted /run/user/1000.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: run-user-1000.mount: Deactivated successfully.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: Stopped Userspace Out-Of-Memory (OOM) Killer.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: systemd-oomd.service: Deactivated successfully.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: Stopped target Preparation for Network.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: Stopped Network Manager.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: NetworkManager.service: Deactivated successfully.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: Stopped WPA supplicant.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: wpa_supplicant.service: Deactivated successfully.
Oct 27 17:25:48 Jacky-Home-Desktop systemd[1]: Stopped target User and Group Name Lookups.

/etc/fstab content

# /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/nvme0n1p4 during installation
UUID=1a298bd9-06e3-4f4d-b559-cd4ca507fd88 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sdc1 during installation
UUID=000F-5C50  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/nvme0n1p5 during installation
UUID=6d0f9094-5a7f-4e90-bd16-19987c1799e5 /home           ext4    defaults        0       2
# swap was on /dev/nvme0n1p3 during installation
UUID=ce8eaf1e-95eb-4503-8895-cafabb823830 none            swap    sw              0       0
David avatar
cn flag
You have one important message in that. Userspace Out-Of-Memory (OOM) Killer. I have given you a link to an article on it so you can learn about it. https://lwn.net/Articles/590960/ How much memory does your machine have?
PonJar avatar
in flag
I don’t think it’s the OOM Killer. Looks more like your NTFS mount(s) are taking a long time to synchronise. Try syncing them before you shutdown. If that speeds up the shutdown check your mount options for NTFS in fstab. You could get data corruption if syncing is the issue so unmount the NTFS drives before shutdown to be safe.
Jacky L avatar
mf flag
@David My system is with 32gb RAM. I was doing multiple consecutive restarts yesterday so basically the system was just booted. It does not seem like it would be a memory problem.
Jacky L avatar
mf flag
@PonJar Thank you for your point. I am having suspicion on the NTFS mounts as well. But I am not sure what do you mean syncing NTFS. Could you elaborate a little on this.
PonJar avatar
in flag
I think all you need to do is issue the command `sudo sync` in a terminal. That should ensure that any data that has not been written to the disk is written to the disk. The question is if this is the cause of your slow shutdown why is it happening? Is there any possibility you have hibernated your Windows system before booting Linux? If your Windows has fast boot enabled it will have hibernated when you shut down. There is more info about the sync command here https://www.computerhope.com/unix/sync.htm
Jacky L avatar
mf flag
@PonJar I tried sudo sync and it did not work. My windows system fast boot has been disabled since I was trying to access some folders from both system.
PonJar avatar
in flag
I assume `sudo sync` didn’t error but also didn’t make a difference to the shutdown speed. Have you tried unmounting your NTFS drive(s) before shutdown. This is just to narrow down where the issue is
PonJar avatar
in flag
Just remembered I had some shutdown issues a while back. Do you have nvidia graphics? I had to unload some modules with a systemd unit. Happy to share the details, it was very simple and automatic
Jacky L avatar
mf flag
@Ponjar I had lots of partitions and I believe it is one of them causing the problem. When I unmounted all partitions the shutdown is very fast, and it is still good when I remounted one of my frequently used partition. So one or some of the partitions are the problem.
PonJar avatar
in flag
So it should be easy to work out which partition(s) are the problem. One possibility is that the drive is failing. Another is the mounting options. Are you happy to add the contents of your ` /etc/fstab ` file to your question for a review (if that’s the way you are mounting the partitions).
Jacky L avatar
mf flag
@PonJar I added fstab content if that is helpful.
Jacky L avatar
mf flag
@PonJar I tested and find out two partitions are causing the problem. I need to unmount both to keep the issue from happening; unmounting any one of them does not help. However, I am not sure why. There are some other paritions in the disk as well but only these two are problematic.
PonJar avatar
in flag
There are no entries in your fstab file for any NTFS partitions so they don’t appear to mounted automatically. How are you mounting them? It might be worth adding some entries to fstab for your NTFS partitions so they mount automatically. I suggest you research how to do this. If you mess up fstab it can make your system un-bootable but it is a skill worth learning and it not that difficult. The addition of lines like `UUID=12102C02102CEB83 /media/windows ntfs-3g auto,users,uid=1000,gid=100,dmask=027,fmask=137,utf8 0 0` should do it. It will need your UUIDs and mount points though.
PonJar avatar
in flag
There are plenty of options you can use in a fstab entry. I suggest you check those in the example above are suitable for you. You can check your fstab file is ok with `sudo mount -a` . No errors is what you want from this command. It should mount the partition that you have added. If things go wrong you can fix it by booting into a live environment and editing the fstab file on your root partition
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.