I use Overlayfs to create temporary build environments. When I create Overlayfs, Dolphin automatically recognizes and creates entries in Devices. This is great and I really like this feature.
However, Dolphin uses the full path as the entry name for the Overlayfs and cannot specify a label name, which makes it more difficult for me to view and select.
If it’s an actual existing device, I can use the KDE partition manager to change the label name, for Overlayfs, how can I automatically assign or change its label name?
You must be using a mount
command.
You can pass to mount -o x-gvfs-name=my-name
to set a name for the fs.
Thanks, I tried to add this option but it didn’t work.
Commands executed:
overlay_name=ol_build-xx
sudo mount -t overlay ${overlay_name} -o lowerdir=../../source/build-xx,upperdir=upper,workdir=work,x-gvfs-name=${overlay_name} build
The parameters after mounting are shown below:
ol_build-xx on /home/xx/xx/builds/build-xx/build type overlay (rw,relatime,lowerdir=../../source/build-xx,upperdir=upper,workdir=work,uuid=null,nouserxattr,x-gvfs-name=ol_build-xx)
Dolphin still uses /home/xx/xx/builds/build-xx/build
Did you restart dolphin ?
I added a new mount and the new entry was immediately and automatically added to Dolphin’s list, but the label name was still the path.
Restarting Dolphin didn’t change it either.
What does solid-hardware6 list
for those filesystems ?
They should start either with /org/freedesktop/UDisks2/
or /org/freedesktop/fstab
What does solid-hardware6 details <UDI>
returns ?
$ mount | grep build-xx
ol_build-xx on /home/xx/xx/builds/build-xx/build type overlay (rw,relatime,lowerdir=../../source/build-xx,upperdir=upper,workdir=work,uuid=null,nouserxattr,x-gvfs-name=ol_build-xx)
$ solid-hardware6 list | grep build-xx
udi = '/org/kde/fstab/overlay/home/xx/xx/builds/build-xx/build'
$ solid-hardware6 details '/org/kde/fstab/overlay/home/xx/xx/builds/build-xx/build'
udi = '/org/kde/fstab/overlay/home/xx/xx/builds/build-xx/build'
parent = '/org/kde/fstab' (string)
vendor = 'overlay' (string)
product = '~/xx/builds/build-xx/build' (string)
description = '~/xx/builds/build-xx/build (overlay)' (string)
icon = 'folder' (string)
qt.core.qobject.connect: QObject::connect: No such signal Solid::Backends::Fstab::FstabStorageAccess::repairRequested(QString) in ./src/solid/devices/frontend/storageaccess.cpp:23
qt.core.qobject.connect: QObject::connect: No such signal Solid::Backends::Fstab::FstabStorageAccess::repairDone(Solid::ErrorType, QVariant, QString) in ./src/solid/devices/frontend/storageaccess.cpp:24
StorageAccess.accessible = true (bool)
StorageAccess.filePath = '/home/xx/xx/builds/build-xx/build' (string)
StorageAccess.ignored = false (bool)
StorageAccess.encrypted = false (bool)
And what is your distro/version ?
I am not familiar with overlayfs.
Could create a very simple script that would setup one filesystem completely, so I can reproduce it myself easily.
Something like:
mkdir test
cd test
mkdir upper
mkdir lower
mount -o ...,x-gvfs-name=my-test
Operating System: KDE neon 6.0
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.8.0-40-generic (64-bit)
script:
mkdir -p test
cd test
mkdir -p lower upper work build
sudo mount -t overlay ol_name -o lowerdir=lower,upperdir=upper,workdir=work,x-gvfs-name=ol_label build
sudo umount build
I have a MR fstabhandling: use libmount when available (!173) · Merge requests · Frameworks / Solid · GitLab
I tested it with success and it works.
Thank you so much, I am amazed at how quickly it is done.
Waiting for it to merge into the trunk.
Well that’s mostly thanks to you to answer the question fast and precisely.
And I happen to be one of the right person for this kind of issue.
This days our trunk is master.
Btw, I am curious about your dev workflow with overlay fs, do you have a blog post/doc somewhere about it to recommend ?
Creating a build environment with overlayfs is a personal requirement, and I haven’t seen an doc on it, and I certainly haven’t written about it myself.
I use overlayfs at my work to create my local build environment. I had to use some unsuitable tools provided by my work to compile (e.g. binary toolchain managed by Git, and the same code for different development tasks at the same time). So I use overlayfs to combine the source code and compile tools/scripts directly together for fast compilation. And immediately rebuild a clean environment if the unsuitable tools screw everything up.
In general, it’s like a poor man’s version of Docker.
After Neon updated kf6-solid to 6.8.0, this feature is available and works very well, thanks!
Thank you for confirming, I am happy to have helped.