You are not logged in.
Links
Sourceforge Project Page
AUR Package
GitHub Repository
Screenshots
Main menu
Device sub-menu
Custom commands
Overview
bashmount is a menu-driven bash script that uses udisks to easily mount, unmount or eject removable devices without dependencies on any GUI or desktop environment. An extensive configuration file allows many aspects of the script to be modified and custom commands to be run on devices. It is written in bash and ~1000 SLOC so is easily hackable.
This script does not provide automounting of removable media as there are already many ways to automount. The file managers in GNOME and KDE handle automounting, while udev rules or scripts like Udiskie can be used in other environments. However, bashmount can be used alongside any of these, and should work in any recent distribution that uses udisks.
You should edit the configuration file first before running. Make sure to always copy over the configuration file, as some options may be changed or added in each release.
Notes
Dbus and consolekit/policykit need to be running. If you aren't using a login manager, put this in ~/.xinitrc:
source /etc/X11/xinit/xinitrc.d/30-dbus
exec ck-launch-session i3
If it doesn't already exist, create the file "/etc/polkit-1/localauthority/50-local.d/10-udiskie.pkla" with these contents:
[Local Users]
Identity=unix-group:storage
Action=org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=no
ResultActive=yes
Bug reports, comments and criticisms welcome!
Last edited by jnguyen (2012-02-06 20:55:35)
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline
Wrong link (http://aur.archlinux.org/packages.php?ID=48524).
Anyway, good job, indeed! KISS and comfortable at the same time
Offline
Wrong link (http://aur.archlinux.org/packages.php?ID=48524).
Anyway, good job, indeed! KISS and comfortable at the same time
Oops, fixed now!
Thanks, I'm glad you find it useful
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline
That is really nice. Good job.
Offline
I liked obdevicemneu, but this is even better! Thanks!
Offline
Thanks for the feedback
@mundane: you can actually use both obdevicemenu and bashmount together. I prefer bashmount though, as there are some things that I have implemented better, and you also don't have to use a mouse
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline
jnguyen, let my add that your way to show your software is really awesome: I mean, Title, Links, Screenshots, Overview. A model of clarity and elegance.
You deserve every compliment you get
Offline
I have moved permanently from obdevicemenu to bashmount now....... I really like how configurable it is!
It really is well thought out, good job
Offline
Thanks, it looks great ! Would bashmount also work for floppy disks ?
Offline
Thanks very much for the feedback everyone
Thanks, it looks great ! Would bashmount also work for floppy disks ?
I'm pretty sure udisks will support floppy disks. I just don't have a floppy drive in order to test so if you could help me out with a few questions then that would be great! I'm assuming that your floppy drive appears as /dev/fd0.
1) Is this device file (/dev/fd0) present even when there is no floppy drive inside? If yes, then could you post the output of "udisks --show-info /dev/fd0" with no floppy disk in the drive.
2) Post the output of "udisks --show-info /dev/fd0" with a floppy disk inserted but not mounted.
3) Keep the floppy disk in the drive and try running "udisks --mount /dev/fd0" and post the output if any.
4) Post the output of "udisks --show-info /dev/fd0" with a floppy disk inserted and is mounted.
Remember to put BBCode code tags around the output when you post it up here!
Last edited by jnguyen (2011-04-29 16:02:59)
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline
Very nice application! One question: this is the only application that uses the dbus daemon on my system. Is there a way to circumvent dbus?
Offline
Hello jnguyen,
Answers to your questions :
1) output when there is no floppy drive inside "udisks --show-info /dev/fd0" : http://pastebin.fr/11222
2) output with floppy but not mounted "udisks --show-info /dev/fd0" : http://pastebin.fr/11223
3) output when mounted "udisks --mount /dev/fd0" : http://pastebin.fr/11224
4) output when mounted "udisks --show-info /dev/fd0" : http://pastebin.fr/11225
Thanks for your help. Best regards,
Offline
1) output when there is no floppy drive inside "udisks --show-info /dev/fd0" : http://pastebin.fr/11222
2) output with floppy but not mounted "udisks --show-info /dev/fd0" : http://pastebin.fr/11223
3) output when mounted "udisks --mount /dev/fd0" : http://pastebin.fr/11224
4) output when mounted "udisks --show-info /dev/fd0" : http://pastebin.fr/11225
Thanks for posting these.
Good news is that it is quite simple to support floppy disks. Just change to this in the configuration file:
optical_devices="-E ^/dev/sr[0-9]+|^/dev/fd[0-9]+"
Or you could add to removable_devices instead depending on where you want your floppy drive to show up in bashmount:
removable_devices="-E ^/dev/sd[b-z]?[0-9]*|^/dev/fd[0-9]+
Bad news is that with the above change to the configuration file, "fd0" will always be present in bashmount whether there is a floppy disk inside or not. Floppy drives are similar to optical drives in that the device file is always present. However, udisks is able to tell if there is a CD/DVD inserted, but is not able to tell whether a floppy disk is inserted (judging from the output you gave me). Currently, bashmount hides the /dev/sr0 entry if no CD/DVD is inside.
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline
Very nice application! One question: this is the only application that uses the dbus daemon on my system. Is there a way to circumvent dbus?
Thank you
Dbus is not a direct dependency of bashmount but is a dependency of udisks. I'm pretty sure you can't really use udisks without dbus running, sorry. From the udisks freedesktop.org page:
The udisks project provides: a storage daemon that implements well-defined D-Bus interfaces that can be used to query and manipulate storage devices.
If it's any consolation, it is the same situation on my system: nothing else is using dbus. But personally I'd much rather be able to handle removable devices a little easier than try to run a system without dbus.
Last edited by jnguyen (2011-04-30 15:44:59)
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline
Good news is that it is quite simple to support floppy disks. Just change to this in the configuration file:
optical_devices="-E ^/dev/sr[0-9]+|^/dev/fd[0-9]+"
I added this to my /etc/bashmount.conf and it seems that bashmount still doesn't look at my floppy disks ?
Thanks again for your help !
Offline
jnguyen wrote:Good news is that it is quite simple to support floppy disks. Just change to this in the configuration file:
optical_devices="-E ^/dev/sr[0-9]+|^/dev/fd[0-9]+"
I added this to my /etc/bashmount.conf and it seems that bashmount still doesn't look at my floppy disks ?
Thanks again for your help !
Oops, bad advice on my part. Looking at the code again, it should (hopefully) work if you undo your changes to optical_devices and append this to removable_devices instead:
removable_devices="-E ^/dev/sd[b-z]?[0-9]*|^/dev/fd[0-9]+"
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline
Oops, bad advice on my part. Looking at the code again, it should (hopefully) work if you undo your changes to optical_devices and append this to removable_devices instead:
removable_devices="-E ^/dev/sd[b-z]?[0-9]*|^/dev/fd[0-9]+"
Thanks, now it works ! great bashscript !
Offline
jnguyen wrote:Oops, bad advice on my part. Looking at the code again, it should (hopefully) work if you undo your changes to optical_devices and append this to removable_devices instead:
removable_devices="-E ^/dev/sd[b-z]?[0-9]*|^/dev/fd[0-9]+"
Thanks, now it works ! great bashscript !
so it's finally time for bashscript 1.1, I suppose
Offline
Thanks, now it works ! great bashscript !
No problem
so it's finally time for bashscript 1.1, I suppose
Yep, in the next version I will put in a comment within bashmount.conf to demonstrate how to include floppy drives. Also a bit of code review going in too
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline
bashmount 1.1.0 released, now with support for SD card readers (which appear as /dev/mmcblk* devices).
I don't actually have a card reader to test this, so please do let me know if it doesn't work at all!
Please remember to update your configuration files, as there are several changes.
Last edited by jnguyen (2011-05-08 15:07:49)
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline
That thing is cool. I use thunar for auto-mounting, but sometimes it does not unmount the devices quick enough when I want to access them via gparted. I always had to use small scripts to do that and they failed sometimes.
One little problem though... It shows me the following drives:
bashmount 1.1.0
================== REMOVABLE MEDIA ==================
5) sde: No label (A953)
6) sdf1: Exile [mounted]
=================== OPTICAL MEDIA ===================
===================== COMMANDS ======================
e: eject i: info m: mount o: open u: unmount
a: unmount all r: refresh q: quit ?: help
=====================================================
Command:
It says the drives have the number 5 and 6 (for 5=e and 6=f), but I have to access them with 1 and 2, for they are the first and the second in the list. I haven't had a look at the settings yet, maybe it's in there.
Offline
Hi awebb, can you post your bashmount.conf as well please (if you've changed it), and the output of:
udisks --enumerate-device-files
Last edited by jnguyen (2011-05-08 15:44:02)
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline
bashmount 1.1.3 released. Again, several important configuration file changes were made so remember to update them. This should fix some issues regarding /dev/mmcblk* devices, as well as numbering.
Awebb, can you also let me know if bashmount 1.1.3 fixes your problem.
Last edited by jnguyen (2011-05-08 16:43:18)
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline
Just wanted to say a big thank you for writing this script. It's so comfortable to use and works flawlessly on Debian Testing, Ubuntu Natty 11.04 and all other Ubuntu derivatives I've tried, even on the Unity or GNOME desktops. I don't use Archlinux yet, but I've been thinking about giving a try!
Offline
Just wanted to say a big thank you for writing this script. It's so comfortable to use and works flawlessly on Debian Testing, Ubuntu Natty 11.04 and all other Ubuntu derivatives I've tried, even on the Unity or GNOME desktops. I don't use Archlinux yet, but I've been thinking about giving a try!
Thanks for the feedback I got desktop universality for free due to the integration of udisks into pretty much all modern Linux distros.
1.1.4 released with only minor code changes.
TOMOYO Linux: Mandatory Access Control.
My AUR packages
Offline