mount partition to a folder within file system?

mount partition to a folder within file system?

Post by Joe Nelso » Tue, 13 Feb 2001 11:40:31



Is it possible to add a single partition hard-drive to my system, then mount
that partition somewhere deep in the filesystem? For example, I'd like to
add a whole drive that holds nothing but the multimedia content of my
website, but I'd like to mount it's partition under my webserver's root.  If
I can do this, can someone point me to an article or something to show me
how?

Here's my system stats: RedHat 7.0 on an AMD Duron 650 with 128 megs of RAM,
Apache for the webserver.

If you're curious, check out what I've got at www.nitewaryr.com :-)

Thanks!

 
 
 

mount partition to a folder within file system?

Post by Jim Cochra » Tue, 13 Feb 2001 14:28:47


If I understand what you are asking, it's pretty simple.  I just tried the
following as a test, and it worked fine:

$ su
Password:
$ ls /home1
lost+found
$ df /home1
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/hda7               499620        13    473804   0% /home1
$ umount /home1
$ mkdir -p /usr/local/lib/x/y/z
$ mount /dev/hda7 /usr/local/lib/x/y/z
$ ls /usr/local/lib/x/y/z/
lost+found
$ df /usr/local/lib/x/y/z/
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/hda7               499620        13    473804   0%
/usr/local/lib/x/y/z

So, for example, if your new hard drive/partition is /dev/hdc1, simply
replace /dev/hda7 above with /dev/hdc1 and /usr/local/... with the
directory you want to mount.  Of course, you'll first need to make a
filesystem on /dev/hdc1.  man mkfs should tell you how to do that.

Edit /etc/fstab to mount the new filesystem on bootup.

Is this what you are asking?

[By the way, assuming I understood your question correctly, it would
probably fit better in a linux sys admin group rather than c.o.l.h.]



>Is it possible to add a single partition hard-drive to my system, then mount
>that partition somewhere deep in the filesystem? For example, I'd like to
>add a whole drive that holds nothing but the multimedia content of my
>website, but I'd like to mount it's partition under my webserver's root.  If
>I can do this, can someone point me to an article or something to show me
>how?

>Here's my system stats: RedHat 7.0 on an AMD Duron 650 with 128 megs of RAM,
>Apache for the webserver.

>If you're curious, check out what I've got at www.nitewaryr.com :-)

>Thanks!

--
Jim Cochrane


 
 
 

mount partition to a folder within file system?

Post by John-Paul Stewar » Wed, 14 Feb 2001 03:39:57



> Is it possible to add a single partition hard-drive to my system, then mount
> that partition somewhere deep in the filesystem? For example, I'd like to
> add a whole drive that holds nothing but the multimedia content of my
> website, but I'd like to mount it's partition under my webserver's root.  If
> I can do this, can someone point me to an article or something to show me
> how?

> Here's my system stats: RedHat 7.0 on an AMD Duron 650 with 128 megs of RAM,
> Apache for the webserver.

> If you're curious, check out what I've got at www.nitewaryr.com :-)

> Thanks!

Just to clarify my understanding of your question:  You want
to mount a partition someplace other than a directory within
/.  I.e.  you know you could mount it as, say, /new-hd, but
you're more interested in mounting in
/home/me/stuff/multimedia.  That's my understanding of your
question.

The answer to it is yes.  Man mount for full details.  Man
fstab for instructions on making it happen at every boot.
My fstab mounts one partition as /usr then another as
/usr/local and a third as /usr/src.  Remember, we're not in
DOS--partitions can go any place you like.

HTH, and if I can be of further assistance, post or e-mail.

J-P Stewart