How to mount a removable USB drive from a script

Jonathan Ryshpan jonrysh at pacbell.net
Sat Nov 25 23:12:38 UTC 2006


I have a removable USB drive on my system.  When KDE starts an icon
appears on the desktop that allows the drive to be mounted in the /media
directory; as a side effect the directory /media/usb-disk/ is created on
which to mount the drive.  This is done by right clicking the icon and
clicking on the desired action in the popup menu.

There must be some way to have a shell script perform the same operation
that clicking on the icon/popup line mount makes happen.  What is it?

If I create the directory /media/usb-disk and then "$
mount /dev/sda1 /media/usb-disk", everything works fine till I unmount
the disk, as can be done using the icon; but then an attempt to remount
the drive by clicking on the "Open" line in the popup fails with the
message:
	The mount point '/media/usb-disk' is already occupied

which is, of course, not correct.  I think I've filed a bug on this, but
I have so many bugs outstanding that I'm not sure.

Thanks - jon




More information about the fedora-list mailing list