Fedora Linux Support Community & Resources Center
  #1  
Old 26th February 2012, 03:43 PM
pitbull Offline
Registered User
 
Join Date: Dec 2011
Posts: 11
windows_7chrome
Moving software RAID5 to a new machine.

I bought a refurbished IBM S50 Small Form factor desktop to be my new server. I'm curently running Fedora 14 with Amahi as a home server. I have my linux install on an 30Gb Ide drive, and all the storage on 3 x 200Gb SATA drives, software raided5.

I want to reinstall Fedora with Amahi on the new machine, and move from my old to the new server. Is there any risks? There is no urgency on this, I want to plan this right as I don't want to lose any data in the process.

Toughts?
Reply With Quote
  #2  
Old 26th February 2012, 05:25 PM
DrHappyAngry Offline
Registered User
 
Join Date: Jan 2012
Location: Seattle
Posts: 19
linuxfirefox
Re: Moving software RAID5 to a new machine.

The kernel should just see that there's Linux raid autodetect partitions on the drives, bring up the array, and assign it device node like /dev/md0. To be on the safe side you might want to copy over your mdadm.conf file from the old system. If you haven't made one, you can generate it by running "mdadm --detail --scan >> /etc/mdadm.conf" and just copy it over to the new box. The mdadm.conf file isn't really necessary, but it's not a bad idea, just in case you need it to re-assemble the array. Plus you can put your email address in there and have it send you an email if a drive fails. You'll also want to make sure mdadm is installed. It's probably installed by default in fedora, just double check that you've got it.

So copy mdadm.conf to new server and make sure mdadm is installed.

Power down both machines.

Transfer drives to new machine.

Bring up new machine and check if the array is detected.

Mount it and create an fstab entry so it mounts on bootup.

It's still not a bad idea to have backups before you go juggling around your data, especially since raid doesn't protect against accidental deletion and overwrites.
Reply With Quote
  #3  
Old 26th February 2012, 05:40 PM
pitbull Offline
Registered User
 
Join Date: Dec 2011
Posts: 11
macoschrome
Re: Moving software RAID5 to a new machine.

I was planning on having the array setup during install let the install create the mdadm.conf.

Every time I tried adding the array manually and edit the fstab file after install, it would fail to mount at boot.

Good point on backing up the mdadm.conf though
Reply With Quote
  #4  
Old 1st March 2012, 03:53 PM
pitbull Offline
Registered User
 
Join Date: Dec 2011
Posts: 11
windows_7chrome
Re: Moving software RAID5 to a new machine.

Should I recreate the array during the install or just select the 3 drive to be included?
Reply With Quote
  #5  
Old 3rd March 2012, 03:40 AM
DrHappyAngry Offline
Registered User
 
Join Date: Jan 2012
Location: Seattle
Posts: 19
linuxfirefox
Re: Moving software RAID5 to a new machine.

I wouldn't even have the drives plugged in during install, just in case. But if you want to go that route, do not recreate the array. The installer should see it and you just need to set a mount point, and be sure it's set to NOT format during install. It's been a long time since I've seen an install with an mdadm array already present that I was trying to preserve, so I'm not 100% on that.

I just did a firmware update that jacked around my device IDs on my drives, so my mdadm.conf file was no longer accurate. Once I took it out of the fstab and got the system fully booted, mdadm found it and I've just made a new mdadm.conf file with the updated IDs. This should get it back up and running again... I hope. I've had other issues that I'm updating the firmware for, and am waiting on a fsck to complete. At least I have a full backup, but man it takes a long time to rsync 4TBs of data.
Reply With Quote
  #6  
Old 3rd March 2012, 07:27 AM
leigh123linux Online
Retired Administrator
 
Join Date: Oct 2006
Posts: 22,370
linuxfirefox
Re: Moving software RAID5 to a new machine.

Moved to EOL (End Of Life) Versions
Reply With Quote
  #7  
Old 3rd March 2012, 05:19 PM
pitbull Offline
Registered User
 
Join Date: Dec 2011
Posts: 11
macoschrome
Re: Moving software RAID5 to a new machine.

Ok I guess I screwed up big time. During the install process, I moved the 3 drives to the right columns at the page where you pick the drives that will be part of the install. Sure enough, I was rushing and did'nt pay attention and the installer used the 3 drives as 3 units, not 1 array. It copied folders on 2 of the drives. I ended up losing everything it. I had backups of the most important stuff, but at the end I lost all the kids movies, around 70 +/-... luckily the forgave me ;o)) I recreated the array then, after a 16hr sync,
mounted the array and proceeded to a reboot. The boot failed due to an array error.... 1 drive would failed, but I could stop and reassemble the array manually. once booted after a rescue and comment out the line FSTAB about the array. looking in the disk utility, I could see that the OS "was confused" and partially saw 2 arrays... But there was no signs of that array in fdisk -l or in fstab....

I am reinstalling (windows user habit I gues.. ;o) )right now, with the drives unplugged and will see what happended next

So far, my software RAID experience with Linux as proven to be extremely painful, MDADM seems very finicky....

---------- Post added at 12:12 PM ---------- Previous post was at 11:50 AM ----------

Ok.... the OS refers to a /dev/md127 array that fails to mount properly. There is no trace of that in the mdadm.conf.... I would like to get rid of that phoney array, I'm guessing that it is the source of my problems, at least part of it. I tried

mdadm --stop /dev/md127

then

mdadm --remove /dev/md127

the last one returns an error, because it`s not part of the mdadm.conf.

?????

---------- Post added at 12:19 PM ---------- Previous post was at 12:12 PM ----------

I zeroized superblock on sdb, sdc and sdd. No more ref to /dev/md127.

I think I'm going somewhere...
Reply With Quote
  #8  
Old 5th March 2012, 03:24 PM
DrHappyAngry Offline
Registered User
 
Join Date: Jan 2012
Location: Seattle
Posts: 19
linuxfirefox
Re: Moving software RAID5 to a new machine.

I've seen cases, and just in fact went through this myself, where Linux still sees the old array and filesystem on there, when you recreate it exactly as it was before. I've gotten around this by just writing some data directly to the device and rebooting before recreating the array. This prevents the OS from finding anything there. I did this by running "dd if=/dev/zero of=/dev/sdX" where sdX is each member of the array. You only need to run it for maybe 10 seconds on each device, just enough to clear partition tables and file systems. It'll take hours on each device if you let it write to every block on it.

Man, just went through a huge amount of pain figuring out what was going on, and in the end had to wipe and reload my array. Some RAM I just bought hosed the whole array. Pretty much every checksum operation was failing, even ones for yum/rpm. Weird thing is the RAM went through 10 passes of memtest86+ in another machine just fine, but drop it into that box and checksums fail left and right. It was not pretty.
Reply With Quote
  #9  
Old 5th March 2012, 04:10 PM
pitbull Offline
Registered User
 
Join Date: Dec 2011
Posts: 11
windows_7chrome
Re: Moving software RAID5 to a new machine.

Well I managed to get it sorted out. after deleting the superbocks, and recreating the array from scratch, and after 15 hours of syncing, It kinda worked.

As soom as I rebooted, I had failed to mount array, 1 drive failed. No boot.

I added nodmraid in the grub config, 1 drive fail but it boots.

So I commented the line in FSTAB, restarded, and I could then mount it manually. So I added these commands in etc/rc.local:

mdadm --stop dev/md0
mdadm -A /dev/md0
mount /dev/md0 /mnt/raid.

It`s probably not the ideal solution but it works pretty good.

I`m confused about your ram....
Reply With Quote
  #10  
Old 6th March 2012, 01:46 AM
DrHappyAngry Offline
Registered User
 
Join Date: Jan 2012
Location: Seattle
Posts: 19
linuxfirefox
Re: Moving software RAID5 to a new machine.

Check your mdadm.conf file to see if it's devices match up to what's really there. Run "mdadm --detail --scan" and compare the UUIDs to your /etc/mdadm.conf file. You've redone the array so the device IDs should have changed, and if you haven't updated those in mdadm.conf, it's going to try and bring up a non-existent array early in the bootup. I've found that it seems to try to bring up stuff in mdadm.conf early in bootup, but can successfully autodetect md devices later in the bootup, at least on centos. Also you might want to post your fstab file and the output of "blkid" if you still can't get it going.

Ya, that's pretty messed up that some ram can trash an array, but after spending the whole weekend with it, it's pretty obviously the problem. Just sticking the stuff into a machine will make even an rpm -qa fail due to all the incorrect checksums it causes. As soon as I put it in and booted the file system and array had errors. Leaving the ram in, rebuilding the array, formatting it, and mounting it once would instantly cause file system errors too. I probably could have recovered the array, but I feel a lot safe restoring it all from backups.
Reply With Quote
  #11  
Old 6th March 2012, 02:06 AM
pitbull Offline
Registered User
 
Join Date: Dec 2011
Posts: 11
windows_7chrome
Re: Moving software RAID5 to a new machine.

Yep. UUIDs are matching.

BLKID

[root@pitbull ~]# blkid
/dev/sda1: UUID="f70a7043-ebd8-4f92-9078-c768e7d281cd" TYPE="ext4"
/dev/sda2: UUID="fi7LjH-hz4T-hI1x-GHUl-sJAt-OuTQ-2EsiAi" TYPE="LVM2_member"
/dev/sda3: UUID="be736f26-5bae-47c5-88eb-8e20f23744bb" TYPE="ext4"
/dev/sdb1: UUID="101988d5-21ae-2973-494c-f3067ec52c49" UUID_SUB="2195d57e-c27c-e 986-8d20-d5292eb89e2b" LABEL="pitbull:0" TYPE="linux_raid_member"
/dev/sdc1: UUID="101988d5-21ae-2973-494c-f3067ec52c49" UUID_SUB="405269be-67d8-3 9b6-c4ff-1a31f751e89f" LABEL="pitbull:0" TYPE="linux_raid_member"
/dev/sdd1: UUID="101988d5-21ae-2973-494c-f3067ec52c49" UUID_SUB="e32cb46c-4fde-a 2d4-b932-3b043d886118" LABEL="pitbull:0" TYPE="linux_raid_member"
/dev/mapper/vg_pitbull-lv_swap: UUID="4247e56d-f492-418b-a9f4-b23d19551411" TYPE ="swap"
/dev/mapper/vg_pitbull-lv_root: UUID="000fc2f1-7567-49f2-a243-3ccfa3f5a5d9" TYPE ="ext4"
/dev/mapper/vg_pitbull-lv_home: UUID="f6d60b34-2902-4476-a7c4-d0073bdc6009" TYPE ="ext4"
/dev/md0: UUID="00cbbb67-e277-43f3-a036-31a85a7a2d9e" TYPE="ext4"



FSTAB:


#
# /etc/fstab
# Created by anaconda on Sat Mar 3 11:14:25 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_pitbull-lv_root / ext4 defaults 1 1
UUID=f70a7043-ebd8-4f92-9078-c768e7d281cd /boot ext4 defaults 1 2
/dev/mapper/vg_pitbull-lv_home /home ext4 defaults 1 2
UUID=be736f26-5bae-47c5-88eb-8e20f23744bb /var/hda/files ext4 defaults 1 2
/dev/mapper/vg_pitbull-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
#/dev/md0 /mnt/raid ext4 defaults 1 2
~
MDADM.CONF
ARRAY /dev/md0 metadata=1.2 name=pitbull:0 UUID=101988d5:21ae2973:494cf306:7ec52c49


UUID does not match between blkid & my mdadm.config ??!!

Last edited by pitbull; 6th March 2012 at 02:09 AM.
Reply With Quote
  #12  
Old 6th March 2012, 05:08 AM
DrHappyAngry Offline
Registered User
 
Join Date: Jan 2012
Location: Seattle
Posts: 19
linuxfirefox
Re: Moving software RAID5 to a new machine.

That's fine, those are colon seperated IDs of the individual devices in the array. So long as they match the output of mdadm --detail --scan it should be fine.

You added the array after the install? You might need to add mdadm to your initial ramdisk. I haven't done much with that under fedora, but think you just have to run dracut with the line for md0 uncommented from your fstab. You should probably look into that a bit more, as that's an area I haven't played with much.
Reply With Quote
Reply

Tags
machine, moving, raid5, software

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM root on software Raid5 pza Installation, Upgrades and Live Media 1 24th December 2011 04:35 PM
Software Raid5 seabird Using Fedora 8 24th July 2009 08:41 PM
Is this my software raid5?? seabird Using Fedora 0 13th March 2009 11:36 PM
Software RAID5 nightmare arear Servers & Networking 7 5th July 2006 10:02 AM
Some questions on software raid5 on fc3 muc Servers & Networking 0 11th December 2004 01:39 PM


Current GMT-time: 17:44 (Thursday, 24-07-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat