LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 02-13-2008, 09:12 AM   #1
LWillmann
Member
 
Registered: Oct 2003
Location: Middle Tennessee
Distribution: CentOS
Posts: 37

Rep: Reputation: 15
Upgrading hard disk in a RedHat 9 box?


I have a server that's running RedHat 9, and it's currently got a primary drive that's 40GB that's virtually full. I'm not sure how it got that way, because I didn't fill it with junk. The stuff that I've personally put there amounts to maybe 5 or 6 GB at best.

Anyway, I'm needing to upgrade the hard disk for now. I want to replace the 40GB drive with something larger, say a 320GB drive.

I have Partition Magic 8. It has the ability to copy partitions from one drive to another, and I *think* that it works with Linux partitions (will have to double check on that though.

My question is this: If I find that PM8 does work on Linux partitions, can I copy the partitions from the 40 to the 320, upsize the proper partition and then boot linux without any issues? Or is there something set in the OS that will goof up during boot if the size of the partition(s) change?

I need to keep this machine going until I can get another server running a newer OS up and running.

This lack of storage space crept up on me, I didn't realize there was a problem until the server became unresponsive one day, and I went to reboot it and it failed to start the X server.
 
Old 02-13-2008, 12:44 PM   #2
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
Yes, can recreate the partitions and use dd to dump the image onto the new drive. I can't recall, but you are not supposed to copy the entire partitions and/or directories. For example, you don't want to copy over the /proc because that is written to dynamically during bootup.

You can experiment as much as you want because if the 320GB doesn't boot up, just start over. Just don't mess up that current 40GB drive.

Regarding loss of storage space, it could be something in your /tmp or a huge log file in /var/log. Or it could be something else, but you can use the find command to search for big files.

Last edited by Micro420; 02-13-2008 at 12:46 PM.
 
Old 02-13-2008, 12:52 PM   #3
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 548

Rep: Reputation: 33
Micro420 is right on.
If you are only using 10% of the drive for your 'stuff' you must have a huge log file or mail file in the /var/mail or /var/log dirs. I suspect you should be able to get at least half of that 40gb back with minimal effort.
 
Old 02-13-2008, 09:18 PM   #4
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
This is also another good reason why you should create a fixed partition size for your /tmp and possible your /var/log. This way if something gets out of control, it will be self contained and you will immediately know where the culprit is. Or you can switch to Microsoft Windows Server 2003... I kid, I kid!
 
Old 02-13-2008, 10:49 PM   #5
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
This would be a great time to upgrade to a current distro. Get the new distro up and happy on the new drive but have the old drive ready for "have to" situations. Centos is RHEL with the logos removed. It is binary compatible with RHEL. The current version is 5.1 and is available for free download.
 
Old 02-13-2008, 11:31 PM   #6
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
Good point, lazlow. The original poster said he needs to keep his current Red Hat 9 box going until he can get a new server up and going. Might as well do it now, and do it properly!

As for CentOS, I really love it and it has become my favorite distro. Companies still do want professional support from the vendor so perhaps he should go with Red Hat 5.1
 
Old 02-14-2008, 12:05 AM   #7
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
I assumed Centos (or free) because he was running RH9. Support was dropped for RH9 in 2004(?).
 
Old 02-18-2008, 07:51 AM   #8
LWillmann
Member
 
Registered: Oct 2003
Location: Middle Tennessee
Distribution: CentOS
Posts: 37

Original Poster
Rep: Reputation: 15
Thanks for the replies folks, I really appreciate them.

Unfortunately, I can't upgrade this box right now.

I tried to upgrade the drives this weekend, and failed.

I did manage to find a bloated log file in /var/log so clearing that up bought me some space, but I still want to do this drive upgrade for peace of mind.

I also worry because the 40GB drive has been up and running for 6 years solid now, so I'd say that it's about due for a failure.

I tried several methods to get the 320GB drive running. First was to use Partition Magic (since it is supposed to support Linux partitions). It copied the /boot partition, the / partition, but at the end of the resize process for the / partition it reported an out of memory error, and stopped. So I had to scrap that process.

I then creates the partitions using fdisk, but being primarily a Windows guy, I found it somewhat cumbersome, but did finally manage to get it done. I also got the /boot partition set to Active and bootable.

I had forgotten what you guys had recommended to use to copy the image to the new drive, so I googled for 'linux hard disk upgrade' and found a Mini How-To on it, and worked my way through that. But that person recommended using the cp command to do it. Well, after waiting several hours for the files to copy, and then trying to install the Grub boot loader (that guy uses LILO) on the new drive, I tried to boot, and got this message:

GRUB Hard Disk Error

I never could get any further with it than that. No matter what I did, I could not get anything else out of the 320GB drive.

Should I try it again, recreating the partitions with fdisk and then run dd instead of cp?

What about the MBR and the boot loader, will those get copied as well using dd?

Last edited by LWillmann; 02-18-2008 at 07:53 AM.
 
  


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
Grafpup 2.00 - Problem adding user after Hard disk installation under Virtual Box isetyawan Grafpup 8 06-12-2007 05:58 AM
upgrading or booting from secondary hard disk trysten_x Linux - General 3 08-29-2005 10:12 PM
Mounting and using hard disk of remote box umeshbabu Linux - Newbie 1 08-15-2005 06:08 AM
white box linux install on new hard disk priyankadeven Linux - Newbie 1 08-18-2004 01:34 PM
Upgrading from Redhat 8.0 to 9.0 from hard drive koiphish Linux - General 5 07-05-2003 01:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 10:10 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