What am I doing wrong with MOUNT?

Gerald Lightsey glightsey1 at cox.net
Mon Feb 28 17:15:33 GMT 2005

Posted last night to newbies -(my mistake)

I'm brand new to FreeBSD and Unix world in general.  My son has an internet
site supported by FreeBSD that uses MySQL.  I have set up a FreeBSD  version
5.3 system on my home network using an 80gb drive sliced and partitioned to
the FreeBSD 5.3 defaults.  I installed MySQL version 3.23 from the ports
because that is the version on my son's server.  I wanted to install a copy
of his database that I had MySQL dump on his FreeBSD server and FTP'd it to
my Windows PC and placed on a CD.  After directing the .SQL dump back to a
like named database on my newly installed box I originally received a
message that I was out of disk space.

I find that MySql is working in /var/db/mysql and that the default
installation slice/partition of FreeBSD must be too small to handle the
databases I want to play with.  So I read up on the file system and thought
I understood that one can graft another drive onto a mount point on the
system to add space at the mount point.  I purchased a 120gb drive for under
$50 after rebates and partitioned it into one FreeBSD partition, (not
dangerously dedicated).  I expected, from what I read, that if I mounted it
at the /var mount point everything in the original /var directory would
become unreachable/invisible.  I tried it and I got the results I expected.
The reason I thought I would replace the ENTIRE /var directory was because
if /var is too small for MySQL it would probably quickly be exposed to be
too small for something else unexpected.  

I mounted the new drive 1 to a temporary mount point and used the cp command
to copy each directory in /var to the drive.  I looked in all the new/old
directories at the temporary mount point using ls -F and everything appeared
to be there at the file level.  I used the umount command to unmount the new
drive/partition from the temporary mount point and remounted it at /var.  I
opened MySQL and created the named database I wanted and again started to
collect the data from the CD by directing the .SQL file data to my database.
Again, just like it did originally, after several minutes of creating tables
the system reported that it had run out of space.

My surprise is that every indication I get after I regain control of the
system is that the database tables are being built within the ORIGINAL /var
directory structure rather than the 120gb drive mounted on the /var
mountpoint.  If I use the df command while drive 1 is mounted it shows that
/var on disk 0 is full and /var on disk 1 just has whatever I copied onto
the drive when it was mounted to a temporary mount point.  Also by
experimentation/confirmation  I find that simply creating a couple of new
databases within MySQL while drive 1 is mounted on /var shows that the
databases have been created on the original /var on disk 0 as directories
after disk 1 is unmounted. 

What am I doing wrong or what don't I understand about a drive being mounted
on /var where data is being written underneath it to the original
/var/db/mysql/mydatabasename on disk 0 rather than onto the mounted disk 1?



More information about the freebsd-questions mailing list