redhat-list-ye_olde_not_enough_space_in_var_for_the_database_problem

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



To: redhat-list@listman.redhat.com
From: "Billy" <rhlist@kadesh.org>
Subject: Making Partitions Bigger? 
Date: Tue, 18 Mar 2003 11:42:15 -0500

System is running RedHat 7.3. Below is the structure of my partitions
currently.

[root@linuxweb root]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6             372M   78M  275M  22% /
/dev/sda1              45M  8.8M   34M  21% /boot
/dev/sda5              20G  857M   18G   5% /home
none                  251M     0  251M   0% /dev/shm
/dev/sda2              45G  854M   41G   2% /usr
/dev/sda7             251M  191M   46M  81% /var

Unfortunately during the install I let the installer automatically partition
for me. This machine is a web server with Apache 1.3.27 and MySQL 3.23.54.
Currently all the web files reside in /home/www/ which has plenty of room.
However the MySQL data is on /var which is quickly running out of space. Is
there a way that I can take space for the /usr partition and use it on /var?
Or would it be easier (or my only option) to configure MySQL to store data
on the /usr partition? Any help would be greatly appreciated!


===

To: redhat-list@listman.redhat.com
From: Mark Lundy <mark@newsummitmedia.com>
Subject: Re: Making Partitions Bigger?
Date: Tue, 18 Mar 2003 10:55:33 -0600

Nothing wrong with a link.
Shut down mysql service - service mysqld stop

mkdir /home/mysql/db
find /var/lib/mysql -print | cpio -dumcv /home/mysql/db
mv /var/lib/mysql /var/lib/mysql.ORIG
ln -s /home/mysql/db /var/lib/mysql

restart mysql - service mysqld start


===

To: redhat-list@listman.redhat.com
From: "Billy" <rhlist@kadesh.org>
Subject: RE: Making Partitions Bigger?
Date: Tue, 18 Mar 2003 14:39:18 -0500

When I run "find /var/lib/mysql -print | cpio -dumcv /home/mysql/db" it just
displays the cpio usage list?


===

To: redhat-list@listman.redhat.com
From: James Francis <jfrancis@techrx.com>
Subject: RE: Making Partitions Bigger?
Date: Tue, 18 Mar 2003 14:53:23 -0500


GNU parted can resize the partitions and the filesystem with
no problems and is pretty safe.  Do a man parted to see all
the options.


===

To: redhat-list@listman.redhat.com
From: Chris Sherlock <csherlock@optusnet.com.au>
Subject: Re: Making Partitions Bigger?
Date: 19 Mar 2003 19:10:56 +1100

I'm suprised no-one has suggested using parted. The best way I've found
for using parted is run linux in single user mode, unmount the /var
filesystem and from the command-line run parted.

[root@localhost root]# init 1
.
.
.

[root@localhost root]# umount /var
[root@localhost root]# parted
GNU Parted 1.4.24
Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
Inc.
This program is free software, covered by the GNU General Public
License.
 
This program is distributed in the hope that it will be useful, but
WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more
details.
 
Using /dev/hda
Information: The operating system thinks the geometry on /dev/hda is
9729/255/63.  Therefore, cylinder 1024 ends at 8032.499M.
(parted) print
Disk geometry for /dev/hda: 0.000-76319.085 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031   1200.168  primary   ext3        boot
2       1200.168  51199.343  primary   ext3
3      51199.343  61200.747  primary   ext3
4      61200.747  76316.594  extended              lba
5      61200.778  63248.093  logical   FAT         lba
7      63248.124  70001.982  logical   ext3
6      75798.905  76316.594  logical   linux-swap

(parted)

Just find out how to use the resize command, should be fine! Oh, you'll
need to know which is your /var partition. 

Simple... if you aren't sure about parted, the info file for parted is
*really* good, with lots of examples and everything. If you don't have
this, try www.gnu.org and look at their manuals section. Should be
there. 

===

To: redhat-list@listman.redhat.com
From: bollu@awtce.be
Subject: Re: Making Partitions Bigger?
Date: Wed, 19 Mar 2003 09:19:10 +0100


    I'm suprised no-one has suggested using parted. The best way I've found
    for using parted is run linux in single user mode, unmount the /var
    filesystem and from the command-line run parted.

GNU Parted is a very  nice tool but I don't remember it's possible to
decrease partition size. With the information coming from Billy (df -h)
it's not possible to tell wether he's still free space on his drive(s) or
not.
If he's no more space, then he would have to decrease size.


===

