0

I have a Oracle Enterprise Linux Server that is serving a website at /var/www/html/, there is a directory inside /var/www/html/ called "Attachments". This directory is growing very big (around 17GB atm) and the "/" partition is only 50GB.

The website reads and writes data from/to /var/www/html/Attachments/ , What i want is to move the files to /home/Attachment and maybe create a link on /var/www/html/Attachment to avoid filling / and using /home/ as storage. Is that possible ? will the PHP application be affected ? and if it is possible how can i achieve that ?

Below is the file system portioning:

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_oel-lv_root
                       50G   17G   33G  34% /
tmpfs                 7.9G  3.8G  4.1G  48% /dev/shm
/dev/sda1             485M   56M  404M  13% /boot
/dev/mapper/vg_oel-lv_home
                      835G   57G  745G   7% /home

Best regards

zertux
  • 151
  • 1
  • 13

1 Answers1

1

That is a perfectly normal quick-and-dirty sysadmin hack to get around a space crisis, and should work fine. In theory, there is a small performance penalty in that additional link lookup, but if the directory is busy the link will stay in cache anyway, so the penalty is nearly theoretical.

You will need to get the permissions right. Remember that the permissions on a logical link are ignored for nearly everything; it's the permissions on /home/Attachment that will count.

And in the longer run, book some downtime to rearrange space by shrinking the /home/ file system, allocating the extra space to / and growing the file system to use it; that's the beauty of LVM.

MadHatter
  • 78,442
  • 20
  • 178
  • 229
  • I think that can be done "live". Practice first! – Michael Hampton Jul 27 '13 at 08:21
  • I'm not sure the shrinking can, though I agree with you that everything else can; I did it earlier this week. But I may be out of touch about in-place shrinking of FSes. – MadHatter Jul 27 '13 at 08:22
  • I think shrinking would require the partition to be umounted, even if its LVM. – zertux Jul 27 '13 at 08:23
  • The man page suggests it depends on your kernel. But it isn't more specific. So... – Michael Hampton Jul 27 '13 at 08:29
  • Everything is working after creating the link,The PHP application is running fine (just needed to change ownership and permissions of the /home/Attachment folder as you suggested) Will schedule a downtime for resizing/shrinking. Thanks for the help! – zertux Jul 27 '13 at 08:56