Ошибки udisks2.service
Внезапно заметил, что система как-то долго загружается. Посмотрел systemd-analyze blame и понял, что это просто принтер был включен, а с принтером оно так всегда. Однако, и на кое-что интересное внимание обратил.
systemd-analyze blame 599ms dev-sda2.device 391ms udisks2.service
Так-то оно, конечно, пофиг, за шесть секунд всё включается, или за семь. Но всё же посмотрел.
$ journalctl -b -u udisks2.service -- Logs begin at Sat 2020-01-11 11:40:42 +04, end at Sat 2020-01-11 11:46:33 +04. -- янв 11 11:40:43 RocksteR systemd[1]: Starting Disk Manager. янв 11 11:40:43 RocksteR udisksd[757]: udisks daemon version 2.7.6 starting янв 11 11:40:43 RocksteR udisksd[757]: failed to load module mdraid: libbd_mdraid.so.2: cannot open shared object file: No such file or directory янв 11 11:40:43 RocksteR udisksd[757]: Failed to load the 'mdraid' libblockdev plugin янв 11 11:40:43 RocksteR udisksd[757]: Acquired the name org.freedesktop.UDisks2 on the system message bus янв 11 11:40:43 RocksteR udisksd[757]: mountpoint /media/dementy/DC02-A31B is invalid, cannot recover the canonical path янв 11 11:40:43 RocksteR udisksd[757]: Cleaning up mount point /media/dementy/DC02-A31B (device 8:20 is not mounted) янв 11 11:40:43 RocksteR udisksd[757]: mountpoint /media/dementy/d2763a02-5970-4615-b30f-8317e8344c9c is invalid, cannot recover the canonical pa янв 11 11:40:43 RocksteR udisksd[757]: Cleaning up mount point /media/dementy/d2763a02-5970-4615-b30f-8317e8344c9c (device 8:17 is not mounted) янв 11 11:40:43 RocksteR systemd[1]: Started Disk Manager. янв 11 11:40:53 RocksteR udisksd[757]: Mounted /dev/sdb1 at /media/dementy/d2763a02-5970-4615-b30f-8317e8344c9c on behalf of uid 1000 янв 11 11:40:54 RocksteR udisksd[757]: Mounted /dev/sdb4 at /media/dementy/DC02-A31B on behalf of uid 1000
Это должно так быть? Или лучше это как-то исправить?
# blkid /dev/sda1: UUID="1448-0AD9" TYPE="vfat" PARTUUID="29179ecb-f173-4990-9a96-d3413a1e7f12" /dev/sda2: UUID="3537d640-59bb-4a83-b324-6e0f8167a5f6" TYPE="ext4" PARTUUID="09227984-0a6e-449d-ac5f-b639031ee567" /dev/sda3: UUID="7675343d-587f-4bbb-80a3-4f622147b9a2" TYPE="ext4" PARTUUID="7b3918dd-9ef9-4fb9-a61f-8c56dbc85029" /dev/sda4: UUID="3576bcb0-caea-4747-b4f6-76e91ed6ceb2" TYPE="swap" PARTUUID="58d4bd7d-d900-4132-85dc-c389b329a6d8" /dev/sdb1: UUID="d2763a02-5970-4615-b30f-8317e8344c9c" TYPE="ext4" PARTUUID="96262bef-037f-b143-b522-a51771e598d4" /dev/sdb4: UUID="DC02-A31B" TYPE="vfat" PARTUUID="5af8bbcd-a22f-4ae6-8f28-fbba83d58c83"
/dev/sda2 / ext4 errors=remount-ro 0 1 /dev/sda1 /boot/efi vfat umask=0077 0 1 /dev/sda3 /home ext4 defaults 0 2 /dev/sda4 none swap sw 0 0
Авто монтирование в ubuntu с помощью Udisks2 а в частности udisksctl
Возникла следующая проблема. Присутствие задача которую я решил с помощью udisks2 на с++, я могу отловить сигнал по дебасу если во время работы в машину вставляют флешку. Но отлаживался я на персональной тачке а тула должна крутиться на nano pi. Проблема заключается в том что с помощью udisks2 я могу примонтировать флеху но моя программа не видит сигнала по дебасу в следствии чего не читаются файлы. Веду я к тому что udisks2 на пишке работает но как запустить его что бы он делал это автоматический( при вставлении флехи сам монтировал флеху ). Написал небольшие правила в /etc/udev/reles.d/99-udisks.rules где я пытаюсь запустить следующий скрипт:
#!/bin/bash touch /home/pi/aaa /usr/bin/udisksctl mount -b /dev/sda1 --no-user-interaction
Сам файл вот :
ENV == filesystem|other|crypto , ENV = 1 ACTION=="add", KERNEL=="sd[a-z][0-9]", RUN+="/home/pi/mo.sh %k" OPTIONS="last_rule" ACTION=="remove", RUN+="/home/pi/mu.sh" OPTIONS="last_rule"
aaa создается когда втыкаю флеху а вот диск не монтируется. Если запустить скрипт руками то так же смонитировано не чего не будет а если от прав супер пользователя то все получиться и диск примонтируется. Я Уверен что кто то все же сможет мне помочь с данным вопросом.
udisks
udisks provides a daemon udisksd, that implements D-Bus interfaces used to query and manipulate storage devices, and a command-line tool udisksctl, used to query and use the daemon.
Installation
udisksd(8) is started on-demand by D-Bus and should not be enabled explicitly. It can be controlled through the command-line with udisksctl(1) .
Note: The development of udisks has ceased in favor of udisks2 [1].
Configuration
Permissions
Actions a user can perform using udisks are restricted with polkit. If the user session is not activated or present (for example, when controlling udisks from a systemd/User service), adjust polkit rules accordingly.
See https://github.com/coldfix/udiskie/wiki/Permissions for common udisks permissions for the storage group, and [2] for a more restrictive example. If you are using Dolphin, you may see [3].
Default mount options
It is possible to define default mount options in /etc/udisks2/mount_options.conf . Create the file if it does not already exist. The built-in defaults and some examples can be seen in /etc/udisks2/mount_options.conf.example .[4]
The options can target specific filesystem types. For example, mount btrfs filesystems with zstd compression enabled:
/etc/udisks2/mount_options.conf
[defaults] btrfs_defaults=compress=zstd
Note: Lines override the corresponding built-in defaults. Make sure not to accidentally remove mount options this way.
Usage
To manually mount a removable drive, for example /dev/sdc :
$ udisksctl mount -b /dev/sdc1
$ udisksctl unmount -b /dev/sdc1
See udisksctl help for more.
Tips and tricks
Mount helpers
The automatic mounting of devices is easily achieved with udisks wrappers. See also List of applications/Utilities#Mount tools.
Note: Desktop environments, such as GNOME and KDE may also provide a udisks wrapper.
- bashmount — A bash script to mount and manage removable media as a regular.
- dolphin-plugins — uses udisksctl to either mount or unmount the iso in Dolphin.
- udiskie — Automounter with optional notifications, tray icon and support for password protected LUKS devices. See the udiskie wiki for details
- udiskie-dmenu — dmenu interface for udiskie.
- udisksvm — GUI wrapper written in Python3 and using the Qt5 framework. It uses mouse clicks to mount, unmount removable devices or eject a CD/DVD. See the README file for details.
- udevil — Includes devmon.
Note: devmon only uses udisks2 for mounting (in this order) if udevil or pmount miss the SUID permission. To remove this permission, run chmod -s /usr/bin/udevil as root.
udevadm monitor
You may use udevadm monitor to monitor block events and mount drives when a new block device is created. Stale mount points are automatically removed by udisksd, such that no special action is required on deletion.
#!/bin/sh pathtoname() < udevadm info -p /sys/"$1" | awk -v FS== '/DEVNAME/ ' > stdbuf -oL -- udevadm monitor --udev -s block | while read -r -- _ _ event devpath _; do if [ "$event" = add ]; then devname=$(pathtoname "$devpath") udisksctl mount --block-device "$devname" --no-user-interaction fi done
Mount to /media
By default, udisks2 mounts removable drives under the ACL controlled directory /run/media/$USER/ . If you wish to mount to /media instead, use this rule:
/etc/udev/rules.d/99-udisks2.rules
# UDISKS_FILESYSTEM_SHARED # ==1: mount filesystem to a shared directory (/media/VolumeName) # ==0: mount filesystem to a private directory (/run/media/$USER/VolumeName) # See udisks(8) ENV=="filesystem|other|crypto", ENV="1"
Since /media , unlike /run , is not mounted by default as a tmpfs, you may also wish to create a tmpfiles.d snippet to clean stale mountpoints at every boot:
/etc/tmpfiles.d/media.conf
D /media 0755 root root 0 -
Mount loop devices
To easily mount ISO images, use the following command:
$ udisksctl loop-setup -r -f image.iso
This will create a read only loop device and show the ISO image ready to mount. Remove the -r flag to be able to write to it. The name of the created loop device is output by the above loop-setup command.
You can unmount, and remount, the image as long as the specific loop device is in place. When done working with the specific loop device, use
$ udisksctl loop-delete -b /dev/loop0
to delete it. Substitute /dev/loop0 with the name of the specific loop device.
Loop devices are cheap. Therefore, many loop devices can be created in practice without worrying about a denial of service issue. See [5].
Hide selected partitions
If you wish to prevent certain partitions or drives appearing on the desktop, you can create a udev rule, for example /etc/udev/rules.d/10-local.rules :
KERNEL=="sda1", ENV="1" KERNEL=="sda2", ENV="1"
shows all partitions with the exception of sda1 and sda2 on your desktop.
Because block device names can change between reboots, it is also possible to use UUIDs to hide partitions or whole devices. Matching by UUID is only possible after /usr/lib/udev/rules.d/60-persistent-storage.rules has been processed, so make sure to choose a file name that will be ordered after it. For example:
/etc/udev/rules.d/61-hide-partitions.rules
SUBSYSTEM=="block", ENV=="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX", ENV="1"
The above line is also useful to hide multi device btrfs filesystems, as all the devices from a single btrtfs filesystem will share the same UUID across the devices but will have different SUB_UUID for each individual device.
Apply ATA settings
At start-up and when a drive is connected, udisksd will apply configuration stored in the file /etc/udisks2/IDENTIFIER.conf where IDENTIFIER is the value of the Drive:Id property for the drive. Currently ATA settings are supported. See udisks(8) for available options. These settings have essentially the same effect as those of hdparm, but they are persistent as long as the udisks daemon is autostarted.
For example, to set standby timeout to 240 (20 minutes) for a drive, add the following:
/etc/udisks2/DriveId.conf
[ATA] StandbyTimeout=240
To obtain the DriveId for your drive, use udevadm info —query=all —name=sdx | grep ID_SERIAL | sed «s/_/-/g»
Alternatively, use a GUI utility to manage the configuration file, such as gnome-disk-utility .
Troubleshooting
Hidden devices
Udisks2 hides certain devices from the user by default. If this is undesired or otherwise problematic, copy /usr/lib/udev/rules.d/80-udisks2.rules to /etc/udev/rules.d/80-udisks2.rules and remove the following section in the copy:
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------ # ------------------------------------------------------------------------ # Devices which should not be display in the user interface [. ]
Broken standby timer
The udisks daemon polls S.M.A.R.T. data from drives regularly. Hard drives with a longer standby timeout than the polling interval may fail to enter standby. Drives that are already spun down are usually not affected. There seems no way to disable polling or change the interval as for udisks2 by now. See [6], [7].
However, Standby timeout applied by udisks2 seems to be unaffected. To set standby timeout via udisks, see #Apply ATA settings.
Other possible workarounds could be setting the timeout below the polling interval (10 minutes) or forcing a manual spindown using hdparm -y /dev/sdx .
NTFS mount failing
If mounting a ntfs partition fails with the error:
Error mounting /dev/sdXY at [. ]: wrong fs type, bad option, bad superblock on /dev/sdXY, missing codepage or helper program, or other error
and in the kernel log with journalctl / dmesg ran as root:
ntfs: (device sdXY): parse_options(): Unrecognized mount option windows_names.
Then the problem is that udisks is trying to use the kernel ntfs driver, which does not understand this (default) mount option. For this to work the optional dependency NTFS-3G must be installed.
NTFS file creation failing (filename-dependent)
udisks 2.8.2 introduced a breaking change by adding windows_names to NTFS mount options, preventing creation of Win32-incompatible filenames such as nul , screenshot 23-08-21 19:22.jpg . Among other things, this causes Steam Proton to stop initializing. To revert this behavior, use:
/etc/udisks2/mount_options.conf
[defaults] ntfs:ntfs_defaults=uid=$UID,gid=$GID
Bad filenames generally do not cause issues in Windows unless accessed. chkdsk will treat these names as errors and move the renamed files to found.nnn folders under filesystem root.
See also
- Gentoo:udisks
- Introduction to udisks
Retrieved from «https://wiki.archlinux.org/index.php?title=Udisks&oldid=793286»
Udisks2 service что это
25 янв 2018, 13:35
Ковыряя в очередной раз систему на предмет совершенства, наткнулся на ряд стартовых ошибок в udisksd специфичных для софтварного RAID0
янв 25 13:05:39 desktop systemd[1]: Starting Disk Manager. янв 25 13:05:39 desktop udisksd[1529]: udisks daemon version 2.1.7 starting янв 25 13:05:39 desktop udisksd[1529]: Error creating watch for file /sys/devices/virtual/block/md0/md/sync_action: No such file or directory (g-file-error-quark, 4) янв 25 13:05:39 desktop udisksd[1529]: Error creating watch for file /sys/devices/virtual/block/md0/md/degraded: No such file or directory (g-file-error-quark, 4) янв 25 13:05:39 desktop udisksd[1529]: Error creating watch for file /sys/devices/virtual/block/md1/md/sync_action: No such file or directory (g-file-error-quark, 4) янв 25 13:05:39 desktop udisksd[1529]: Error creating watch for file /sys/devices/virtual/block/md1/md/degraded: No such file or directory (g-file-error-quark, 4) янв 25 13:05:39 desktop systemd[1]: Started Disk Manager.
На самом деле здесь не столько ошибка, сколько просто не оч логичное его поведение. Т.к. параметры sync_action и degraded относятся к RAID-массивам с избыточностью, которой в нулевом разумеется нет.
Попался на глаза багрепорт редхата — https://bugzilla.redhat.com/show_bug.cgi?id=1400056 где описана аналогичная ситуация (у rhel7.2 udisks — 2.1.2, у нас в 18-м минте — 2.1.7 ). Там же отмечеается, что эти лишние проверки учтены в версии 2.7.3 и больше не проявляются.
Не понятно только в какую версию внесен фикс, глядя на убунторепы биобобра , на котором будет развернута Tara — там значится версия 2.6.5. Поэтому уйдет ли оказия к следующему LTS пока не до конца понятно.
Жить оно конечно не мешает, таймаутов тоже за собой не тащит, но перфекционизм чутка обижен
Chocobo
Автор темы
Chocobo Сообщения: 10015 Зарегистрирован: 27 авг 2016, 22:57 Решено: 215 Откуда: НН Благодарил (а): 815 раз Поблагодарили: 3011 раз Контактная информация:
Ошибки udisks2 в soft RAID0
25 янв 2018, 14:06
В итоге сделал из системы франкенштейна, притащив udisks2 из 18.04 (а с ним libc6 , libglib2-0 , и еще кучу околосистемнщины ):
sudo dpkg -i libglib2.0-0_2.54.1-1ubuntu1_amd64.deb libglib2.0-bin_2.54.1-1ubuntu1_amd64.deb libglib2.0-0_2.54.1-1ubuntu1_i386.deb libmount1_2.30.2-0.1ubuntu1_amd64.deb libc6_2.26-0ubuntu2_amd64.deb libselinux1_2.7-2_amd64.deb libselinux1_2.7-2_i386.deb locales_2.26-0ubuntu2_all.deb libc-bin_2.26-0ubuntu2_amd64.deb libc6_2.26-0ubuntu2_i386.deb udisks2_2.6.5-2ubuntu2_amd64.deb libudisks2-0_2.6.5-2ubuntu2_amd64.deb
узрел что нифига не поменялось на 2.6.5:
chocobo@desktop ~ $ systemctl status udisks2.service ● udisks2.service - Disk Manager Loaded: loaded (/lib/systemd/system/udisks2.service; enabled; vendor preset: enabled) Active: active (running) since Чт 2018-01-25 13:59:49 MSK; 4min 43s ago Docs: man:udisks(8) Main PID: 887 (udisksd) CGroup: /system.slice/udisks2.service └─887 /usr/lib/udisks2/udisksd янв 25 13:59:48 desktop systemd[1]: Starting Disk Manager. янв 25 13:59:48 desktop udisksd[887]: udisks daemon version 2.6.5 starting янв 25 13:59:48 desktop udisksd[887]: Error creating watch for file /sys/devices/virtual/block/md0/md/sync_action: No such file or directory (g-file-error-quark, 4) янв 25 13:59:48 desktop udisksd[887]: Error creating watch for file /sys/devices/virtual/block/md0/md/degraded: No such file or directory (g-file-error-quark, 4) янв 25 13:59:48 desktop udisksd[887]: Error creating watch for file /sys/devices/virtual/block/md1/md/sync_action: No such file or directory (g-file-error-quark, 4) янв 25 13:59:48 desktop udisksd[887]: Error creating watch for file /sys/devices/virtual/block/md1/md/degraded: No such file or directory (g-file-error-quark, 4) янв 25 13:59:49 desktop udisksd[887]: Acquired the name org.freedesktop.UDisks2 on the system message bus янв 25 13:59:49 desktop systemd[1]: Started Disk Manager.