Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

multiple partition on linux machine

Posted on 2003-11-08
11
Medium Priority
?
542 Views
Last Modified: 2010-04-21
Hi

I wana know a why that for e.g. i have two HD on my machine .. and running apache server.. now my first HD is filled up so i am planning to use the other one. problem which i am facing is how to make the webserver think that it's one big HD , or would i be needing to create a link in pages or data which reside on one HD and not on the default one in apache conf.. i hope you guys have understood my question.. please help me out.. i am confused.. Thanks in advance
0
Comment
Question by:lomaree
11 Comments
 
LVL 1

Author Comment

by:lomaree
ID: 9706368
know a way and not know a why . sorry
0
 
LVL 5

Expert Comment

by:arjanh
ID: 9706379
If you have a particular subdirectory under your htdocs directory that is getting big, you can put that directory on the new disk, and leave the other directories on the original disk:

mount /dev/<newdisk> /mnt
mv <path to>/htdocs/bigdir/* /mnt
umount /mnt
mount /dev/<newdisk> <path to>/htdocs/bigdir

Then change your /etc/fstab file to remount the new disk on reboot
0
 
LVL 1

Author Comment

by:lomaree
ID: 9706411
no you see.. this HD is of 120GB and it's full now with tons of data in it.. now i have bought a another 120 GB and installed it in .. problem is how do i tell the apache that if a user is browsing or downloading a file and it resides on the new HD ? , so again the question is how will the apache know about that.. cuz it's not under the htdocs directory rite..
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 5

Expert Comment

by:arjanh
ID: 9706429
well you have to mount the new disk SOMEWHERE... If above isn't good for you, then you can mount the disk anywhere else and make a link:
mkdir <path to>/htdocs/new/
ln -s <new mountpoint> <path to>/htdocs/new/

And then in your links to files and documents that reside on the new disk, you have to prepend 'new/' to each URL. Like '<IMG SRC="new/subdir/my_image.png">'.
But I think this is less beautiful than my first solution
0
 
LVL 1

Author Comment

by:lomaree
ID: 9706463
what does this <pathto> means "mkdir <path to>/htdocs/new/" . meaning anywhere on the new HD rite..

what i wana know is there a way for to tell apache that there is another place to look for if a request is coming .. like aliases sort of thing.. or someway else .. cuz either of your solutions are good but then it's really difficult to change all the links manually you see or moving the entire content to the new one won't result in a solution cuz then again soon the new one will be filled as well. rite ..
0
 
LVL 5

Expert Comment

by:arjanh
ID: 9706499
<path to> is the current path to your htdocs/ dir, so on the old disk.
Apache cannot look for a file in multiple directories. It is either in directory A or in B. The URL has to specify where Apache has to look for the file.

You CAN however look into LVM - Logical Volume Manager. It allows for multiple hard disks to act as a single one. Then you wouldn't have to modify any URLs. See http://tldp.org/HOWTO/LVM-HOWTO/
0
 
LVL 1

Author Comment

by:lomaree
ID: 9709702
there has to be a way by which i can do this.. come on
0
 
LVL 5

Expert Comment

by:arjanh
ID: 9709714
What do you mean? I gave 3 different solutions that all will work:
1. Mount the new disk somewhere in the existing htdocs tree
2. Change some of the links to point to a special directory where the new disk is mounted
3. Use LVM to put the two physical volumes into a single volume group and then create one big logical volume that now is 240GB. LVM can do what you want, but you have to dig into it to get it working.

Again, Apache _cannot_ look for a single file in multiple directories.
0
 
LVL 12

Expert Comment

by:paullamhkg
ID: 9713118
I think the suggestions of arjanh might be the solutions for you.

or you can try using RAID 0 as a solution but will have lots of work to do, backup, repartition, joint 2 partitions into raid 0, if you thinking of using this post a request here I can write you the procedure. but have a look this http://www.tldp.org/HOWTO/Software-RAID-HOWTO.html to understand more about software raid.

re partition your harddisk will be another mehtod, which you can make room/increase of some of your partitions without format your 1 harddisk. have a look this free tools http://www.europe.redhat.com/documentation/HOWTO/PLIP-Install-HOWTO-11.php3 which can increae the partition(s) size.
move your /home, /var, etc... into your 2nd harddisk, and in your /etc/fstab, change the default partiton to the new one to make room for your web data directory, eg.

in your /etc/fstab

LABEL=/home           /home                ext3    defaults        1 2
LABEL=/opt              /opt                    ext3    defaults        1 2
LABEL=/tmp             /tmp                   ext3    defaults        1 2
LABEL=/usr              /usr                    ext3    defaults        1 2
LABEL=/var              /var                    ext3    defaults        1 2

or

/dev/hda5              /home                ext3    defaults        1 2
/dev/hda6              /opt                    ext3    defaults        1 2
/dev/hda7              /tmp                   ext3    defaults        1 2
/dev/hda9              /var                    ext3    defaults        1 2

change to

/dev/hdb1              /home                ext3    defaults        1 2
/dev/hdb2              /opt                    ext3    defaults        1 2
/dev/hdb3              /tmp                   ext3    defaults        1 2
/dev/hdb5              /var                    ext3    defaults        1 2

now your /home, /opt, /tmp, and /var moved to 2nd harddisk, and have lots of room in harddisk 1, use the tools above to resize your web data partition will help.

and arjanh right, Apache can't look for single file in multiple directory

0
 
LVL 1

Expert Comment

by:ajenkins
ID: 9717439
Man these guys are all on crack.  
Alias <virtualdirectory> <real directory>
eg
Alias /finance /home/adam/website/finance

Users will then be able to see say /home/adam/website/finance/april.html as
http://website.adam.com/april.html

You may also need to check out permissions etc, but unless you are looking to do some crazy
performance hacks or whatever, disk slices/partitions are a red herring here.
0
 
LVL 5

Accepted Solution

by:
arjanh earned 250 total points
ID: 9717555
Original poster already said he didn't want to have to rewrite his URLs for a specific subdirectory. Your solution effectively is the same as my first and second solution.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question