LinuxQuestions.org
Visit Jeremy's Blog.
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-15-2012, 01:37 PM   #1
pauld
Member
 
Registered: Nov 2010
Posts: 33

Rep: Reputation: 1
mount media to multiple locations


Hi Everyone,

I would like to mount /dev/cdrom to multiple locations for accessibility reasons. I would like it to be available from ftp doc root and http doc root.

So I need it at these 2 locations:
/var/ftp/pub/installfiles
/var/www/html/installfiles

now I am aware of "mount --bind", but if I put it in the rc.local it does not work for some reason and I have to manually mount on every reboot.

I am also aware of the symlink option, however vsftpd does not follow symlinks and someone told me its a big security issue, but I am open to it if this is recommended.

What other options do I have?

Thanks!

Last edited by pauld; 01-15-2012 at 02:10 PM.
 
Old 01-15-2012, 01:48 PM   #2
pauld
Member
 
Registered: Nov 2010
Posts: 33

Original Poster
Rep: Reputation: 1
well who knew.. apparently this worked.. just mounted the cdrom to multiple locs in /etc/fstab
Now I dont know if this is the right method or could cause any other problems


/dev/cdrom /media/install iso9660 defaults 0 0
/dev/cdrom /var/ftp/pub/files iso9660 defaults 0 0
 
Old 01-15-2012, 02:02 PM   #3
MartinStrec
Member
 
Registered: Jan 2012
Location: Czech
Distribution: Fedora, RHEL, Ubuntu, Mint
Posts: 110

Rep: Reputation: 14
Symlinks are not a good idea. FTP very often denies symlinks by default due to security risk. The attack can be done by making a fake link such as 'ln -s /etc/passwd myfile'. When anybody can make link so he/she can read many other files. Except you strongly secure your system by SELinux very well.

Try to write your regular SysV init script such as a service (it just need to implement start/stop/status) and make links into required rcX.d direcotries (levels).

I've really no idea why your rc.local doesn't work. I guess when you run your /etc/rc.d/rc.local, it works fine.
 
Old 01-15-2012, 10:19 PM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,849

Rep: Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024
It could be that you're just not allowing enough time for the first mount to complete before executing the bind mount. Try telling the script to sleep for a couple of seconds before moving on.
 
Old 01-16-2012, 08:50 PM   #5
pauld
Member
 
Registered: Nov 2010
Posts: 33

Original Poster
Rep: Reputation: 1
Hi David,
The first mount is via /etc/fstab, and the bind mount is via rc.local.
So I should just put something like "sleep 5" before the "mount --bind ..." in rc.local?
 
Old 01-17-2012, 08:07 AM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,849

Rep: Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024
Possibly. I'm just throwing out a guess. I'm not much of an expert on what happens during system starts. Do you get any errors in your system logs?

I'd also try configuring the script so that it spits some feedback about what it's doing into a file somewhere. Redirect the stderr of the mount command there, at least.
 
  


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
DNS at multiple locations winblowzxp Linux - Server 2 01-13-2011 07:21 PM
How to remove multiple directories in different locations CHARL0TTE Linux - Newbie 9 03-25-2010 07:20 PM
1 Mount 2 Locations pendal Linux - Networking 3 08-31-2009 02:11 PM
Redirecting output to multiple locations? SirTristan Linux - Newbie 6 05-29-2008 03:52 PM
mount same device at multiple locations merlin23 Linux - Newbie 2 12-06-2004 07:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:06 AM.

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
Open Source Consulting | Domain Registration