LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 01-22-2012, 09:45 AM   #1
newbie0101
Member
 
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:
Code:
root# grep ^/m /etc/auto.master 
/media/sto	/etc/auto.storage
root# cat /etc/auto.storage 
/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, 02:01 PM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,061

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
Hi there,

Quote:
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.

Code:
root# grep ^/m /etc/auto.master 
/media/sto	/etc/auto.storage
root# cat /etc/auto.storage 
/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:

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

Code:
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, 05:53 PM   #3
newbie0101
Member
 
Registered: Nov 2011
Posts: 47

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


Reply


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 12:22 PM
VFS:can't mount rootfs on "sdax" or unknown block (0,0):silly,but worked jimmerlin Linux From Scratch 0 11-30-2008 10:35 PM
OpenSUSE x86_64 does not mount /dev/tape (or /dev/st0 or /dev/nst0) yankeeinga Linux - Newbie 6 08-21-2008 01:51 PM
how to use autofs to mount ntfs carlcs Linux - Newbie 10 04-22-2008 09:12 AM
how to mount fstab vs autofs rrich100 Red Hat 1 11-14-2003 12:46 AM


All times are GMT -5. The time now is 08:50 PM.

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