multiple partition on linux machine

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
LVL 1
lomareeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lomareeAuthor Commented:
know a way and not know a why . sorry
0
arjanhCommented:
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
lomareeAuthor Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

arjanhCommented:
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
lomareeAuthor Commented:
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
arjanhCommented:
<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
lomareeAuthor Commented:
there has to be a way by which i can do this.. come on
0
arjanhCommented:
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
paullamhkgCommented:
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
ajenkinsCommented:
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
arjanhCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.