3

This isn't a big deal i was just curious so if anyone happens to know why then great.

I'm not sure if usbmount is the tool as which usbmount doesn't show anything but on my debian system (no graphics) when i plugin my usb and load it in vmware i see

[sdb] Assuming drive cache: write through

I don't see it in /media nor /mnt. Using the same install CD i can install the graphic version and when i plug in the usb the same way it shows up in /media. Does anyone know why? I figured either nothing would happen or it would show up when i plugged it in. Now i get the msg so its like something in between.

4 Answers4

2

A dirty solution with shell script is monitoring kernel message, whenever you see a device plugged in, you use udisks to mount all partitions of that disk.

i.e

#!/bin/bash

tail -f /var/log/messages | while read line; do
  if [[ $line =~ \[(sd[a-z])\] ]];then
    for x in /dev/${BASH_REMATCH[1]}*
    do
        echo "Mounting $x"
        echo udisks --mount $x # remove the echo
    done
  fi
done

But it's better make one with gvfs or udisks APIs, I don't know about it at this moment

daisy
  • 54,555
  • udev can be configured to do something (e.g.run automount script) on device related events. dmesg -w can be used to monitor kernel messages. – Zrin Sep 28 '17 at 08:16
1

I believe Debian uses usbmount when you plug in removable devices in non-GUI environments .. And gives the desktop environments/file managers greater control when you plug in through a desktop environment.

0

There are extra utilities loaded with a full fledged graphical environment that handle all this for you. In a shell with only the basic packages, the system babies you much less and expects you to do a lot of the heavy lifting. Using the command line you must mount your partitions manually and if you want devices to be mounted at boot you need to edit /etc/fstab

fdisk -l displays partition information and the mount command allows you to mount a partition at a mount point.

Mount mount mount.

0

This message indicates that the kernel has noticed a storage medium sdb. It doesn't indicate anything about any filesystem on this storage medium.

See Automount USB drives with no GUI requirement (halevt replacement) for ways to automatically mount the drive, or do it manually with a utility such as pmount.

  • wow thanks. I think i'll just install the graphics version and not make things difficult for myself. –  Nov 04 '12 at 03:34