A user on KDE bugzilla has reported problems with partitioning and formatting an hard drive. I believe this is due to KDE automount of removable media feature that, if enabled, mounts the new partition before PM has finished his tasks. See https://bugzilla.redhat.com/show_bug.cgi?id=1371755 Is there something that PM can do to avoid this error? Maybe temporarily disable KDE automount feature when it runs? Reproducible: Didn't try
This still applies to PM 3.0.1
(In reply to Mattia from comment #1) > This still applies to PM 3.0.1 Yeah, there were no changes so far :(. I tried asking other Plasma people but nobody knew how to disable automount...
Steps to disable automount in KDE Plasma 5. 1. Run "System Settings" from Application Menu or launch konsole / terminal and run "systemsettings5" [Quotes excluded]. 2. Scroll down and click "Removable Storage" under section "Hardware". 3. Click "Removable Devices" in the left pane. 4. Right pane will show section with Title "Configure automatic handling of removable storage media". 5. Uncheck the option "Enable automatic mounting of removable media". 6. Click Apply [Bottom Right button]. 7. Reboot and re-login.
(In reply to Rahul Prabhakar from comment #3) > Steps to disable automount in KDE Plasma 5. > > 1. Run "System Settings" from Application Menu or > launch konsole / terminal and run "systemsettings5" [Quotes excluded]. > 2. Scroll down and click "Removable Storage" under section "Hardware". > 3. Click "Removable Devices" in the left pane. > 4. Right pane will show section with Title > "Configure automatic handling of removable storage media". > 5. Uncheck the option "Enable automatic mounting of removable media". > 6. Click Apply [Bottom Right button]. > 7. Reboot and re-login. These are manually executed steps to completely disable automount. What we need is a way to non manually (e.g. call some program or dbus interface) suspend automount while KPM is running.
Small observation i wud like to share. Under section "Configure automatic handling of removable storage media". if a user wud first uncheck "Automount on attach" & "Automount on login" for desired partition before Disabling Automount feature itself only then desired result is achieved. U might want to read through KDE systemsettings code to see what api call(s) is/are triggered when above mentioned change is applied. Command: e2fsck -f -y -v /dev/sda7 is working correctly for me but in the associated bugreport from redhat user reported that e2fsck -f -y -v /dev/sda1 fails. Only difference cud be i am creating logical partition and redhat user is creating primary partition. KDE partition Manager log Delete partition ‘/dev/sda7’ (229.07 GiB, ext4) Job: Delete file system on ‘/dev/sda7’ Delete file system on ‘/dev/sda7’: Success Job: Delete the partition ‘/dev/sda7’ Delete the partition ‘/dev/sda7’: Success Delete partition ‘/dev/sda7’ (229.07 GiB, ext4): Success Create a new partition (229.07 GiB, ext4) on ‘/dev/sda’ Job: Create new partition on device ‘/dev/sda’ Create new partition ‘/dev/sda7’: Success Job: Create file system ‘ext4’ on partition ‘/dev/sda7’ Command: mkfs.ext4 -qF /dev/sda7 Create file system ‘ext4’ on partition ‘/dev/sda7’: Success Job: Set the file system label on partition ‘/dev/sda7’ to "UserData" Command: e2label /dev/sda7 UserData Set the file system label on partition ‘/dev/sda7’ to "UserData": Success Job: Check file system on partition ‘/dev/sda7’ Command: e2fsck -f -y -v /dev/sda7 Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information 11 inodes used (0.00%, out of 15015936) 0 non-contiguous files (0.0%) 0 non-contiguous directories (0.0%) # of inodes with ind/dind/tind blocks: 0/0/0 Extent depth histogram: 2/1 1220123 blocks used (2.03%, out of 60049152) 0 bad blocks 1 large file 0 regular files 2 directories 0 character device files 0 block device files 0 fifos 0 links 0 symbolic links (0 fast symbolic links) 0 sockets ------------ 2 files Check file system on partition ‘/dev/sda7’: Success Create a new partition (229.07 GiB, ext4) on ‘/dev/sda’: Success
Hmm, yeah, maybe I can just follow what systemsettings does even if there is no DBus API. Just need to remember the previous state and then restore it after operation is completed.
*** Bug 364890 has been marked as a duplicate of this bug. ***
Ok, looks like I found a way to temporary unload the whole kded module doing automounting. This will be better than following what automounter kcm does. qdbus org.kde.kded5 /kded org.kde.kded5.unloadModule device_automounter and qdbus org.kde.kded5 /kded org.kde.kded5.loadModule device_automounter
(In reply to Andrius Štikonas from comment #8) > Ok, looks like I found a way to temporary unload the whole kded module doing > automounting. This will be better than following what automounter kcm does. > > qdbus org.kde.kded5 /kded org.kde.kded5.unloadModule device_automounter > and > qdbus org.kde.kded5 /kded org.kde.kded5.loadModule device_automounter Hmm, these commands work manually but do not work from inside partition manager. The reason is that partition manager is running as root while automounter is running as normal user. Well it would of course work if we port to KAuth/Polkit but that is a very big task... I probably need to find some interim solution.
(In reply to Andrius Štikonas from comment #9) > (In reply to Andrius Štikonas from comment #8) > > Ok, looks like I found a way to temporary unload the whole kded module doing > > automounting. This will be better than following what automounter kcm does. > > > > qdbus org.kde.kded5 /kded org.kde.kded5.unloadModule device_automounter > > and > > qdbus org.kde.kded5 /kded org.kde.kded5.loadModule device_automounter > > Hmm, these commands work manually but do not work from inside partition > manager. The reason is that partition manager is running as root while > automounter is running as normal user. Well it would of course work if we > port to KAuth/Polkit but that is a very big task... I probably need to find > some interim solution. Ok, I think I can solve this by running logname to get the username of the original user and then obtains UID of that user and run setuid before making QtDBus connection.
Git commit 63b5c8c34cf257d29fb8e67b41da7b606b32aec0 by Andrius Štikonas. Committed on 07/06/2017 at 17:21. Pushed by stikonas into branch 'master'. Suspend Plasma removable device automounting. Before doing operations, we connect to DBus session of the original user and stop kded module for device automounting. M +1 -0 CMakeLists.txt M +1 -0 src/CMakeLists.txt M +24 -3 src/core/operationrunner.cpp https://commits.kde.org/kpmcore/63b5c8c34cf257d29fb8e67b41da7b606b32aec0
I'll reopen this for now as this is only fixed on X11 and does not work on Wayland. Similar problem is encountered in bug #365882.
Git commit 4e78cd9ff1d990fbe1db3f54469aa567d9f908fe by Andrius Štikonas. Committed on 12/06/2017 at 22:06. Pushed by stikonas into branch 'master'. Pass DBUS_SESSION_BUS_ADDRESS environmental variable. This is necessary for disabling Plasma automounter on Wayland. M +2 -1 src/util/guihelpers.cpp https://commits.kde.org/partitionmanager/4e78cd9ff1d990fbe1db3f54469aa567d9f908fe