WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Why don't usb flash devices auto mount?  (Read 6681 times)

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Why don't usb flash devices auto mount?
« on: June 09, 2009, 10:33:04 AM »
Just curious as to why when plugging in a USB flash device it is recognized as a "device" and added to  /mnt but it is not mounted. What would I have to change to get this to happen automatically?

Also, I have noticed a super trivial carriage return is required after plugging a USB device in to get terminal  control back.
big pc man

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Why don't usb flash devices auto mount?
« Reply #1 on: June 09, 2009, 11:19:27 AM »
Because that would be rude, and for many would not be wanted. Think the autorun on Windows systems.

To get it to happen automatically, you could add "mount -a" to the end of rebuildfstab
The only barriers that can stop you are the ones you create yourself.

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: Why don't usb flash devices auto mount?
« Reply #2 on: June 09, 2009, 11:34:45 AM »
Because that would be rude, and for many would not be wanted. Think the autorun on Windows systems.

To get it to happen automatically, you could add "mount -a" to the end of rebuildfstab

Thanks. Sometimes I just can't help myself and will be rude. I assume this will auto mount all devices "plugged in" to any device port. Let's say I wanted to limit this behavior to just USB devices. I don't want to auto mount CDs.
« Last Edit: June 09, 2009, 11:36:25 AM by bigpcman »
big pc man

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Why don't usb flash devices auto mount?
« Reply #3 on: June 09, 2009, 11:43:04 AM »
If your drives are fat32, "mount -a -t vfat" only mounts those.

If you wish to restrict things better, just parse /etc/fstab or the directories in /mnt for desired devices.
The only barriers that can stop you are the ones you create yourself.

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: Why don't usb flash devices auto mount?
« Reply #4 on: June 09, 2009, 12:11:22 PM »
To get it to happen automatically, you could add "mount -a" to the end of rebuildfstab

I just tried this and it didn't mount sdb1 after I plugged the device in.

The device is present and I can manually mount and unmount it.

I'm using microcore 2.0 with core extensions.
big pc man

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Why don't usb flash devices auto mount?
« Reply #5 on: June 09, 2009, 12:56:11 PM »
Ah, indeed :P I forgot noauto is added in the options list.
The only barriers that can stop you are the ones you create yourself.

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: Why don't usb flash devices auto mount?
« Reply #6 on: June 09, 2009, 02:22:44 PM »
Ah, indeed :P I forgot noauto is added in the options list.
This message is a bit too cryptic for me. Are we giving up?
big pc man

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Why don't usb flash devices auto mount?
« Reply #7 on: June 09, 2009, 03:04:00 PM »
No, you can just remove "noauto" from the options list in rebuildfstab :)
The only barriers that can stop you are the ones you create yourself.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: Why don't usb flash devices auto mount?
« Reply #8 on: June 09, 2009, 03:18:59 PM »
No giving up allowed =o)

"noauto" is a mount option for the device added to fstab.  This makes the device need to be mounted explicitly, so mount -a won't mount it.


EDIT: ignore the following.  I misread curaga's reply and his solution is much better.

Personally I'd go for a check of the specific device rather than have to manually edit fstab every time:

Code: [Select]
for i in sda1 sdb1 sdb2 blah blah blah whatever; do
if grep "/dev/$i" /etc/fstab; then mount /dev/$i; fi
done
...or something like that

Offline kerpob

  • Jr. Member
  • **
  • Posts: 83
Re: Why don't usb flash devices auto mount?
« Reply #9 on: June 11, 2009, 05:03:14 AM »
puppy had this brilliant mount utility called mut (or maybe mutt). You clicked on the icon and it showed all your drives. You could then click on a button next to each one to mount or unmount. Another option was a link to open them in a file manager (Rox was the one I had at the time).
eee user. From Xandros to Debian via Breeezy to TCL.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Why don't usb flash devices auto mount?
« Reply #10 on: June 11, 2009, 05:04:14 AM »
We have a mount tool too ;)
It shows one drive at a time, you can click through all the drives and mount/umount.
The only barriers that can stop you are the ones you create yourself.

Offline kerpob

  • Jr. Member
  • **
  • Posts: 83
Re: Why don't usb flash devices auto mount?
« Reply #11 on: June 12, 2009, 07:23:44 AM »
We have a mount tool too ;)
It shows one drive at a time, you can click through all the drives and mount/umount.
I know - and it is one of the better ones I've seen. But Mut(t) is better looking!
eee user. From Xandros to Debian via Breeezy to TCL.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Why don't usb flash devices auto mount?
« Reply #12 on: June 12, 2009, 09:04:27 AM »
I'm not familiar with Puppy (tried it once a while back, didn't care for it, don't remember why) so I can't say anything about "better looking", but I really like tc's mount tool - simple and functional, elegant even.

It would be cool if there were a variant with the buttons side-by-side instead of over-under, and smaller, so it would swallow without gagging the tray (in jwm) - though the way it is now is much better for unswallowed use.  Gentler colors wouldn't hurt.

32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: Why don't usb flash devices auto mount?
« Reply #13 on: June 12, 2009, 10:50:54 AM »
I'm not familiar with Puppy (tried it once a while back, didn't care for it, don't remember why) so I can't say anything about "better looking", but I really like tc's mount tool - simple and functional, elegant even.

It would be cool if there were a variant with the buttons side-by-side instead of over-under, and smaller, so it would swallow without gagging the tray (in jwm) - though the way it is now is much better for unswallowed use.  Gentler colors wouldn't hurt.



My vote would be for a submenu in tools that would support changing some of the system variables like "enable/ disable"  automount.
big pc man