Increase disk space without erasing data
Hi,
I have installed lamp on my rhel4 machine.During installation of mysql the default directory that was selected is /var. Now after when i set up my database with all tables, there is no space left in /var and mysql is crashing every time as the /var has little free space. Allocated Used Available Use% /dev/hda8 381138 354023 7437 98% /var How can i increase the disk space by adding free space from other drives without erasing /var as it consists of several system files. Thanks for the Help Stranger |
the only program i know of to resize a partition without loosing data is PartitionMagic. its a commercial program and cost a bit of cash.
edit: if the partition is resierfs, it looks like you may be in luck: http://qtparted.sourceforge.net/features.en.html |
qtparted or parted can resize partitions. Post the output of the command
fdisk -l (must be root, that is a small L) |
A word to the wise: backup before resizing!
|
I'll second matthew on this one..
Even though those applications are supposed to be able to resize partitions on the fly there is always a chance it will just not work and the data will be lost.. Alternately since your issue is simply one of space on var due to a database issue.. if You have unpartitioned space on the drive you could always add a new partition and ultimately mount it as /var/lib/mysql and move your mysql data to the new partition.. Nothing says you actually HAVE to resize the entire var partition. there are other solutions that will accomplish your main goal and may be an easier solution in the long run. This is one of the reasons I love the way Linux handles partitions and mount points.. so much better than Drive letters :) example moving /var/lib/mysql to a new drive entirely.. Code:
default@IBM-300GL-1:~$ mount http://www-128.ibm.com/developerwork...UnixFileSystem |
This looks like a good reason to NOT have a lot of different partitions. As a relative newcomer, I have always been puzzled at the rationale for having more than maybe 3 partitions (/, /boot, and /home) + swap.
It seems that you have to be pretty experienced to know which partitions will need how much space..... |
Quote:
Agreed.. I think that was the most confusing part of the initial Linux setup.. what partitions do I need and how much space for each.. And who knew that Apache and Mysql both store their data under var ? I would have never guessed that starting out. after you get a grip though and discover you can expand any directory by mounting a new partition to that point, makes it easy to relocate Home, usr or var when they get out of control.. Now that I think back I wonder how long it actually was between the time I was doing my initial installs and was totally confused on partitioning and when I discovered how to manage multiple mount points and partitions.. hrm. good point. |
Strictly speaking, you don't need to repartition to solve this problem. If you have room on your root partition, you can make a few dirs on, say, /usr/local, copy those dirs over, and link to them from /var ...
Ideal? No. Sloppy? Probably. But it should work. I've always linked htdocs out of /var to share it between distros, which is a similar thing. |
Quote:
Quote:
|
All times are GMT -5. The time now is 12:18 AM. |