Solved

multiple partition on linux machine

Posted on 2003-11-08
11
529 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
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 125 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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

628 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