Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-22-2012, 08:45 AM   #1
Registered: Nov 2011
Posts: 47

Rep: Reputation: Disabled
autofs does't mount /dev/sdaX

hello, i have a partition that i use as a storage which is on /dev/sda8.
i'd like to use autofs to mount it only when i need to access it.

i did the configuration according guides i found in google.

here it is:
root# grep ^/m /etc/auto.master 
/media/sto	/etc/
root# cat /etc/ 
/media/sto	/dev/sda8	--timeout=60
root# service autofs status
automount (pid  5006) is running...
root# cd /media/sto
root# ls
root# mount
/dev/sda7 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
when i access that directory, the /dev/sda8 doesn't mount.
what did i do wrong ?
Old 01-22-2012, 01:01 PM   #2
Senior Member
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 343Reputation: 343Reputation: 343Reputation: 343
Hi there,

Originally Posted by newbie0101 View Post
hello, i have a partition that i use as a storage which is on /dev/sda8.
i'd like to use autofs to mount it only when i need to access it.

i did the configuration according guides i found in google.
yea right, but you must have gotten something wrong. I found a pretty good description some time ago. Alright, it's somewhat inclined to Arch Linux, but the basics of autofs are the same across various distros.

root# grep ^/m /etc/auto.master 
/media/sto	/etc/
root# cat /etc/ 
/media/sto	/dev/sda8	--timeout=60
You got that totally mixed up. In /etc/auto.master you should have three fields per line. The first specifies the base directory of the automounts initiated by that line, the second is the individual config file, and the third contains additional options. For you, that could be:

/media/auto   /etc/   --timeout=60 --ghost
This main configuration refers to /etc/ which contains the individual definitions for each volume you want to auto-mount to /media/auto:

sto   -fstype=auto   :/dev/sda8
Again, you have three fields per auto-mount. First the directory name relative to the base directoy specified in /etc/auto.master, then the mount options, and finally the file system you want to mount at that location. Don't ask me why the file system path must be prefixed with a colon, I haven't understood that either. The above sample would auto-mount sda8 to /media/auto/sto when accessed. You may want to add or modify the mount options, though.

[X] Doc CPU
1 members found this post helpful.
Old 01-22-2012, 04:53 PM   #3
Registered: Nov 2011
Posts: 47

Original Poster
Rep: Reputation: Disabled
thank you very much for your help and explanation, it works


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofs Mount problem kernelzack Linux - Software 1 04-22-2010 11:22 AM
VFS:can't mount rootfs on "sdax" or unknown block (0,0):silly,but worked jimmerlin Linux From Scratch 0 11-30-2008 09:35 PM
OpenSUSE x86_64 does not mount /dev/tape (or /dev/st0 or /dev/nst0) yankeeinga Linux - Newbie 6 08-21-2008 12:51 PM
how to use autofs to mount ntfs carlcs Linux - Newbie 10 04-22-2008 08:12 AM
how to mount fstab vs autofs rrich100 Red Hat 1 11-13-2003 11:46 PM

All times are GMT -5. The time now is 09:26 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration