Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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:
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.
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.
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:
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!
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.
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:
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
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.