Solved

multiple partition on linux machine

Posted on 2003-11-08
11
475 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now