1

i want to boot a working raid-1 linux system from just one of the member disks. i imagine, this could be done with a grub boot parameter, but i'm not sure.

reason is, that the vmware P2V converter doesn't handle software raid and so i want to temporarily run the machine from a single disk. i have no physical access to the machine, so just unplugging one of the disks is no option.

that's like the mount looks like right now:


/dev/md1 on / type ext3 (rw)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/md5 on /usr type xfs (rw)
/dev/md6 on /var type xfs (rw,usrquota)
/dev/md7 on /home type xfs (rw,usrquota)
none on /tmp type tmpfs (rw)
securityfs on /sys/kernel/security type securityfs (rw)

/dev/md1:
        Version : 00.90.03
  Creation Time : Fri Jan 16 12:08:20 2009
     Raid Level : raid1
     Array Size : 987840 (964.85 MiB 1011.55 MB)
  Used Dev Size : 987840 (964.85 MiB 1011.55 MB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 1
    Persistence : Superblock is persistent

    Update Time : Sun Aug  1 14:44:57 2010
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           UUID : bebe1063:a280d9c1:06e8163b:f5e4117e
         Events : 0.124

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1
2
  • Assuming this can be done at all, just be aware that as soon as you break the mirror you're going to have two different "systems" as the filesystem on the active platter will start to diverge rapidly from the inactive one. You'll need to have a "sync" strategy ready if you want to "unbreak" the mirror later...
    – hotei
    Aug 1, 2010 at 16:41
  • @perler Here is a message posted for you by superuser.com/users/292389/mbrinson - Any follow up on this? I'm in exactly the same boat and was hoping you had figured something out that you just never came back to share on this post. Jan 22, 2014 at 19:16

1 Answer 1

1

I'm not sure if the following will help you because I don't know anything about the vmware P2V converter, but here goes.

You can artificially declare one of the disks in the mirror as failed with mdadm /dev/md1 --fail /dev/sdb1, then transfer /dev/sda1 with the VMware converter, create another disk of equal size in the VM, and add that back to the array with mdadm /dev/md1 --add /dev/sdb1 (the numbers may be different).

It may be helpful to know that the format of a volume in an md RAID1 array is very simple: it's the normal volume contents, plus an md superblock at the end of the disk. So you can convert a RAID1 array to a standalone volume by just discarding the other volume. Going the other way, you have to make sure that the filesystem leaves enough room for the superblock at the end of the volume, which will be the case if you created the filesystem inside an array in the first place.

7
  • i don't think this helps, as the system is still booting from /dev/md1 and this is something, vmware converter doesn't supports. but i will try anyway.
    – perler
    Aug 4, 2010 at 6:59
  • @perler: A consequence of my last paragraph is that you can change /dev/md1 to /dev/sda1 in your boot loader configuration and your fstab. Does this help? Aug 4, 2010 at 7:11
  • yes, just gave it a try, the same result. (ah ok, just read you comment, will try)
    – perler
    Aug 4, 2010 at 7:14
  • ok, this looks much better. the vmware converter still complains about a missing /boot mount (the machine boots from /) but this is another battle field. could you give me an instruction how to safely turn the raid on again after cloning the machine?
    – perler
    Aug 4, 2010 at 7:21
  • @perler: You should now have an md array in the VM (not sure if it'll have the right number). Change your fstab and the root= setting on the kernel command line back to it. The array will be degraded because there's only one volume on it, but now you can add a second disk to it as per the end of my second paragraph. Aug 4, 2010 at 7:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .