Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.
On Fri, 24 Apr 2009, Kristinn Soffanias Runarsson wrote: > On Fri, Apr 24, 2009 at 10:39 PM, Tom Brown <tbrown at baremetal.com> wrote: > >> On Fri, 24 Apr 2009, Kristinn Soffanias Runarsson wrote: >> >> Yeah I could do pvmove, that is what I will be using on machines that are >>> using LVM. But most of them are just using plain devices. And LVM >>> doesn't >>> support non-destructive import of a device into LVM (but Solaris SVM does >>> :) >>> and I've had good results with that :) >>> >>> so drbd out of the question? :) >>> >> >> I have no idea. I don't know how you're consuming the storage, whether you >> can tolerate a reboot or two, whether this is the root filesystem of a >> device that is literally booting off it (as compared to a virtual machine >> using it for /). >> >> MD _might_ be able to help. You can build a mirror of an existing device, >> but you need to be able to tell your storage "consumer" to switch from using >> /dev/sda1 to /dev/md0 ... same as you would for drbd. The only real >> difference between using drbd and md is that drbd wants to sync to a remote >> server. MD wants to sync two local devices... but one or both of those could >> be network attached storage. lookup mdadm (the build option) if that seems >> interesting. >> >> That said, I've neither done this, nor do I have time to test it. >> >> -Tom >> > > Yeah I can survive a few reboots, but not lengthy outages. As far as MD is > concerned.. it cannot consume a device that already contains data without > destroying it. Bull. Here's a test. Build yourself a pair of block devices. Format one. This will represent your existing physical device. Format it, put data on it, etc. Here I've created two logical values /dev/vg1/part1 and part2 Now setup the raid1 in degraded mode mdadm --build /dev/md1 -l raid1 --raid-devices=2 /dev/vg1/part1 missing /dev/md1 _is_ /dev/vg1/part1 ... which happens to be the device I setup... e.g. formatted put a filesystem on it, and filled it up. But you can check at the low level if you wish: [root at tom2 mnt]# md5sum /dev/md1 /dev/vg1/part1 47c1572e9214fd60f95a450c53d7afdd /dev/md1 47c1572e9214fd60f95a450c53d7afdd /dev/vg1/part1 from here you'd just add whatever you wanted to mirror to. root at tom2 mnt]# mdadm --manage /dev/md1 --add /dev/vg1/part2 mdadm: added /dev/vg1/part2 [root at tom2 mnt]# cat /proc/mdstat Personalities : [raid0] [raid1] md1 : active raid1 dm-7[2] dm-6[0] 1048576 blocks super non-persistent [2/1] [U_] [==>..................] recovery = 10.0% (106176/1048576) finish=0.7min speed=21235K/sec after a while it'll be fully mirrored. [root at tom2 mnt]# cat /proc/mdstat Personalities : [raid0] [raid1] md1 : active raid1 dm-7[2] dm-6[0] 1048576 blocks super non-persistent [2/2] [UU] 3f23ad4b69d0a552042d1ed0f4399857 /usr/src/linux-2.6.24.tar.bz2 3f23ad4b69d0a552042d1ed0f4399857 /mnt/linux-2.6.24.tar.bz2 64921b5ff5cdadbccfcd3820f03be7d8 /usr/src/linux-2.6.29.tar.bz2 64921b5ff5cdadbccfcd3820f03be7d8 /mnt/linux-2.6.29.tar.bz2 [root at tom2 /]# mdadm --stop /dev/md1 mdadm: stopped /dev/md1 fini. But it is your data. DO as you wish. I just wish you wouldn't ask for advice and then tell the people that provide advice that they don't know what they are talking about. hhmm, seems to me I can probably do a better job of proving the not "destroying it" point if I avoid running the proactive filesystem checks which modify the md5sums # ugh, this is slow... [root at tom2 /]# dd if=/dev/urandom of=/dev/vg1/part1 dd: writing to `/dev/vg1/part1': No space left on device 2097153+0 records in #snip [root at tom2 /]# mke2fs -j /dev/vg1/part1 [root at tom2 /]# fsck -f /dev/vg1/part1 [root at tom2 /]# md5sum /dev/vg1/part1 30c3e250f68b33ec8f2d32d9c90bfc78 /dev/vg1/part1 root at tom2 /]# mdadm --build /dev/md1 -l raid1 --raid-devices=2 /dev/vg1/part1 missing mdadm: array /dev/md1 built and started. [root at tom2 /]# mdadm --manage /dev/md1 --add /dev/vg1/part2 [root at tom2 /]# # wait for it to sync [root at tom2 /]# cat /proc/mdstat Personalities : [raid0] [raid1] md1 : active raid1 dm-7[2] dm-6[0] 1048576 blocks super non-persistent [2/2] [UU] md0 : active raid1 sdb2[0] sda2[1] 5124608 blocks [2/2] [UU] [root at tom2 /]# md5sum /dev/vg1/part? 30c3e250f68b33ec8f2d32d9c90bfc78 /dev/vg1/part1 30c3e250f68b33ec8f2d32d9c90bfc78 /dev/vg1/part2 So, is that sufficient proof that this statement is simply wrong? > As far as MD is > concerned.. it cannot consume a device that already contains data without > destroying it. ? -Tom