You are not logged in.

#1 2009-05-06 00:31:31

tazboy78
Member
Registered: 2009-03-30
Posts: 4

Partition mounting: home and srv same partition?

Currently sda1 is mounted to root. Besides the swap my only other partition is sda2, and is mounted to /home.

The primary use for this machine is a server. It is the samba file server for the network, and is hosting a few websites with apache. As such /srv has been growing. The sda2 partition is three times bigger than sda1. I want both /srv and /home to be on the larger partition to have plenty of room to grow. Is there any way to put both /home and /srv on sda2? How would the fstab look for that?

Matthew
Brampton ON

Offline

#2 2009-05-06 02:43:53

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: Partition mounting: home and srv same partition?

First you have to move 'srv' from its present position

mv /srv /home; mkdir /srv; chmod a+rwx /srv

Then I would suggest that you use /etc/rc.local to 'bind' the /home/srv directory

mount --bind /home/srv /srv

Offline

#3 2009-05-06 03:02:40

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: Partition mounting: home and srv same partition?

Or just symlink it

mv /srv /home/
ln -s /home/srv /srv

You could also create a disk image in home and mount that as srv, although this wouldn't be very efficient as far as performance goes

dd if=/dev/zero of=/home/srv.img bs=102400 count=<size of srv you want in mb>
mkfs -t <filesystem type> /home/srv.img
mount -o loop /home/srv.img /mnt/new-srv
mkdir /mnt/new-srv/
mv /srv/* /mnt/new-srv/
umount /mnt/new-srv
umount /srv
mount /home/srv.img /srv

It goes a little something like that

Offline

Board footer

Powered by FluxBB