LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 05-17-2017, 11:12 AM   #1
dj_thrive
LQ Newbie
 
Registered: Dec 2016
Location: Huntvsille, AL
Distribution: RedHat 6
Posts: 27

Rep: Reputation: Disabled
Need to increase the size of a partition


Greetings,

I have a lot of log files being written to /var/log, and unfortunately the previous admin only allotted 3.9 GBs for sda2 (where /var/log is). I'm nervous about increasing the size of this partition. Is there a preferred and easy method for giving sda2 more space, or redirecting the data to another directory on another partition?

Thanks for your time.

Nate
 
Old 05-17-2017, 12:15 PM   #2
bradvan
Member
 
Registered: Mar 2009
Posts: 311

Rep: Reputation: 59
Is /var/log truly a separate file system, or part of a larger one? If the partition was created with lvm, then you can expand it easily (given free space). You can google how to do that. Lot's of pages for that. If not, you might have to create a new partition, mount it to a temporary location, copy everything from /var/log there, then unmount both and mount the new partition to /var/log.

In the short term, if you are desperate for space and have more available elsewhere, edit /etc/rsyslog.conf and just change the location of the log files.
 
Old 05-17-2017, 12:55 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 current / Linux Mint / Debian / Void Linux
Posts: 8,126

Rep: Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675
to add to what that other said. you maybe able to if you can just add another hdd and make that entire thing your /var/log directory. giving you probably more room than you need to keep files.

it eventually turns into ones garage where one just puts everything in it and it just keeps piling up to where you have no understating why you're even keeping over half of the stuff you have in it.
 
Old 05-17-2017, 01:09 PM   #4
dj_thrive
LQ Newbie
 
Registered: Dec 2016
Location: Huntvsille, AL
Distribution: RedHat 6
Posts: 27

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bradvan View Post
Is /var/log truly a separate file system, or part of a larger one? If the partition was created with lvm, then you can expand it easily (given free space). You can google how to do that. Lot's of pages for that. If not, you might have to create a new partition, mount it to a temporary location, copy everything from /var/log there, then unmount both and mount the new partition to /var/log.

In the short term, if you are desperate for space and have more available elsewhere, edit /etc/rsyslog.conf and just change the location of the log files.

That's for the above response. I'm unsure, I just recently inherited this mess from the previous sysadmin. Is there a way to check and see if it truly is a separate filesystem? When I do a
Code:
df -h
it shows me that it is on
Code:
/dev/sda2
 
Old 05-17-2017, 01:30 PM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 current / Linux Mint / Debian / Void Linux
Posts: 8,126

Rep: Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675Reputation: 1675
fstab should shed some light on it. if it is mounted as a separate partition

you mean something like
Code:
/dev/sda2 /var/log etc x x x x x
and nothing else mounted on fstab using /dev/sda2?
But then again it would have to be a completely dedicated device like
Code:
/dev/sdb1 /var/log
that sda2 indicates it may have an entire partition, but it too is sharing a hard drive. which you then would need to look into what partitions are on that hdd and see where you can move data or not on either side of it.

Last edited by BW-userx; 05-17-2017 at 01:34 PM.
 
Old 05-18-2017, 04:58 AM   #6
bradvan
Member
 
Registered: Mar 2009
Posts: 311

Rep: Reputation: 59
Run:
Code:
parted --script /dev/sda print
That will show you the partitioning of the sda disk. If you have a RAID controller onboard, sda could be a conglomerate of several disks. If not, it is probably a single drive.

You need to decide:
  1. Is there any more unused disk space available on this server?
  2. Do you really need more space for /var/log, or can you reduce the number of rotated logs kept?

If 2, then change the logrotate setup to keep fewer number of rotated logs.
 
Old 05-18-2017, 05:10 AM   #7
RadicalDreamer
Member
 
Registered: Jul 2016
Location: USA
Distribution: Slackware64-Current
Posts: 954

Rep: Reputation: 442Reputation: 442Reputation: 442Reputation: 442Reputation: 442
I've resized partitions successfully with gparted. Its pretty easy to use.
http://gparted.org/
 
  


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 to increase partition size? Uday123 Linux - Software 3 01-24-2010 07:28 PM
Increase / partition size Uday123 Linux - Software 1 09-30-2009 12:58 AM
Increase partition size bmstephan Linux - Newbie 3 01-08-2009 11:31 PM
tricky backup of Linux system to NTFS partition to increase partition size Pandarsson Linux - General 5 07-09-2008 02:35 PM
Increase Partition Size shane200_ Linux - Hardware 1 08-24-2006 12:06 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 03:02 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration