Re: What am I doing wrong with MOUNT?
On Wed, Mar 02, 2005 at 01:42:40AM -0800, Gerald Lightsey wrote: > Nathan Kinkade said... > > Here is quick rundown on how you could achieve your goal: > > > > 1) Mount the new disk at at /mnt with something like: > > # mount /dev/ad1s1a /mnt > > 2) Copy everything from your original /var partition to the new one: > > # cd /var && tar cf - ./ | (cd /mnt && tar xvpf -) > > 3) Edit /etc/fstab from something like: > > /dev/ad0s1e /varufs defaults > 1 2 > > to: > > /dev/ad1s1a /varufs defaults > 1 2 > > 4) Unmount old partition from /var and mount new one at /var: > > # umount /var && mount /var > > > > Also, you may want to reallocate the partition formerly mounted at /var > for something else? > > Your advice was right on thank you very much. Actually step #4 was > automatically handled by step #3. > > Regarding reallocation of space formerly occupied by /var on /dev/ad0s2d, is > there a way to reallocate it back to one of the other existing partitions or > do you mean only to use it as is for something else? > > Gerald I was actually suggesting that you could just mount the old partition at another mount point, but I suppose there is the possibility to have the old partition swallowed up by the one directly proceeding it on the physical disk. I have never done it and I don't know anything about it, but there is a utility called growfs(8) that might be of use. Nathan pgphiNyXMaNhM.pgp Description: PGP signature
RE: What am I doing wrong with MOUNT?
Nathan Kinkade said... > Here is quick rundown on how you could achieve your goal: > > 1) Mount the new disk at at /mnt with something like: > # mount /dev/ad1s1a /mnt > 2) Copy everything from your original /var partition to the new one: > # cd /var && tar cf - ./ | (cd /mnt && tar xvpf -) > 3) Edit /etc/fstab from something like: > /dev/ad0s1e /varufs defaults 1 2 > to: > /dev/ad1s1a /varufs defaults 1 2 > 4) Unmount old partition from /var and mount new one at /var: > # umount /var && mount /var > > Also, you may want to reallocate the partition formerly mounted at /var for something else? Your advice was right on thank you very much. Actually step #4 was automatically handled by step #3. Regarding reallocation of space formerly occupied by /var on /dev/ad0s2d, is there a way to reallocate it back to one of the other existing partitions or do you mean only to use it as is for something else? Gerald ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: What am I doing wrong with MOUNT?
On Mon, Feb 28, 2005 at 09:15:23AM -0800, Gerald Lightsey wrote: > 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? What are the outputs of the commands ``mount'' and ``df -h''? Are you sure that you are first unmounting the partition on disk 0 that is mounted at /var before you mount the new disk (1) at /var? Did you reboot at any point? Keep in mind that you will need to alter the file /etc/fstab to let the system know that it now needs to be mounting the single slice from the new disk at /var. Here is quick rundown on how you could achieve your goal: 1) Mount the new disk at at /mnt with something like: # mount /dev/ad1s1a /mnt 2) Copy everything from your original /var partition to the new one: # cd /var && tar cf - ./ | (cd /mnt && tar xvpf -) 3) Edit /etc/fstab from something like: /dev/ad0s1e /varufs defaults 1 2 to: /dev/ad1s1a /varufs defaults 1 2 4) Unmount old partition from /var and mount new one at /var: # umount /var && mount /var There may be an error or two in this, but it should serve to give the general idea. Also, you may want to reallocate the partition formerly mounted at /var for something else? Nathan pgpmwK9QVusPc.pgp Description: PGP signature
Re: What am I doing wrong with MOUNT?
On Mon, Feb 28, 2005 at 09:15:23AM -0800, Gerald Lightsey wrote: > 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? Just a thought - each time you mounted the new disk at /var, the system was already running in multi-user mode. That means that all network daemons etc have been started and are running /before/ you mount the disk. MySQL will continue to use the /original/ /var because it has open filehandles on that fs. Try stopping MySQL before mounting the new disk. Start MySQL again, and it should start up on the new fs. Dan -- Daniel Bye PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc PGP Key fingerprint: 3B9D 8BBB EB03 BA83 5DB4 3B88 86FC F03A 90A1 BE8F _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ pgp4TuZRVGX1V.pgp Description: PGP signature