Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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 has 2 40GB drives which are in a RAID. I need to replace them both with 2 new 300 GB drives and keep the data. Ive read through some other posts but didn't really seem to get a clear understanding of what to do.
Disk /dev/hda: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 260 131008+ fd Linux raid autodetect
/dev/hda2 261 4421 2097144 fd Linux raid autodetect
/dev/hda3 4422 77545 36854496 fd Linux raid autodetect
Disk /dev/hdb: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 260 131008+ fd Linux raid autodetect
/dev/hdb2 261 4421 2097144 fd Linux raid autodetect
/dev/hdb3 4422 77545 36854496 fd Linux raid autodetect
Can I take the 2nd drive out, put in the new 300GB drive, make the first drive write it's data to the new drive, then swap out the 1st drive and put in the 2nd 300GB drive and have the drive write it's data to the new drive? Or any other suggestions...
The current drives are IDE and on the first IDE channel, there is a CDROM only on the second IDE channel. Could I put both new drives on the second IDE channel, doing away with the CDROM and some how sync the drives up that way?
:edit:
This server is running FC2, yeah I know... It's on it's way to being upgraded...
Update Time : Wed May 7 15:39:43 2008
State : clean, no-errors
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Number Major Minor RaidDevice State
0 3 1 0 active sync /dev/hda1
1 3 65 1 active sync /dev/hdb1
UUID : b9eec35e:6f3c30b5:4d8b14fa:47d5dbf6
Events : 0.3491
[root@hermes proc]# mdadm -D /dev/md2
/dev/md2:
Version : 00.90.01
Creation Time : Thu Apr 25 15:30:56 2002
Raid Level : raid1
Array Size : 36854272 (35.15 GiB 37.74 GB)
Device Size : 36854272 (35.15 GiB 37.74 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 2
Persistence : Superblock is persistent
Update Time : Wed May 14 10:57:45 2008
State : clean, no-errors
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Number Major Minor RaidDevice State
0 3 3 0 active sync /dev/hda3
1 3 67 1 active sync /dev/hdb3
UUID : 940f03af:d6a5be55:15d12ea9:1ce8eb5d
Events : 0.53463761
Last edited by ncsuapex; 05-14-2008 at 09:58 AM.
Reason: raid
Here's my thoughts, having recently done something similar:
Probably the safest (and easiest) thing would be to install both new disks in place of the old ones and restore from the backup you just made prior.
If you can't do that, then putting the new disks on the second IDE channel might work, but I suspect that you might eventually end up with boot order problems unless you are (very) careful.
If the machine is old enough to have 40G drives you might want to make sure that both IDE channels can see the 300G drives properly; the motherboard manual might have info on that, or you can just plug them in and see what a live CD makes of the situation.
You could probably do something pretty tricky with breaking the mirror, installing one new 300G disk, formatting it, adding it to the mirror and syncing, then repeat the process for the second disk, but I *think* you'd be stuck with your original partition sizes.
yeah from what I've been reading.. If I swapped one of the old drives with a larger drive it will only recognize the amount of the older drive. BUT if I did that... Could I repartition the new drive to expand it to it's full amount, then swap out the 2nd old drive with the 2nd new drive and then it should mirror as the entire amount?
The mother board is a e210882 so it should handled the 300GB hard drives. Still trying to figure out if I can swap the new drive out mirror it with one of the old drives, then expand the new drive to its full capicity, then mirror the 2nd drive. Also how would I go about making sure the boot partition gets transfered?
:EDIT:
Ok, think I found something.
resize2fs -f /dev/md0 400000M(changing this to my drive specs)
Could I swap out one of the drives with the new 300GB drive, mirror the new drive, THEN run the resize2fs command, then swap out the 2nd drives?
:EDIT:
Ok... change of plans. I am leaving the 2 old drives in place, ADDING the 2 new drives and just moving content over to the new drives. But I'd still like to know if the mirror/resize2fs would work..
Last edited by ncsuapex; 05-15-2008 at 11:01 AM.
Reason: ..
I'm thinking that you can only resize the filesystem if you have a partition that's big enough. If you used LVM on RAID, you might be able to expand the partition size then resize the filesystem, but otherwise I think you'll be stuck with the original partitions. You don't want to change the partitions on a raid system, let alone try to resize them with gparted or something.
^ makes sense. Anyways. I added the 2 drives following this how to and every thing went well, except the 2 new drives do not show up in /etc/raidtab but they do show up in /proc/mdstat
Looks good to me, but what does mdadm --detail /dev/md3 show?
Not sure, but I think the /etc/raidtab file is left over from the "raidtools" days and is superfluous under mdadm. Never bothered with it myself, haven't had any problem (that I've noticed).
I guess the ultimate test of seeing whether the mirror worked is "failing" either disk as a test and seeing if the system still has the remaining array. You can mark a disk as failed using mdadm, OR remove each one separately from the array, OR powerdown the machine and physically unplug one of the drives to see what will happen. Of course after a simulated failure, you're going to have to do a recovery; ie. pretend the "failed" disk is a new one, re-add it to the array and resync/rebuild the array. Tedious.
After posting I did some more research and found out that the raidtab isn't used in fedora so that's a relief, just found it odd that the other raid was in there.. anyways..
mdadm --detail /dev/md3
/dev/md3:
Version : 00.90.01
Creation Time : Tue Jan 1 00:31:39 2002
Raid Level : raid1
Array Size : 293033536 (279.46 GiB 300.07 GB)
Device Size : 293033536 (279.46 GiB 300.07 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 3
Persistence : Superblock is persistent
Update Time : Fri May 16 15:50:48 2008
State : clean, no-errors
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Number Major Minor RaidDevice State
0 22 1 0 active sync /dev/hdc1
1 22 65 1 active sync /dev/hdd1
UUID : 224ddbbc:0eb0311a:49df2695:9a517e4c
Events : 0.20239
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.