Linux - Newbie This 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.
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.
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.
|
|
07-20-2012, 01:28 AM
|
#1
|
LQ Newbie
Registered: Jul 2012
Posts: 1
Rep:
|
Fedora Linux help: How to add a command in /etc/rc.local file?
I am very new in Linux. I installed fedora in Virtual Box with host windows xp. I want to share file between host and guest. Someone suggest me to run the command in fedora #sudo mount -t vboxsf -o uid=1000,gid=1000 F_DRIVE /home/menjar/Desktop/xp where F_DRIVE is the F drive in xp I am sharing and 'xp' is the folder in fedora where I want to mount. Now It works but when I reboot, I can't see the contents of xp folder anymore. After goggling I find a suggestion that say to add the command in /etc/rc.local file. I am very new in linux so I want to know how do I do this. I have tried to do this by using vi editor by running #vi /etc/rc.local and I add the line sudo mount -t vboxsf -o uid=1000,gid=1000 F_DRIVE /home/menjar/Desktop/xp where F_DRIVE and save by pressing Esc and then :wq but after doing I couldn't see any result. It still doesn't work. So please explain how do I do this step by step ( I am very new and don't know anything about Linux)? Am I doing something wrong with the command? should I have to place a '#" in front of the command while placing the line in /etc/rc.local? Please explain how do I solve it in detail.. I am waiting for your answer.
|
|
|
07-20-2012, 02:06 AM
|
#2
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,253
|
Fedora (unfortunately sometimes) is a very dynamic distro. Things are always changing - rc.local for instance.
Nowadays it's called /etc/rc.d/rc.local
You can simply rename ("mv" to a new name) your current file - but you should also remove the "sudo ", it's not needed when the command is issued in rc.local. As root do this to rename that file
Code:
mv /etc/rc.local /etc/rc.d/rc.local
|
|
|
07-20-2012, 02:10 AM
|
#3
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
just add the line to fstab, there are already proper mechanisms for doing what you want. I expect the line:
F_DRIVE /home/menjar/Desktop/xp vboxsf uid=1000,gid=1000
will work fine. don't mess with rc.local if you don't need to.
|
|
|
07-20-2012, 03:00 AM
|
#4
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,253
|
Yep, that should work for a normal (FSVO "normal") Fedora install.
I am so used to having /home on a separate partition - I have to use rc.local for this sort of thing.
|
|
|
07-20-2012, 03:10 AM
|
#5
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
I'm forever answering the question, rather than solving the OP's problem, not always the same thing!
why does a separate /home necessitate using rc.local?
|
|
|
07-20-2012, 03:21 AM
|
#6
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,253
|
It appears you can't guarantee the mount for /home completes before anything that needs to mount under a sub-directory of /home is initiated if both are in fstab. Last I checked (F16), it still applied.
I haven't chased it vigorously, I just found a work-around that works (for me).
|
|
|
07-21-2012, 05:14 AM
|
#7
|
Member
Registered: Feb 2009
Posts: 347
Rep:
|
Quote:
but after doing I couldn't see any result. It still doesn't work
|
Hope you restarted the system after adding the line as it will not take effect unless you don't restart.
And don't put a "#" before the command, that would comment out the command and it will not be executed
|
|
|
All times are GMT -5. The time now is 06:42 AM.
|
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
|
|