media:/ shows unnecessary media

Rajeev J Sebastian rajeev_jsv at dinamis.com
Sat May 28 15:51:17 CDT 2005


On Saturday 28 May 2005 11:34 am, Giuseppe Bilotta wrote:
> On Sat, 28 May 2005 05:13:54 +0000, Rajeev J Sebastian wrote:
> > I have a question:
> >
> > Is it only me ? or is anyone else having to mount via console ?
> >
> > pmount just isn't working. And there is no bug filed in bugzilla either.
> > This is wierd, no one is reporting the inability to mount hard disks
> > wuthin media:/.
What about the above question ? Are you able to mount via pmount/fstab-sync or 
not ? Does mounting via media:/ work (for partitions not in the fstab file) ?

> >
> > Anyway, after waiting for Kari to respond for 2 days, I have made a
> > simple script to do the renaming of media nodes with the following
> > features:
> >
> > 1) If the partition has a volume label, it sets that as the label in
> > media:/
>
> What happens if two medias have the same volume label?
Yeah that is a problem :) Obviosly, we shouldn't allow that, but I havent 
checked. But I also think

>
> > 2) else if the user has already changed the name to something more
> > appropriate in media:/, it sets that as the label in media :/
>
> Is this necessary? :)
Yep its necessary, otherwise, we might overwrite the label set by the user.

>
> > 3) else, it constructs a string "<OS> <device><partitionNumber>" where
> > <OS> is currently, "Linux", "Windows" and ".Linux Swap", the <device> is
> > A,B,C,D, etc. Volker's suggestion of using "." paid off and swap
> > partitions are hidden.
>
> FWIW, Windows uses the term "Local disk (<drive letter>:)" for
> unlabeled partitions. Something like "<OS> Local Disk
> <device><partition number>" might be nice.
As you said earlier, getting the drive letter is not that simple (since it 
doesnt progress the same way on different machines). So I thought this was an 
alternative.

About names, if you look at the code, you can see that the names can be 
changed easily. In the attached script, I have changed them to (following 
your need):

Device name -> label after rename_hdd.py
/dev/hda1 (ext3) -> Linux Local Disk (A1)
/dev/hda2 (swap) -> .Swap Disk (A2)
/dev/hda3 (fat32) -> Windows Local Disk ( A3)


If someone can give me a printout/screenshot of hal-device-manager showing the 
Advanced properties of a USB stick, I can make sure that such disks are 
labelled accordingly.

>
> I can test it. Would it work with the Live Kubuntu DVD? I haven't
> installed it on my system yet ...
Well, as long as you have the dependencies (python2.4-dbus, python2.4-dcop and 
python2.4) then it should run (you need to modify the /etc/defaults/hal as 
well so that we can retrieve partition type info from HAL).




I think, this is a good start to a kubuntu-specific default automation 
package. Seeing the HAL/DBUS system and its bindings in Python, I think its 
very possible to popup nice dialogs, control centre modules etc when devices 
are loaded. For eg, wouldn't it be nice if the printer driver selection is 
automatically started when a USB printer is started ? For me currently, this 
doesnt occur (atleast for my Canon S200SPx).

perhaps, it is also a start to a kubuntu specific device-manager ?


enjoy :)
Rajeev J Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rename_hdd.py
Type: application/x-python
Size: 2027 bytes
Desc: not available
Url : http://lists.ubuntu.com/archives/kubuntu-devel/attachments/20050528/a403e6fd/rename_hdd.bin


More information about the kubuntu-devel mailing list