LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-06-2009, 02:11 PM   #1
nullp0inter
LQ Newbie
 
Registered: Aug 2009
Posts: 13

Rep: Reputation: 0
Partition Problem - running out of space!


Code:
[root@XXXX]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             9.9G  7.9G  1.5G  85% /
/dev/sda2             335G  5.6G  313G   2% /mnt
none                  874M     0  874M   0% /dev/shm
I am constantly trying to clear out files on /dev/sd1 to stop MySQL from running out of space. How can I tap into all that free space on /dev/sda2? I would love to split the partition up better i.e. give /dev/sda1 more free space.
 
Old 09-06-2009, 04:14 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
This is why you should use LVM on servers, IMHO.

However, my suggestion (assuming this is a live system) is to resize the sda2 partition (shrink it), and create a new one. Stop the MySQL server and copy everything (preserving permissions) from your MySQL directory (/var/lib/mysql mayhaps?) to the new partition. Temporarily move the old data in the MySQL directory to somewhere safe until you know the following step works: Mount the new partition as /var/lib/mysql or whatever your MySQL directory is. Start the server and hope for the best.

This is indeed a quick and ugly version, there are far more professional ways of duplicating a MySQL database but I am not very familiar with them.
 
Old 09-06-2009, 05:23 PM   #3
nullp0inter
LQ Newbie
 
Registered: Aug 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by hw-tph View Post
This is why you should use LVM on servers, IMHO.

However, my suggestion (assuming this is a live system) is to resize the sda2 partition (shrink it), and create a new one. Stop the MySQL server and copy everything (preserving permissions) from your MySQL directory (/var/lib/mysql mayhaps?) to the new partition. Temporarily move the old data in the MySQL directory to somewhere safe until you know the following step works: Mount the new partition as /var/lib/mysql or whatever your MySQL directory is. Start the server and hope for the best.

This is indeed a quick and ugly version, there are far more professional ways of duplicating a MySQL database but I am not very familiar with them.
would there be any way to add a portion of that large partition to my current /dev/sda1? also that was the part i need help on, the actual management of the partitions. ive never worked with partitioning manually on linux
 
Old 09-06-2009, 07:35 PM   #4
nullp0inter
LQ Newbie
 
Registered: Aug 2009
Posts: 13

Original Poster
Rep: Reputation: 0
ok so i just found out that i cannot have a root partition of more than 10GB(Amazon EC2).

how exactly would i go about using symlinks to point to the 300GB+ drive?
 
Old 09-06-2009, 09:12 PM   #5
windtalker10
Member
 
Registered: Nov 2007
Location: Kentucky
Distribution: Slackware13.1
Posts: 214

Rep: Reputation: 38
Just googled and read a bit and not sure you can symlink that way.
What I did see left a bit to be desired as it looked like it was planned by bean counters rather than folks who would actually use the system.
 
Old 09-07-2009, 06:52 AM   #6
ajlewis2
Member
 
Registered: Nov 2003
Distribution: Ubuntu
Posts: 218

Rep: Reputation: 46
What files are you needing to clear out of /dev/sda1? Are they in your home directory?

What do you have on /dev/sda2? My opinion is that /dev/sda2 should be split up. It could be that you should make a separate /home partition, but it all depends on what is eating up the room on /dev/sda1.
 
Old 09-08-2009, 10:28 AM   #7
ursusca
Member
 
Registered: Sep 2008
Location: Toronto, ON, Canada
Distribution: Gentoo, RHEL (Fedora, CentOS, OEL), Ubuntu, FreeBSD, Solaris 10
Posts: 170

Rep: Reputation: 34
Quote:
Originally Posted by nullp0inter View Post
ok so i just found out that i cannot have a root partition of more than 10GB(Amazon EC2).

how exactly would i go about using symlinks to point to the 300GB+ drive?
Hi,

My Oracle 10gR2 test base works fine with symlinks. I don't now about MySQL, but I think you have to make a backup of your base and try it.
 
Old 09-08-2009, 02:07 PM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Quote:
Originally Posted by nullp0inter View Post
Code:
[root@XXXX]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             9.9G  7.9G  1.5G  85% /
/dev/sda2             335G  5.6G  313G   2% /mnt
none                  874M     0  874M   0% /dev/shm
I am constantly trying to clear out files on /dev/sd1 to stop MySQL from running out of space. How can I tap into all that free space on /dev/sda2? I would love to split the partition up better i.e. give /dev/sda1 more free space.
I would make sure to have a backup of everything that you value on the machine before doing anything else. Backup!

I would not perform any maintenance on a Live machine. You may need to schedule downtime to do some regeneration. Seems like you need to do it real soon.

Once you have the machine then boot with the install media or a LiveCD. Shrink the partition on '/dev/sda2' with 'parted' or whatever but allow some space for the '/mnt' since for some reason someone allocated that space originally.

Once you have the partition shrunk to the desired size then you can use 'parted', cfdisk or even fdisk to create partitions for your use. Make sure that you allow for growth. Once you have created the new partition an prepared a filesystem on that partition, you can then copy or move contents to the new partition. Once this is done then you could mount the '/dev/sda?' on the mount point you desire/use. If you do 'cp' then be certain to preserve everything with the '-p' option. 'man cp' to see the details.

On most servers that I maintain, partitions are created in the manner to allow growth and prevention of floods so the system won't be taken down. Sometimes multiple hdd/subsystems are used to allow good partitioning schemes for both prevention for loss of space problems and other potential problems.

You are aware of other filesystem types?
 
  


Reply



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
Dual Boot Problem - WinXP partition lost space? brianr747 SUSE / openSUSE 1 09-26-2006 05:06 AM
Running out of space - resizing my existing Linux partition gljubuncic Linux - Software 7 07-01-2006 09:48 PM
How can I extend my partition which is running out of space bloretech Linux - Enterprise 1 09-21-2005 09:20 PM
running out of space on root partition timsch75 Linux - Newbie 5 03-23-2004 03:49 PM
Partitioning problem! Running low on space! brandog Linux - General 8 04-02-2003 08:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration