LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-01-2006, 01:33 AM   #1
stranger_6_7
LQ Newbie
 
Registered: Nov 2006
Posts: 24

Rep: Reputation: 15
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
 
Old 12-01-2006, 01:38 AM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 58
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

Last edited by nadroj; 12-01-2006 at 01:41 AM.
 
Old 12-01-2006, 07:04 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,853

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
qtparted or parted can resize partitions. Post the output of the command
fdisk -l (must be root, that is a small L)
 
Old 12-01-2006, 07:26 AM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
A word to the wise: backup before resizing!
 
Old 12-01-2006, 11:17 AM   #5
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
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
/dev/hda1 on / type ext3 (rw,errors=remount-ro)
/dev/hda3 on /home type ext3 (rw)
/dev/hdb1/ on /var/lib/mysql type ext3 (rw)
IBM has a nice moving data and partitions on their site for Unix.. it's pretty similar.
http://www-128.ibm.com/developerwork...UnixFileSystem

Last edited by farslayer; 12-01-2006 at 02:33 PM.
 
Old 12-01-2006, 12:48 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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.....
 
Old 12-01-2006, 02:32 PM   #7
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Quote:
Originally Posted by pixellany
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.....

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.
 
Old 12-01-2006, 03:05 PM   #8
eerok
Member
 
Registered: Nov 2005
Location: Canada
Distribution: Debian
Posts: 167

Rep: Reputation: 32
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.
 
Old 12-01-2006, 04:21 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,206

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Quote:
Originally Posted by pixellany
This looks like a good reason to NOT have a lot of different partitions.
Maybe, maybe not.
Quote:
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.....
Excellent argument for LVM - and not completely allocating the entire disk(s). I'd be surprised if el4 doesn't use LVM by default.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i increase hard disk space cyrilbritto Linux - Hardware 5 08-26-2011 07:15 AM
how to increase the hard disk space of linux? hari78 Linux - Newbie 5 03-01-2005 05:09 AM
Space Increase webterractive Linux - Software 2 12-22-2004 09:42 AM
3Gb of disk space lost! Disk space problem or mother board conflicts with HDD Mistreated Linux - Hardware 4 12-06-2004 03:58 PM
Increase hard-disk / space in FreeB noir911 *BSD 0 05-01-2004 09:57 PM


All times are GMT -5. The time now is 09:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration