1

I'm following this tutorial to set up a LAMP stack on EC2 with persistent storage on EBS. It all works well when doing it step by step.

But in case you want to mount your EBS under /mnt instead of under the root directory the

ln -s

commands won't work!

I tried:

ln -s /mnt/ebs1/httpd /etc

and:

ln -s /mnt/ebs1/httpd /etc/httpd

Is there a difference when linking to a file on a device that is mounted under /mnt?

(working on fedora core 8)

Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151
Yaniv
  • 135
  • 4
  • 1
    How do you know it doesn't work? Is there an error message? – David Z Oct 31 '09 at 21:37
  • David, thanks for your query, no there is no error in the command line after submitting the links. but when i start back the httpd service i get an error saying that the .conf file is unreadable and the service fail to start. – Yaniv Oct 31 '09 at 21:50
  • What do you see when you do `ls -l /mnt/ebs1/httpd /etc`? – Dennis Williamson Oct 31 '09 at 22:01
  • Please don't try to symlink your entire /etc to a httpd config directory. It will kill your system. ln -s /mnt/ebs1/httpd /etc/httpd should work, unless there already is a /etc/httpd present. – pauska Dec 02 '09 at 13:22
  • Yaniv, what is the result of `ls -ld /etc/httpd` ? This may seem obvious, but the obvious has to be covered.... – casualcoder Nov 01 '09 at 00:51

2 Answers2

1

ln -s /path/to/source /path/to/dest

should work on any normal filesystem.

What do you see with ls -lh /mnt/ebs1/httpd? Is the symlink created? If it is, check if apache is allowed to open the directory and read the config files. To do so, enter ls -l /mnt/ebs1/ and look for "x" and "r" bits in the permissions (beginning of line).

Update after comment:

The permissions are okay AFAIK. You should focus on apache then. Are there any errors in the logs? What does debug say?

PEra
  • 2,875
  • 18
  • 14
  • Thanks PEra, output for ls -lh /mnt/ebs/httpd: # ls -lh /mnt/ebs1/httpd total 8.0K drwxr-xr-x 2 root root 4.0K 2009-10-31 19:27 conf drwxr-xr-x 2 root root 4.0K 2009-10-31 19:27 conf.d lrwxrwxrwx 1 root root 19 2009-10-31 19:32 logs -> ../../var/log/httpd lrwxrwxrwx 1 root root 27 2009-10-31 19:32 modules -> ../../usr/lib/httpd/modules lrwxrwxrwx 1 root root 13 2009-10-31 19:32 run -> ../../var/run and for ls -l /mnt/ebs1/ i get: # ls -l /mnt/ebs1/ total 20 drwxr-xr-x 4 root root 4096 2009-10-31 19:27 httpd drwx------ 2 root root 16384 2009-10-31 19:25 lost+found any suggestions? – Yaniv Oct 31 '09 at 23:41
  • sorry for that mess :) – Yaniv Oct 31 '09 at 23:42
  • well... i can't access the logs i see the file when i dir httpd but i cant see it's content with vi (says ne file).. – Yaniv Oct 31 '09 at 23:58
0

/mnt is usually for external drives like cdroms and usb sticks. USB sticks, phones, ipods etc. usually have crappy filesystems that don't support features like links.

Lee B
  • 3,460
  • 1
  • 17
  • 15
  • i formated the device to ext3 using; mkfas ext3 /dev/sdh and mounted it with: mount -t ext3 /dev/sdh /mnt/ebs1 is that change anything? – Yaniv Nov 01 '09 at 00:32
  • 2
    The /media directory is used for removable media such as iPods, USB sticks, etc. The /mnt directory is for system administrator use. See the FHS specifications (part of the LSB spec): http://www.pathname.com/fhs/pub/fhs-2.3.html#MEDIAMOUNTPOINT Furthermore, while most removable devices do use FAT, which is not suitable for links, the end result of the OP's link is in /etc, for which links must work on most Unix systems. – casualcoder Nov 01 '09 at 00:42
  • /mnt used to be a dir for mountpoints a couple of years ago... I guess that old habits die slowly. – Johan Nov 01 '09 at 08:03
  • Oh, right, never mind then :D – Lee B Nov 01 '09 at 12:28