F16 - Converting to RAID1
OK, I'm a long-time RedHat/Fedora user, but some of the recent changes
(grub2, systemd, hal, etc.) are modifying or deprecating my tried and true methods. The latest issue I've got is that I want to add a second drive in a RAID1 config for my main data partitions. This is something I had planned all along and thought it wouldn't be a big deal. I've done it countless times before. I've even got much of the work already done. There are just a few pieces that have changed and I want to make sure I get it right the first time. I recently built a new "main" machine for my home office. It plays many roles including that of main Fedora workstation as well as main Fedora server. I primarily use this machine to provide server functions but do use it for things like photo/movie/mp3 processing, Amarok, GIMP, etc. I built it right before Christmas with an SSD for everything except for {swap}, /var, and /data, which is on a separate 2TB drive. When originally built it only used one data drive because HDD prices were high. A few weeks later I picked up a matching drive on special. It's installed, has partitioned, RAIDed (degraded), formatted, and it contains a copy of the data. The problem is I'm not 100% sure what I need to do to get this thing converted over for the reboot. The drives are /dev/sda (SSD), /dev/sdb (existing data drive with ext4 partitions), /dev/sdc (new data drive). Here's what I was planning to do: 1. Umount the two RAID devices with a current copy of data. 2. Edit /etc/fstab replacing Device IDs with new RAID devices (UUID=???? becomes /dev/md?) 3. Make backup of /boot/grub2/grub.cfg 4. Make backup of /boot/initramfs-$(uname -r).x86_64.img 5. dracut --force initramfs-$(uname -r).img $(uname -r) 6. grub2-mkconfig -o /boot/grub2/grub.cfg 7. I don't think I need to install grub2 on the new drive because that's already on the SSD primary drive. 8. Do I need to remove the "rd.md=0" from /etc/default/grub? Or will grub-2-mkconfig fix this? 9. Reboot and hope it starts with the new RAID devices (did I mention that /var is on this disk as well?) 10. Modify partition types of /dev/sdb to fd (linux raid autodetect) 11. Add /dev/sdb to the RAID1 arrays and let them sync (mdadm --add /dev/md? /dev/sdc?) I would appreciate any advice. Thanks, -Brian -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org |
F16 - Converting to RAID1
Brian Hanks writes:
1. Umount the two RAID devices with a current copy of data. 2. Edit /etc/fstab replacing Device IDs with new RAID devices (UUID=???? becomes /dev/md?) Although you can, /etc/fstab should still refer to filesystem UUIDs. If you're switch partitions, /etc/fstab will simply need to refer to the correct filesystem, by its uuid. As long as the md arrays get assembled properly, and contain a usable filesystem, select the filesystem by UUID. 3. Make backup of /boot/grub2/grub.cfg 4. Make backup of /boot/initramfs-$(uname -r).x86_64.img 5. dracut --force initramfs-$(uname -r).img $(uname -r) My favorite trick is run plymouth-set-default-theme with the --rebuild- initrd flag, that causes the current kernel's initramfs to get rebuilt. Right now, plymouth has a bug where it adds a redundant grub menu entry each time you run it, which will need to be manually dropped, and in your case it wouldn't matter because you're about to run grub2-mkconfig anyway. 6. grub2-mkconfig -o /boot/grub2/grub.cfg 7. I don't think I need to install grub2 on the new drive because that's already on the SSD primary drive. Correct. grub2 only needs to be installed on the boot drive. 8. Do I need to remove the "rd.md=0" from /etc/default/grub? Or will grub-2-mkconfig fix this? No, grub2-mkconfig won't fix it, and you will need to do it yourself. Additionally, it's necessary to add the boot parameters rd.md.uuid={uuid} to the kernel boot line, for every mdraid device, where {uuid} is the MD uuid, not the filesystem uuid. That's the uuid reported by mdadm --detail /dev/mdN Although it's been my experience that mdraid volumes usually still get assembled at system boot time even in the absence of an explicit rd.md.uuid boot parameter, the problem is the "usually" part, and I've had persistent problems with one of the RAID-1 volumes inexpicably coming up degraded, after a reboot, with one of the devices missing, forcing me to add it manually, and then wait for the array to resync. This got old very quickly, and I just didn't want to waste time any more figuring out what's broken in initscripts, plus, without an explicit declaration the undeclared RAID volumes were getting assigned a high minor device number, like /dev/md127, rather than an expected low number. Which was a little bit of an eyesore, but after I figured out that my problem was the missing boot parameter, and added an explicit boot parameter for the partition, the problem went away, and the array was assigned a reasonable, low /dev/md minor device number. The end result is that the boot parameters will get the arrays built at the system boot, by their MD uuids first, then mount can find their filesystem uuids, and mount them. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org |
F16 - Converting to RAID1
On 01/02/2012 03:31 AM, Sam Varshavchik wrote:
> without an explicit declaration the undeclared RAID volumes were getting assigned a high minor device number, like /dev/md127, rather than an expected low number. Which was a little bit of an eyesore, but after I figured out that my problem was the missing boot parameter, and added an explicit boot parameter for the partition, the problem went away, and the array was assigned a reasonable, low /dev/md minor device number. It is not necessary to declare volumes with boot parameters. I've found that having a proper line in mdadm.conf is enough; but you have to rebuild the initramfs, because it contains a copy of the mdadm.conf. A file like: MAILADDR root AUTO +imsm +1.x -all ARRAY /dev/md0 UUID=xxxxxxxx:xxxxxxxx:xxxxxxxx:xxxxxxxx (with correct UUID) will be enough to avoid /dev/md127. -- Roberto Ragusa mail at robertoragusa.it -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org |
F16 - Converting to RAID1
Many thanks for the suggestions and validation. I modified my process
steps per the suggestions and I just executed all of the steps. It worked flawlessly. Thanks again, -Brian -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org |
| All times are GMT. The time now is 04:32 PM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.