Why do distros handle USB memory stick scripts differently?
Q There seems to be a wide discrepancy in how various distros handle scripts on USB memory sticks. Using Konqueror's execute command under the tools menu: Ubuntu runs them without fuss (initially my Feisty upgrade broke this by mounting the stick non-exec). SUSE 10.2 and Startcom consider the stick as remote and won't execute anything from it. Fedora 7 live raises a prompt for confirmation but it tries to run them from the wrong directory if Konqueror is used to open the USB device icon. The automounter mounts the /dev/sdb1 on /media/disk and Konqueror sees the URL as /media/sdb1.
On execution, Konqueror tries to cd to /media/sdb1 and can't find the executable. If I navigate to /media/disk the scripts can be executed normally. Though SUSE 10.2 won't execute via Konqueror if there's an autostart.sh on the stick, KDE offers to execute this as soon as the stick is plugged in. Presumably all this stuff is configurable (surely it's not compiled in), but as HAL, udev and KDE are all involved with a multiplicity of configuration files, where does one start looking?
A There are a number of reasons for this, partly to do with the way KDE works and partly because of the lack of real file permissions on FAT filesystems. You have already discovered that the path KDE uses to a file on a removable device is not a real path. Konqueror displays media:/media/devname but actually mounts the device on /media/volumename (or /media/disk if the disk does not have a volume name).
This causes no problems with most KDE applications as they understand media:/ and system:/media URLs, but non-KDE programs -like bash - fall over here. It works with Ubuntu because they have patched things so that Konqueror goes directly to the mount point, although there has been some debate over whether the drawbacks of this outweigh the advantages. There is an easy way to fix this for all distros, right-click on a script and open the Properties window. Click on the icon to the right of where it says Type: Shell Script to open the filetype editor and use the Add button to add bash to the list of programs. Don't look in the application list for bash, just type it into the box above the list.
OK this window and the properties and right-clicking on a script will now show bash in the Open With sub-menu. If you put bash at the top of the application list, you will also be able to run scripts by clicking the icon. Either of these is more convenient than selecting the icon and then moving to the top of the window to find the menu. The automatic running of authstart.sh is governed by a setting in the Peripherals/Storage Media section of the KDE Control Center. The other possibility that you refer to is editing the HAL configuration to have the volume mounted with the device name instead of the volume name.
This can be done, but makes the system less intuitive, especially when using FAT filesystems created by other devices that give them a meaningful name: my camera's memory cards are always identifiable as such, as is my audio player, there's no danger of copying files to the wrong device when both are mounted, which could easily happen if they were mounted at /media/sde1 and /media/sdf1.
- Pluscom WU-ZD1211B USB wireless stick not working in Linux
- Long filenames truncated when mounting USB stick in Linux
- Track memory usage over time
- Booting Fedora from a USB stick
- USB stick inaccessible on the desktop