[SOLVED] how to configure /etc/fstab with auto but do not mount it after boot up
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Basic file system independent options are:
.
.
noauto do not mount when "mount -a" is given (e.g., at boot time)
the implication is that the init scripts issue the command "mount -a" (you can check this)
If you don't mind a kludge, you could set an entry to "noauto", and then add a line to an init script that changes the fstab entry after "mount -a" has been issued.
Even if I am using script to start it manually I am curious which init script contains "mount -a" - where is it located ?
I would like to learn how the boot process works more precisely.
Couldn't you also do this with the automounter? Then, if you cd to the mount point for the filesystem, it will mount it automatically. What's the difference between using the noauto option in /etc/fstab vs. using the automounter? Just different methods of getting the volume mounted?
thanks you all for help.
Even if I am using script to start it manually I am curious which init script contains "mount -a" - where is it located ?
I would like to learn how the boot process works more precisely.
regards,
M.
I am glad my post was helpfull..
I have found this, check it out for some more info about the boot process (today I have learned something too.. ). The command mount -a is issued by S35mountall.sh -> ../init.d/mountall.sh.
Quote:
Originally Posted by ohlookpie
Couldn't you also do this with the automounter? Then, if you cd to the mount point for the filesystem, it will mount it automatically. What's the difference between using the noauto option in /etc/fstab vs. using the automounter? Just different methods of getting the volume mounted?
Yes, eventually they are just different ways to get the job done...
Cheers
M.
Actually, if you red this page and the links therein, you'll find that autofs can mount drives on demand (eg when cd'ing into the dir), so long as its properly configured.
Actually, if you red this page and the links therein, you'll find that autofs can mount drives on demand (eg when cd'ing into the dir), so long as its properly configured.
+1 to my continuous Linux learning, thanks for the precisation!
1. mkdir /test
2. vi /etc/auto.master and add this line:
Quote:
/test /etc/auto.test
3. vi /etc/auto.test and add this line:
Quote:
foo -fstype=ext4 :/dev/sda2
4. cd to /test/foo and it automatically mounts device /dev/sda2 (and ls /test/foo would have the same results).
5. cd out and it automatically unmounts the device after 10 minutes or so
I just need to figure out how to make it so that I can cd to /test and have it mount. I tried a * instead of foo, didn't work. I tried a / instead of foo, didn't work. I imagine there's a way though. Side note: You could edit auto.misc and add "foo -fstype=ext4 :/dev/sda2" and then you'd just cd to /misc/foo and get the same results. If you did this, you would not have to edit auto.master, since auto.misc is already in auto.master.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.