Debian This forum is for the discussion of Debian Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-03-2008, 03:45 PM
|
#1
|
|
LQ Newbie
Registered: Dec 2008
Location: Russia, Saint Petersburg
Distribution: Arch GNU/Linux
Posts: 6
Rep:
|
Auto-mount usb flash without any DE
I tried two ways: - /etc/udev/rules.d/00.my.rules
Code:
ATTRS{model}=="USB MP3 ", NAME="explay"
/etc/auto.master
Code:
/var/autofs/explay /etc/auto.misc -timeout=2
/etc/auto.misc
Code:
explay -fstype=vfat,users,rw,umask=0002,codepage=866,iocharset=utf8,gid=users,sync :/dev/explay
- /etc/udev/rules.d/00.my.rules
Code:
ATTRS{model}=="USB MP3 ", NAME="explay", RUN+="/bin/mount -t auto /dev/explay"
/etc/fstab
Code:
/dev/explay /media/explay vfat users,rw,umask=0002,codepage=866,iocharset=utf8,gid=users,sync 0 0
After connecting my usb flash, it appears in /dev as /dev/explay but it's not mounts automaticly, nevertheless i can mount it manualy.
I'm using Debian Lenny.
|
|
|
|
12-03-2008, 04:58 PM
|
#2
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,359
|
Make sure that automount is running:
Code:
ps -ef|grepa automount
Note also that you should create the /var/autofs directory, while the /var/autofs/explay is created automatically when you connect the flash drive. So connect the flash drive in the usb port and the run
Code:
ls /var/autofs/explay
to see if it's mounted automatically by listing its contents.
If this is not working running dmesg could show you what's wrong.
Regards
|
|
|
|
12-04-2008, 04:30 AM
|
#3
|
|
LQ Newbie
Registered: Dec 2008
Location: Russia, Saint Petersburg
Distribution: Arch GNU/Linux
Posts: 6
Original Poster
Rep:
|
Autofs works:
Code:
$ sudo /etc/init.d/autofs status
Configured Mount Points:
------------------------
/usr/sbin/automount --timeout=300 /var/autofs/explay file /etc/auto.misc
/usr/sbin/automount --timeout=300 /var/autofs/flash file /etc/auto.misc
Active Mount Points:
--------------------
/usr/sbin/automount --pid-file=/var/run/autofs/_var_autofs_explay.pid --timeout=300 /var/autofs/explay file /etc/auto.misc
/usr/sbin/automount --pid-file=/var/run/autofs/_var_autofs_flash.pid --timeout=300 /var/autofs/flash file /etc/auto.misc
Code:
$ ps -ef|grep automount
root 2386 1 0 13:04 ? 00:00:00 /usr/sbin/automount --pid-file=/var/run/autofs/_var_autofs_explay.pid --timeout=300 /var/autofs/explay file /etc/auto.misc
root 2428 1 0 13:04 ? 00:00:00 /usr/sbin/automount --pid-file=/var/run/autofs/_var_autofs_flash.pid --timeout=300 /var/autofs/flash file /etc/auto.misc
sergey 3074 2884 0 13:10 pts/1 00:00:00 grep automount
Device created:
Code:
$ ls /dev/flash
/dev/flash
Code:
$ sudo mount | grep flash
automount(pid2428) on /var/autofs/flash type autofs (rw,fd=4,pgrp=2428,minproto=2,maxproto=4)
But where is no files in /var/autofs/flash/ directory:
Code:
$ sudo ls -l /var/autofs/flash/
итого 0
And it's not mounted:
Code:
$ sudo umount /dev/flash
umount: /dev/flash: not mounted
But i can mount my flash manualy:
Code:
$ sudo mount -t vfat /dev/flash /mnt/flash/
$ ls /mnt/flash/
casper isolinux ldlinux.sys md5sum.txt preseed syslinux.cfg ubnfilel.txt ubninit ubnkern ubnpathl.txt vesamenu.c32
I'm not understand why it is happening 
|
|
|
|
12-04-2008, 06:26 AM
|
#4
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,359
|
According to /etc/auto.misc your usb stick it's automounted on /var/autofs/explay and not on /var/autofs/flash. Now you have to edit /etc/auto.master like this:
Code:
/var/autofs /etc/auto.misc
If you want to use the timeout option you should add "--timeout=2" (note there are 2 dashes in front) to the above line.
Last edited by bathory; 12-04-2008 at 07:08 AM.
|
|
|
|
12-04-2008, 06:52 AM
|
#5
|
|
LQ Newbie
Registered: Dec 2008
Location: Russia, Saint Petersburg
Distribution: Arch GNU/Linux
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
According to /etc/auto.misc your usb stick it's automounted on /var/autofs/explay and not on /var/autofs/flash.
|
This is just another flash stick, it has it's own strings in config files
Quote:
Originally Posted by bathory
Code:
/var/autofs /etc/auto.misc
If you want to use the timeout option you should add "--timeout=2" (note there are 2 dashes in front) to the above line.
|
There is no such file in my /etc catalog, i create it manualy. And nothing happens after plug-in my device…
|
|
|
|
12-04-2008, 07:14 AM
|
#6
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,359
|
Quote:
|
There is no such file in my /etc catalog, i create it manualy. And nothing happens after plug-in my device…
|
Ok, this is my fault. I've forgotten the dot in the filename. The correct is /etc/auto.master. You should have something like the following:
/etc/auto.master
Code:
/var/autofs /etc/auto.misc
/etc/auto.misc
Code:
explay -fstype=vfat,users,rw,umask=0002,codepage=866,iocharset=utf8,gid=users,sync :/dev/explay
You can connect the usb device in the computer and watch the dmesg output to find the correct device name (in my system the usb stick is /dev/sda1) and replace explay with it in /etc/auto.misc.
Of course you need to restart autofs.
Last edited by bathory; 12-04-2008 at 07:15 AM.
|
|
|
|
12-04-2008, 08:38 AM
|
#7
|
|
LQ Newbie
Registered: Dec 2008
Location: Russia, Saint Petersburg
Distribution: Arch GNU/Linux
Posts: 6
Original Poster
Rep:
|
Oh... I remove all lines from udev config… According dmesg outputs, my flash name is /dev/sda1
I have only one string in /etc/auto.master:
Code:
/var/autofs/ /etc/auto.misc --timeout=2
And only one string in /etc/auto.misc:
Code:
explay -fstype=vfat,users,rw,umask=0002,codepage=866,iocharset=utf8,gid=users,sync :/dev/sda1
And it works. Thank you very much
And one more question: need i use "sync" mounting option with "--timeout=2" at my /etc/auto.master file? I think that "synk" makes writing slower…
|
|
|
|
12-04-2008, 09:41 AM
|
#8
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,359
|
Glad to see it worked.
You don't need the sync option with such a short timeout.
Regards
|
|
|
|
12-04-2008, 10:22 AM
|
#9
|
|
LQ Newbie
Registered: Dec 2008
Location: Russia, Saint Petersburg
Distribution: Arch GNU/Linux
Posts: 6
Original Poster
Rep:
|
Thanks a lot
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:57 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|