To: redhat-list@listman.redhat.com
From: "Cannon, Andrew" <Andrew.Cannon@nnc.co.uk>
Subject: RE: Making Partitions Bigger?
Date: Wed, 19 Mar 2003 08:24:41 -0000

Does that apply to LVM partitions too?

===

To: redhat-list@listman.redhat.com
From: bollu@awtce.be
Subject: RE: Making Partitions Bigger?
Date: Wed, 19 Mar 2003 09:57:35 +0100


>From http://tldp.org/HOWTO/LVM-HOWTO/upgraderoottolvm.html:

"Parted doesn't understand LVM partitions [so this has to be done using
fdisk]"

How, by the way, it seems that parted can shrink partitions
(http://www.gnu.org/software/parted/). However I seem to remember having
some troubles to do that.


===

To: redhat-list@listman.redhat.com
From: Chris Sherlock <csherlock@optusnet.com.au>
Subject: Re: Making Partitions Bigger?
Date: 19 Mar 2003 22:25:39 +1100

Which is why he should do the print in parted. He may be able to get
assistance with the resizing on this list. 

The info docs have very good examples on what to do if you have
hard-drive space but it's scattered around the drive. 

Incidently, I've found that some older versions of parted don't work
with ext3... to get around this resize as ext2 and then rune tune2fs -j
/dev/hd[a-z]

One more thing... be careful with /var... I managed to delete my rpm
database. I know of a way of getting it back and I'm in the procedes of
writing a perl script, but this is a pain in the neck :) 

(or you could see this as an interesting process in seeing just well you
you've made a mistake in with Linux... I'd like to see someone restore
the Windows registry if they corrupt it! A friend once told me that to
become proficient with Linux - Guru status - you really need to make
sure you never reinstall it. Just fix your mistakes and move on!)


===

To: redhat-list@listman.redhat.com
From: James Francis <jfrancis@techrx.com>
Subject: RE: Making Partitions Bigger?
Date: Wed, 19 Mar 2003 10:48:08 -0500

Cannon, Andrew wrote:
> Does that apply to LVM partitions too?
For LVM, use e2fsadm.  Do a man on e2fsadm.  It will work flawlessly.  If
you are using ext3 partitions, I would change them to ext2 first.
1.  Umount the partition.
2.  Remove the journal, tune2fs -O^has_journal /dev/<Volume>/<Logical
Volume>
3.  Use e2fsadm
4.  Add the journal back, tune2fs -Ohas_journal /dev/<Volume>/<Logical
Volume>
5.  Mount the partition
<Volume> is your volume group
<Logical Volume> is your logical volume

The reason for removing the journal is that e2fsadm only works with ext2
filesystems
and the journal is created appropriately for the size of the filesystem.

FYI, LVM also makes it easy to move partitions from 1 disk to another.  man
pvmove.


===

To: redhat-list@listman.redhat.com
From: James Francis <jfrancis@techrx.com>
Subject: RE: Making Partitions Bigger?
Date: Wed, 19 Mar 2003 10:49:16 -0500

bollu@awtce.be wrote:
>     I'm suprised no-one has suggested using parted. The best way I've
>     found for using parted is run linux in single user mode, unmount
>     the /var filesystem and from the command-line run parted.
> 
> GNU Parted is a very  nice tool but I don't remember it's possible to
> decrease partition size. With the information coming from Billy (df
> -h) it's not possible to tell wether he's still free space on his
> drive(s) or not.
> If he's no more space, then he would have to decrease size.

Sure you can decrease partition size with parted.  It also
will resize the filesystem.

Just make sure you are in single user mode.


===

To: redhat-list@listman.redhat.com
From: James Francis <jfrancis@techrx.com>
Subject: RE: Making Partitions Bigger?
Date: Wed, 19 Mar 2003 11:01:53 -0500

James Francis wrote:
> Cannon, Andrew wrote:
>> Does that apply to LVM partitions too?
> For LVM, use e2fsadm.  Do a man on e2fsadm.  It will work flawlessly.
> If you are using ext3 partitions, I would change them to ext2 first.
> 1.  Umount the partition.
> 2.  Remove the journal, tune2fs -O^has_journal /dev/<Volume>/<Logical
Volume> 
> 3.  Use e2fsadm
> 4.  Add the journal back, tune2fs -Ohas_journal /dev/<Volume>/<Logical
Volume>

One correction, I would use tune2fs -j /dev/<Volume>/<Logical Volume>.
Does the same thing, but with less typing.


===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu