Sponsored Content
Full Discussion: Root mirroring in SUSE 10.1
Operating Systems Linux SuSE Root mirroring in SUSE 10.1 Post 302483707 by pludi on Tuesday 28th of December 2010 11:01:54 AM
Old 12-28-2010
Alright. I've asked about the partition layout since it seems quite strange: 3 logical partitions (2 Linux + 1 Swap) inside an Windows extended partition isn't what you usually find in an production environment. A virtual machine might have been better for testing, since you could create snapshots to go back to if a step fails.

I'll try to create a suitable checklist/how-to, but it might take some time. Things like this shouldn't be rushed...

---------- Post updated at 17:01 ---------- Previous update was at 12:39 ----------

Alright, I think I've got it.

DISCLAIMER:
This procedure is extremely dangerous and should not be applied to any production server without a proven good backup. Neither I nor this site can be held accountable for any data loss you might encounter. Really.
  1. Boot to "Rescue mode" using the installation CD
  2. Replicate the partition layout:
    Code:
    sfdisk -d /dev/sda | sed -e 's/sda/sdb' | sfdisk /dev/sdb

  3. Change the partition type of /dev/sdb6 to "RAID autodetect"
    Code:
    echo -e "t\n6\nfd\nw" | fdisk /dev/sdb

  4. Create the array with 1 disk missing (will be added later)
    Code:
    mdadm --create /dev/md0 -l 1 -n 2 -x 0 /dev/sdb6 missing

    #
  5. Create a filesystem on it
    Code:
    mkfs -t reiserfs /dev/md0

  6. Mount the old and new "root"
    Code:
    mkdir /tmp/old
    mount /dev/sda6 /tmp/old
    mkdir /tmp/new
    mount /dev/md0 /tmp/new

  7. Copy over the old contents (could take a while)
    Code:
    cd /tmp/old
    find . -xdev | cpio -pmdV /tmp/new/.

  8. Cross your fingers, because after the next step the original system is probably not salvageable.
  9. Unmount the old "root" and change the partition type
    Code:
    cd /tmp
    umount old
    echo -e "t\n6\nfd\nw" | fdisk /dev/sda

  10. Add the "old root" to the array so it can rebuild in the background
    Code:
    mdadm --add /dev/md0 /dev/sda6

  11. chroot into the new array to make needed changes. Do not exit the chroot until told to do so
    Code:
    chroot /tmp/new

  12. Mount some needed stuff
    Code:
    mount -t proc proc /proc
    /etc/init.d/boot.udev stop & /etc/init.d/boot.udev start

  13. Replace sda6 with md0 in these files: /boot/grub/menu.lst, /etc/fstab
  14. Install Grub on both disks (the '>' indicate to enter this at the Grub prompt and are not part of the command)
    Code:
    grub
    > root (hd0,5)
    > setup (hd0)
    > root (hd1,5)
    > setup (hd1)
    > quit

  15. Create a suitable mdadm.conf
    Code:
    echo "DEVICE partitions" > /etc/mdadm.conf
    mdadm --examine --scan >> /etc/mdadm.conf

  16. Rebuild initrd (replace xxx with the appropriate file)
    Code:
    cd /boot
    mkinitrd -k vmlinux-xxx -i initrd-xxx

  17. Umount and exit the chroot
    Code:
    /etc/init.d/boot.udev stop
    umount /proc
    exit

  18. Check the rebuild status with mdadm --detail /dev/md0
  19. When the array is done rebuilding shutdown -r now
  20. Hope that do didn't do anything wrong
This User Gave Thanks to pludi For This Post:
 

9 More Discussions You Might Find Interesting

1. Solaris

Solaris mirroring / non-root disk

Hi Guys, Need to add 2 disks into a JBOD array (3310). Does anyone see anything wrong with my Procedure / Doco below? 1> Logon to system, check system logs for abnormal entries. 2> Make backups of related system files: A>cp -p /etc/system /etc/system.backup.081505 B>cp -p /etc/vfstab... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

2. Solaris

Veritas root disk mirroring

Hi there, My task is to replace the two 73 G disks with two 143 G disks , which has vxvm 4.1 running on it. I would like to know whether the steps iam following are correct. 1. Break the sub-disks, plexes of the root mirror. 2. Remove the sub-disks,plexes of the root mirror. 3. Remove one of... (10 Replies)
Discussion started by: Jartan
10 Replies

3. Solaris

Unable to boot after an error in mirroring root

Hey Guys, I am using a Sun sparc server and had 6 disks. The root was loaded on c0t10d0s0 disk. I made an image or mirrored the root to another disk c0t9d0s0. But during the process instead of attaching submirrors to main mirror (d0 <--- d01 and d11) i attached d0 <--- d01 and... (1 Reply)
Discussion started by: rjcool
1 Replies

4. Solaris

mirroring root disk using svm - but no free slices for metadb's

Hi all, we have an existing system that was configured using just one of the (two) internal disks. I want to mirror the disk using SVM, but have realised there is no free slice for creating the metadb's. Is there a workaround I can use for this? In the past we have always kept slice 7 free -... (8 Replies)
Discussion started by: badoshi
8 Replies

5. Solaris

Root Disk mirroring in SVM

Dear All, Please help me to configure root mirroring using SVM in Solaris 9. Thanks and Regards, Lakkireddy BR (3 Replies)
Discussion started by: lbreddy
3 Replies

6. Solaris

Disk mismatch while trying to zfs mirroring non-root disks

Hello All, I am trying to mirror two non-root hard drives using zfs. But "fmthard" fails when I try to copy the vtoc due to disk mismatch. Please help me. --- iostat command shows the disk to be similiar --- format command shows disk to be different :confused: --- c1t2d0 is the active... (8 Replies)
Discussion started by: pingmeback
8 Replies

7. Solaris

Root disk mirroring in SVM

I tried doing rootdisk mirroring in my local host , i added a new Ide disk in my system and copied the prtvtoc from root disk to the newly added disk, and then when i tried to add database replicas on both the disks, it was added for boot disk but for the newly added disk i gave the error, which... (6 Replies)
Discussion started by: Laxxi
6 Replies

8. Solaris

Root disk mirroring in Solaris 10

I would like to perform root disk mirroring task. Can someone please help me out on this. Thanks !! Regards, Rama (2 Replies)
Discussion started by: ramagore85
2 Replies

9. AIX

Root Mirroring

Hello Team, In one of our machine which running in AIX 6.1 we doing the root mirroring. Currently the OS booted from the local disk and we have mirrored that in to the SAN disk. All went well and both are synced but when we making it as a multiboot its throwing the below error. Kindly... (4 Replies)
Discussion started by: gowthamakanthan
4 Replies
All times are GMT -4. The time now is 09:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy