LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 08-20-2007, 04:38 PM   #1
recneps_divad
LQ Newbie
 
Registered: Aug 2007
Posts: 12

Rep: Reputation: 0
I'm over my head - need a cookbook for transfering system to new disks


I'm hoping that somebody can help me by directing me to a step-by-step
cookbook of some sort for what I'm trying to do. Here's the summary:

We've got a Dell SC1425 1U server. The system has dual 300GB SATA drives
that I've configured in a software RAID 1. It's running CentOS 4.5 and
is pretty much up to date. We've also got Plesk installed on it and
it's purpose to exist is to host websites.

We recently got this idea to replace the 300GB drives with 500GB drives.
My programmer and I thought that the best way to accomplish this would
be to use Linux Ghost to copy the contents of the drives. So we pulled
one of the 300's and replaced it with the 500. Then we ghosted the 300
to the 500. Next we replaced the 300 with the other 500 and used ghost
again to copy the data on the first 500 to the second. We rebooted the
system and it worked! Well, almost.

The problem was that Linux Ghost did a fantastic job of duplicating
the exact dimensions of the 300 drives onto the 500. So we had a system
with partitions that were only 300GB in size. Obviously we wanted to
take advantage of all that extra space. And that's where things went
wrong.

We've tried a number of things from using Linux Ghost to expand the
partition to using fdisk and dd to redefine the partitions and then
copy the data from one of the 300's using an external USB 2.0 drive.
Nothing works. Where did we go wrong?

Your assistance is much appreciated,


-- Dave
 
Old 08-20-2007, 05:11 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,108

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
IMHO you would have been better using "cp -a .." (per partition), or rsynch - something like that. It would have used the target filesystem as it was defined rather than forcing the source filesystem definition on you.

Most (all ??) filesystems can be expanded o.k.- by default they will fill the parition, so no need to screw around trying to work out exact sizes. Each filesystem will have its own command.

Last edited by syg00; 08-20-2007 at 05:53 PM. Reason: Typo - also add last sentence.
 
Old 08-20-2007, 05:34 PM   #3
Michaelx
Member
 
Registered: Jun 2006
Distribution: Ubuntu 10.04
Posts: 40

Rep: Reputation: 15
Maybe the LiveCD of Gparted could help you to configure your partitions. ASPLinux is another word coming up here, as it allows to modify partitions with Data.
 
Old 08-20-2007, 06:54 PM   #4
recneps_divad
LQ Newbie
 
Registered: Aug 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Perhaps I didn't explain the severity...

Thanks for trying to help guys. When I said that I had a problem in my post, I meant that I now have an unbootable system. I should have also disclosed that although I have 30+ years of computer experience and am fairly clever, I'm still a Linux newbie and am a bit over my head. Not that I don't know about boot-blocks and all of that; it's just that I'm still learning this stuff. That's why I've decided to fall on my sword and hope that somebody can give me some link to a step-by-step resource on what to do in these situations.

Thanks again,

-- Dave
 
Old 08-20-2007, 09:41 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,108

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Quote:
Originally Posted by recneps_divad View Post
When I said that I had a problem in my post, I meant that I now have an unbootable system.
Mmmmm - that wasn't conveyed by
Quote:
We rebooted the system and it worked! Well, almost.
I read that as you were (merely) pissed off that you couldn't use the extra 200 Gig.
Presumably you still have the 300 Gig drives. Why not simply redo the operation from the start. You know that (sorta) works. Get that working again, and tell use what filesystem type, and somebody will (hopefully) tell you how to expand to fill the drive.
Most f/s will do it "on the fly" with the partition mounted. Else you can use a liveCD.
 
Old 08-20-2007, 10:24 PM   #6
recneps_divad
LQ Newbie
 
Registered: Aug 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Those pesky details

Sorry. My tendancy toward brevity did me in.

The system became unbootable when we tried one of the options in Linux Ghost to expand the partition. (The partition was ext3 though fdisk says it Software Raid which is really the same I believe.) That's what killed it. Since then I've tried various things to copy the data from the old disk. I suppose I should go back to the original copy operation as before. It took five hours so I've been reluctant to do it. Now I believe that I have no choice but to go back to at least that step.

-- Dave
 
Old 08-20-2007, 11:21 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,108

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Wouldn't it be easier to let the mirroring handle it ???.
Break the RAID set, remove the second drive, add a new bigger disk. When the synch has finished, break the RAID, take out the final 300-Gig and add the other big drive.

Sound too easy ???. Note I don't (never have) used software mirroring.
Just me musing into my (cuppa) tea.
 
Old 08-21-2007, 11:19 PM   #8
recneps_divad
LQ Newbie
 
Registered: Aug 2007
Posts: 12

Original Poster
Rep: Reputation: 0
It's getting better now...

