0

[Note: before you mark this a duplicate:

There are several similar-looking questions in this stackexchange (which did not show before creating this question--one seems to get much better matches in the right side of the page after creating a question than one does in the top box after merely entering one's question's title). However none seem to work in jessie: they either rely on deprecated/disappeared packages, or don't actually work under jessie (as with this good-looking but not-working "answer"), or don't meet requirements (as with this answer.]

I have 2 headful laptops: call them happylap and sadlap. Until recently, both

  1. ran wheezy
  2. booted automatically to X and a GNOME-based desktop: DE(happylap)==Cinnamon, DE(sadlap)==MATE
  3. automounted USB drives: connecting a drive to the laptop caused it to automatically mount @ /media/<user ID/>/<drive label/> with user permissions

Very recently I attempted to upgrade sadlap from wheezy to jessie. Unfortunately its dist-upgrade got broken when the upgrade hung attempting to stop fancontrol. sadlap's kernel upgrade appears good in that, when I coldboot, I see 3.16 in its GRUB menu. The problem is that, after booting that kernel,

  1. sadlap boots to tty1 rather than directly to X.
  2. If I startx from tty1, the resulting GUI is very obviously broken and dysfunctional.

That being said, sadlap's tty1 seems to be mostly functional ... except it won't automagically mount USB drives the way happylap still does. Instead I must manually

MOUNT_DEV='/dev/sdb'     # always
MOUNT_DIR='/media/me/it' # or similar
sudo mkdir -p ${MOUNT_DIR}
sudo mount ${MOUNT_DEV} ${MOUNT_DIR}
ls -al ${MOUNT_DIR}

This is annoying because

  1. I want to continue/fix the dist-upgrade, but I also want to be able to record what happens, which I do by teeing the upgrade output from the dist-upgrade to a file on the USB drive (which I transfer to happylap, my main workstation, where I do most logging).
  2. I'm lazy.
  3. The above mounts as root, which annoys, but does not seem to work without sudo. This is even more annoying since I know, from the normal/X experience, that "it doesn't need to be this way."

So I'd like to know,

  1. What must I do to enable automounting from tty1 in jessie?
  2. (probably related) What is making automounting happen "normally" (under X or GNOME or that runlevel or whatever is the relevant context)? If possible, I'd like to just call that from tty1, rather than reinvent this wheel.
0

I'm lazy.

You can create a script that performs all those steps (eg. on ~/.bash_profile).

The above mounts as root, which annoys, but does not seem to work without sudo. This is even more annoying since I know, from the normal/X experience, that "it doesn't need to be this way."

The traditional way would require root. From X there's usually a HAL/udev/setuid program that takes care of this. Given that this is just a temporary measure, I would simply add a line into /etc/fstab like:

UUID=<your usb uuid> /media/myusb  auto     rw,user,uid=TomRoche       0 0

The uid=TomRoche shouldn't be required, but some automounters need it to be explicit. The key is the user parameter, which allows you to mount it as a user (the mount binary is setuid).

The folder /media/myusb needs to exist, but you can create it once, as /media isn't automatically cleaned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.