This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How do I change a removable device's name?

Tags: None
(comma "," separated)
User avatar
Moult
Global Moderator
Posts
663
Karma
2
OS
When KDE detects a device I have plugged in, it might call it "1GB Removable Media" or such in the Dolphin sidebar. How do I rename the removable device?


Moult, proud to be a member of KDE forums since 2008-Oct.
thinkMoult - source for tech, art, and animation: hilarity and interest ensured!
WIPUP.org - a unique system to share, critique and track your works-in-progress projects.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
At this time KDE does not feature a method to rename devices. However, it is possible using a root terminal, but the command to use is file system dependent.

The ext* family of filesystems can be named with the "e2label" command.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
bdjnk
Registered Member
Posts
1
Karma
0
OS
I realize it has been a few months, but this is useful for many people. The information was taken from this Ubuntu forum post and is quoted below to create a backup and make it easier to find.
step 1:
create a directory in your /usr/share/hal/fdi/information directory to hold the new .fdi files we're going to be creating. the posts i've read seem to have the number "90" before the name and although i didn't see anything mandating this, it's probably a good idea.
Code:

sudo mkdir /usr/share/hal/fdi/information/90media

step 2:
"discover" the uuid for the volumes which aren't being displayed properly. you could use either the kde-hal-device-manager program or the much simpler cli command
Code:

ls -l /dev/disk/by-uuid

step 3:
now, we have to place files in our newly created directory for each of the "misbehaving" drives. the files are simple xml and the syntax is pretty easy. once again, the numbering scheme seems to come into play, so i named my internal backup drive file "90-backup.fdi."
Code:

sudo nano /usr/share/hal/fdi/information/90media/90-backup.fdi

and in that new file type:
Code:

<?xml version="1.0" encoding="UTF-8"?><!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<device>
<match key="info.category" string="volume">
<match key="volume.uuid" string="your_volume's_uuid">
<merge key="volume.label" type="string">the name you want for the volume</merge>
</match>
</match>
</device>
</deviceinfo>

step 4:
do that for all of your volumes, following the simple xml syntax and restart. voila.

One correction: You don't need to restart anything. Just plug in the device.

The main advantage of this method is that it changes the device name based on uuid and is NOT volume label dependent, despite what the xml seems to imply. I've got a device which works without having a discernible volume and following the steps above renamed it for me. See my device renaming saga for details.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]