Guys, I've really appreciated all the help you all have been trying to give me. I've actually got the server up and running again. Here's where it stands at the moment:

I pulled out one of the new 500GB drives and restored one of the old 300GB drives. I booted, the server found it and booted from it. I then used # mdadm --add to add the 500GB drive to the RAID 1 array. I waited for the sync to complete. Then I ran grub and did the setup, just to be sure, and then shut down.

Next I pulled the 300GB and put the 500GB back in. (I had previously initialized my 500GB drives with the partition sizes that I wanted. Something that I hadn't mentioned earlier is that I had a linux swap partition at the very end of the drive that I had to move back to the end. So I had properly sized partitions, just not bootable.

I booted my server and it found the cloned system on the "original" 500GB drive. I've now used mdadm --add to merge the other 500GB drive with the working one. Looks like I'm going to have a working system again.

Just one thing: the mdadm utility noticed that I had a partition on the 500GB drive that was larger than the booted partition on the 300GB system. So when it did the clone, it created a partition that's 300GB in size. The good news (if there is some) is that at least my swap partition is still at the end of my drive. So what I have now looks like this:

/dev/sdb1 1 36726 290985313+ fd Linux raid
/dev/sdb2 36227 60500 194980905 83 Linux
/dev/sdb3 60501 60801 2417782+ 82 Linux swap

So my challenge is to expand sdb1 to include the space found in sdb2. Ideas?


-- Dave
 
Old 08-22-2007, 12:26 AM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,108

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Simplest (and safest) answer:
- create a new RAID pair in the spare 200Gig on each disk. Then move your biggest/fastest growing data over there.

Less simple:
- break the pair, expand the partition and filesystem, rebuild the pair.
I presume this mirrors (er, sorry about that ) what you tried to do last time.
 
Old 08-22-2007, 12:54 AM   #10
recneps_divad
LQ Newbie
 
Registered: Aug 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Alex, I'll go for combining partitions for 200

Safe answer? Not a chance! Actually, for what I want to do with this system (host websites), having data split in different places does me no good. So, on with expanding the partition.

I like your suggestion about breaking the pair. That at least gives me some fall-back position if the partition games don't work. (Not that all is lost - I still have the original 300GB drives as the backup.)

So what utiities did you say I might try and use?

Thanks again for the guidance,


-- Dave
 
Old 08-22-2007, 07:20 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,108

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Was responding when I re-read your first post - uh-oh.
Just noticed you are Centos - does that mean you are also running LVM ???.
 
Old 08-23-2007, 12:41 PM   #12
recneps_divad
LQ Newbie
 
Registered: Aug 2007
Posts: 12

Original Poster
Rep: Reputation: 0
CentOS, yes. LVM, no.
 
Old 08-23-2007, 11:18 PM   #13
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,108

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Given that mdadm is device layer, and you're interested in filesystem layer, try something like gparted. It has a livedCD, and is a GUI (think Partition Magic). Grab the edge of the partition and drag it. It'll fix the filesystem at the same time.
I'd use the liveCD to make sure there are no mount issues.
Then boot up and see if mdadm will still talk to you - then add the other disk.

BTW, the reason I said "safest" was because you can build the second RAID set without risking your current data. Generally considered a positive attribute in a production environment.
Once built, it's just a mount point.
Your data, your choice.
 
Old 12-18-2007, 05:36 PM   #14
recneps_divad
LQ Newbie
 
Registered: Aug 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Closure...

If anybody stumbles on this thread in the future, here's the epilogue to my tale.

I found a guy who knows a lot more about Linux than I did. We groped around a lot trying some of the same things that I had tried before. We finally hit on the answer that best solved the problem. (I'm paraphrasing here since he did the work remotely.)

The answer was to load the old system drive into a USB enclosure for later access. We installed the new drives in the server and did a fresh install of CentOS using RAID and LVM for the partitions. He then made a tar-ball of the old system and restored it over the top of the system he had installed. This gave us the benefit of having a properly configured RAID of the proper size and the operating system configured (and user files) as we had wanted it.

The server is now up and running and I'm a very happy fellow. Many thanks to all that had chimed in to help.
 
  


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
Can't get my head around system-wide email... ArthurDent Linux - Newbie 2 05-20-2007 01:56 AM
multi head system console? somnambulist Linux - Hardware 0 03-05-2007 10:58 PM
how many disks does my system have and how mcuh space does each have? mbhenry Linux - Newbie 10 10-24-2003 06:40 PM
gnome-terminal on a dual head system acid_kewpie Linux - Software 0 02-05-2003 12:34 PM
Need to query how many disks the system recognizes rdaves@earthlink.net Linux - General 1 06-26-2001 04:55 PM


All times are GMT -5. The time now is 12:13 AM.

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